1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2021-12-03 10:27:35 +02:00
24 changed files with 182 additions and 187 deletions

View File

@@ -3,7 +3,6 @@
#table containing single unique column
#table containing keys like unique(a,b,c,d) etc
#then table containing 2 blob unique etc
set @allowed_packet= @@max_allowed_packet;
#table with single long blob column;
create table t1(a blob unique );
insert into t1 values(1),(2),(3),(56),('sachin'),('maria'),(123456789034567891),(null),(null),(123456789034567890);
@@ -1225,44 +1224,6 @@ DB_ROW_HASH_1
33
44
drop table t1,t2;
#very long blob entry;
SET @@GLOBAL.max_allowed_packet=67108864;
connect 'newcon', localhost, root,,;
connection newcon;
show variables like 'max_allowed_packet';
Variable_name Value
max_allowed_packet 67108864
create table t1(a longblob unique, b longblob , c longblob , unique(b,c));
desc t1;
Field Type Null Key Default Extra
a longblob YES UNI NULL
b longblob YES MUL NULL
c longblob YES NULL
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` longblob DEFAULT NULL,
`b` longblob DEFAULT NULL,
`c` longblob DEFAULT NULL,
UNIQUE KEY `a` (`a`) USING HASH,
UNIQUE KEY `b` (`b`,`c`) USING HASH
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 a 1 a A NULL NULL NULL YES HASH
t1 0 b 1 b A NULL NULL NULL YES HASH
t1 0 b 2 c A NULL NULL NULL YES HASH
insert into t1 values(concat(repeat('sachin',10000000),'1'),concat(repeat('sachin',10000000),'1'),
concat(repeat('sachin',10000000),'1'));
insert into t1 values(concat(repeat('sachin',10000000),'2'),concat(repeat('sachin',10000000),'2'),
concat(repeat('sachin',10000000),'1'));
insert into t1 values(concat(repeat('sachin',10000000),'2'),concat(repeat('sachin',10000000),'2'),
concat(repeat('sachin',10000000),'4'));
ERROR 23000: Duplicate entry 'sachinsachinsachinsachinsachinsachinsachinsachinsachinsachins...' for key 'a'
insert into t1 values(concat(repeat('sachin',10000000),'3'),concat(repeat('sachin',10000000),'1'),
concat(repeat('sachin',10000000),'1'));
ERROR 23000: Duplicate entry 'sachinsachinsachinsachinsachinsachinsachinsachinsachinsachins...' for key 'b'
drop table t1;
#long key unique with different key length
create table t1(a blob, unique(a(3000)));
desc t1;
@@ -1307,9 +1268,6 @@ t1 0 a 2 b A NULL NULL NULL YES HASH
t1 0 c 1 c A NULL 4500 NULL YES HASH
t1 0 c 2 d A NULL NULL NULL YES HASH
drop table t1;
disconnect newcon;
connection default;
SET @@GLOBAL.max_allowed_packet=4194304;
#ext bug
create table t1(a int primary key, b blob unique, c int, d blob , index(c));
show create table t1;
@@ -1477,6 +1435,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT t2.b FROM t1 JOIN t2 ON t1.d = t2.f WHERE t2.pk >= 20;
b
drop table t1,t2;
# End of 10.4 tests
#
# MDEV-21470 MyISAM start_bulk_insert doesn't work with long unique
#
@@ -1492,5 +1451,4 @@ DROP TABLE t1, t2;
#
CREATE TABLE t1 (pk INT, a TEXT NOT NULL DEFAULT '', PRIMARY KEY (pk), b INT AUTO_INCREMENT, UNIQUE(b), UNIQUE (a,b)) ENGINE=myisam;
ERROR HY000: AUTO_INCREMENT column `b` cannot be used in the UNIQUE index `a`
set @@GLOBAL.max_allowed_packet= @allowed_packet;
# End of 10.4 tests
# End of 10.5 tests