summaryrefslogtreecommitdiff
path: root/mysql-test/suite/maria
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2019-08-08 23:04:05 +0300
committerSergei Golubchik <serg@mariadb.org>2019-08-23 11:26:04 +0200
commit6c50875a380aabb9da8926b785524e813e98a82d (patch)
tree8ce40297412f1bcd62830f4e52e308d9f4c8ea57 /mysql-test/suite/maria
parentafe969ba05faece41fdef1275e9b9c510081805b (diff)
downloadmariadb-git-6c50875a380aabb9da8926b785524e813e98a82d.tar.gz
MDEV-20279 Increase Aria index length limit
Limit increased from 1000 to 2000. Avoiding stack overflow by only storing keys and pages on the stack in recursive functions if there is plenty of space on it. Other things: - Use less stack space for b-tree operations as we now only allocate as much space as needed instead of always allocating HA_MAX_KEY_LENGTH. - Replaced most usage of my_safe_alloca() in Aria with the stack_alloc interface. - Moved my_setstacksize() to mysys/my_pthread.c
Diffstat (limited to 'mysql-test/suite/maria')
-rw-r--r--mysql-test/suite/maria/maria-ucs2.result8
-rw-r--r--mysql-test/suite/maria/maria-ucs2.test2
-rw-r--r--mysql-test/suite/maria/maria.result46
-rw-r--r--mysql-test/suite/maria/maria.test6
-rw-r--r--mysql-test/suite/maria/maria3.result4
-rw-r--r--mysql-test/suite/maria/max_length.result23
-rw-r--r--mysql-test/suite/maria/max_length.test6
-rw-r--r--mysql-test/suite/maria/mrr.result10
-rw-r--r--mysql-test/suite/maria/mrr.test4
9 files changed, 62 insertions, 47 deletions
diff --git a/mysql-test/suite/maria/maria-ucs2.result b/mysql-test/suite/maria/maria-ucs2.result
index 1a54ab78081..83eaf88e660 100644
--- a/mysql-test/suite/maria/maria-ucs2.result
+++ b/mysql-test/suite/maria/maria-ucs2.result
@@ -16,8 +16,6 @@ Table Op Msg_type Msg_text
test.t1 check status OK
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
ALTER TABLE t1 MODIFY a VARCHAR(800) CHARSET `ucs2`;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -25,12 +23,12 @@ SHOW CREATE table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(800) CHARACTER SET ucs2 DEFAULT NULL,
- KEY `a` (`a`(500))
+ KEY `a` (`a`)
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
DROP TABLE t1;
-CREATE TABLE t1 (a VARCHAR(800),KEY(a)) ENGINE=Aria CHARACTER SET ucs2;
+CREATE TABLE t1 (a VARCHAR(1200),KEY(a)) ENGINE=Aria CHARACTER SET ucs2;
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Warning 1071 Specified key was too long; max key length is 2000 bytes
INSERT INTO t1 VALUES (REPEAT('abc ',200));
CHECK TABLE t1;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/maria/maria-ucs2.test b/mysql-test/suite/maria/maria-ucs2.test
index e4f8bc8dd27..7dab000a1c9 100644
--- a/mysql-test/suite/maria/maria-ucs2.test
+++ b/mysql-test/suite/maria/maria-ucs2.test
@@ -37,7 +37,7 @@ DROP TABLE t1;
# Issue was too long key
#
-CREATE TABLE t1 (a VARCHAR(800),KEY(a)) ENGINE=Aria CHARACTER SET ucs2;
+CREATE TABLE t1 (a VARCHAR(1200),KEY(a)) ENGINE=Aria CHARACTER SET ucs2;
INSERT INTO t1 VALUES (REPEAT('abc ',200));
CHECK TABLE t1;
DROP TABLE t1;
diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result
index 7a4283c4cc5..908df15aa0d 100644
--- a/mysql-test/suite/maria/maria.result
+++ b/mysql-test/suite/maria/maria.result
@@ -351,13 +351,13 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
-CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), KEY t1 (a, b, c, d, e));
-ERROR 42000: Specified key was too long; max key length is 1000 bytes
+CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), f varchar(255), g varchar(255), h varchar(255), i varchar(255), KEY t1 (a, b, c, d, e, f, g, h, i));
+ERROR 42000: Specified key was too long; max key length is 2000 bytes
CREATE TABLE t1 (a varchar(1), b varchar(1), key (a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b));
ERROR 42000: Too many key parts specified; max 32 parts allowed
-CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255));
-ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
-ERROR 42000: Specified key was too long; max key length is 1000 bytes
+CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), f varchar(255), g varchar(255), h varchar(255), i varchar(255));
+ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e, f, g, h, i);
+ERROR 42000: Specified key was too long; max key length is 2000 bytes
DROP TABLE t1;
CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a));
INSERT into t1 values (0,null,0), (0,null,1), (0,null,2), (0,null,3), (1,1,4);
@@ -1594,7 +1594,7 @@ a b
drop table t1;
create table t1 (v varchar(65530), key(v));
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Warning 1071 Specified key was too long; max key length is 2000 bytes
drop table if exists t1;
set statement sql_mode = 'NO_ENGINE_SUBSTITUTION' for
create table t1 (v varchar(65536));
@@ -1866,34 +1866,34 @@ t1 CREATE TABLE `t1` (
drop table t1;
create table t1 (a varchar(2048), key `a` (a));
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Warning 1071 Specified key was too long; max key length is 2000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2048) DEFAULT NULL,
- KEY `a` (`a`(1000))
+ KEY `a` (`a`(2000))
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
drop table t1;
create table t1 (a varchar(2048), key `a` (a) key_block_size=1024);
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Warning 1071 Specified key was too long; max key length is 2000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2048) DEFAULT NULL,
- KEY `a` (`a`(1000)) KEY_BLOCK_SIZE=8192
+ KEY `a` (`a`(2000)) KEY_BLOCK_SIZE=8192
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
drop table t1;
create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=1024;
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Warning 1071 Specified key was too long; max key length is 2000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=8192,
- KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192
+ KEY `b` (`b`(2000)) KEY_BLOCK_SIZE=8192
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=1024
alter table t1 key_block_size=2048;
show create table t1;
@@ -1902,7 +1902,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=8192,
- KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192
+ KEY `b` (`b`(2000)) KEY_BLOCK_SIZE=8192
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=2048
alter table t1 add c int, add key (c);
show create table t1;
@@ -1912,7 +1912,7 @@ t1 CREATE TABLE `t1` (
`b` varchar(2048) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=8192,
- KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192,
+ KEY `b` (`b`(2000)) KEY_BLOCK_SIZE=8192,
KEY `c` (`c`) KEY_BLOCK_SIZE=8192
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=2048
alter table t1 key_block_size=4096;
@@ -1923,7 +1923,7 @@ t1 CREATE TABLE `t1` (
`b` varchar(2048) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=8192,
- KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192,
+ KEY `b` (`b`(2000)) KEY_BLOCK_SIZE=8192,
KEY `c` (`c`) KEY_BLOCK_SIZE=8192
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=4096
alter table t1 key_block_size=0;
@@ -1934,7 +1934,7 @@ t1 CREATE TABLE `t1` (
`b` varchar(2048) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=8192,
- KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192,
+ KEY `b` (`b`(2000)) KEY_BLOCK_SIZE=8192,
KEY `c` (`c`) KEY_BLOCK_SIZE=8192
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
alter table t1 add d int, add key (d);
@@ -1946,33 +1946,33 @@ t1 CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=8192,
- KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192,
+ KEY `b` (`b`(2000)) KEY_BLOCK_SIZE=8192,
KEY `c` (`c`) KEY_BLOCK_SIZE=8192,
KEY `d` (`d`)
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
drop table t1;
create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=8192;
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Warning 1071 Specified key was too long; max key length is 2000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
KEY `a` (`a`),
- KEY `b` (`b`(1000))
+ KEY `b` (`b`(2000))
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=8192
drop table t1;
create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) key_block_size=8192;
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Warning 1071 Specified key was too long; max key length is 2000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
KEY `a` (`a`),
- KEY `b` (`b`(1000))
+ KEY `b` (`b`(2000))
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=8192
drop table t1;
create table t1 (a int not null, b int, key (a) key_block_size=1024, key(b) key_block_size=8192) key_block_size=16384;
@@ -1995,12 +1995,12 @@ t1 CREATE TABLE `t1` (
drop table t1;
create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000);
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Warning 1071 Specified key was too long; max key length is 2000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2048) DEFAULT NULL,
- KEY `a` (`a`(1000)) KEY_BLOCK_SIZE=8192
+ KEY `a` (`a`(2000)) KEY_BLOCK_SIZE=8192
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
drop table t1;
create table t1 (a int not null, key `a` (a) key_block_size=1025);
diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test
index d5b9d839699..920443d4338 100644
--- a/mysql-test/suite/maria/maria.test
+++ b/mysql-test/suite/maria/maria.test
@@ -373,12 +373,12 @@ drop table t1;
#
--error 1071
-CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), KEY t1 (a, b, c, d, e));
+CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), f varchar(255), g varchar(255), h varchar(255), i varchar(255), KEY t1 (a, b, c, d, e, f, g, h, i));
--error 1070
CREATE TABLE t1 (a varchar(1), b varchar(1), key (a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b));
-CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255));
+CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), f varchar(255), g varchar(255), h varchar(255), i varchar(255));
--error 1071
-ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
+ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e, f, g, h, i);
DROP TABLE t1;
#
diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result
index ba8b64f9514..09ce22411eb 100644
--- a/mysql-test/suite/maria/maria3.result
+++ b/mysql-test/suite/maria/maria3.result
@@ -17,12 +17,12 @@ t1 CREATE TABLE `t1` (
drop table t1;
create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000);
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Warning 1071 Specified key was too long; max key length is 2000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2048) DEFAULT NULL,
- KEY `a` (`a`(1000)) KEY_BLOCK_SIZE=8192
+ KEY `a` (`a`(2000)) KEY_BLOCK_SIZE=8192
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
drop table t1;
create table t1 (a int not null, key `a` (a) key_block_size=1025);
diff --git a/mysql-test/suite/maria/max_length.result b/mysql-test/suite/maria/max_length.result
index 93478e033f4..b4ca61392cc 100644
--- a/mysql-test/suite/maria/max_length.result
+++ b/mysql-test/suite/maria/max_length.result
@@ -2,13 +2,30 @@ drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 'test.t1'
Note 1051 Unknown table 'test.t2'
-create table t1 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=2 engine=aria;
-create table t2 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=20000000 engine=aria;
+create table t1 (id int(10) unsigned not null auto_increment primary key, v varchar(2000), b blob) row_format=page max_rows=2 engine=aria;
+create table t2 (id int(10) unsigned not null auto_increment primary key, v varchar(2000), b blob, key(v)) row_format=page max_rows=20000000 engine=aria;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `v` varchar(2000) DEFAULT NULL,
+ `b` blob DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Aria DEFAULT CHARSET=latin1 MAX_ROWS=2 PAGE_CHECKSUM=1 ROW_FORMAT=PAGE
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `v` varchar(2000) DEFAULT NULL,
+ `b` blob DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `v` (`v`)
+) ENGINE=Aria DEFAULT CHARSET=latin1 MAX_ROWS=20000000 PAGE_CHECKSUM=1 ROW_FORMAT=PAGE
lock tables t1 write,t2 write;
show table status like "t_";
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 Aria 10 Page 0 0 8192 268320768 8192 0 1 # # # latin1_swedish_ci NULL max_rows=2 row_format=PAGE 536862720 N
-t2 Aria 10 Page 0 0 8192 17592186011648 8192 0 1 # # # latin1_swedish_ci NULL max_rows=20000000 row_format=PAGE 536862720 N
+t2 Aria 10 Page 0 0 8192 17592186011648 8192 0 1 # # # latin1_swedish_ci NULL max_rows=20000000 row_format=PAGE 137438945280 N
insert into t1 values(null, repeat("ab",100),repeat("def",1000));
insert into t1 values(null, repeat("de",200),repeat("ghi",2000));
insert into t1 values(null, repeat("fe",300),repeat("ghi",3000));
diff --git a/mysql-test/suite/maria/max_length.test b/mysql-test/suite/maria/max_length.test
index fdfe2aae4ac..4ebe48b4979 100644
--- a/mysql-test/suite/maria/max_length.test
+++ b/mysql-test/suite/maria/max_length.test
@@ -7,8 +7,10 @@
drop table if exists t1,t2;
-create table t1 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=2 engine=aria;
-create table t2 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=20000000 engine=aria;
+create table t1 (id int(10) unsigned not null auto_increment primary key, v varchar(2000), b blob) row_format=page max_rows=2 engine=aria;
+create table t2 (id int(10) unsigned not null auto_increment primary key, v varchar(2000), b blob, key(v)) row_format=page max_rows=20000000 engine=aria;
+show create table t1;
+show create table t2;
lock tables t1 write,t2 write;
--replace_column 12 # 13 # 14 #
show table status like "t_";
diff --git a/mysql-test/suite/maria/mrr.result b/mysql-test/suite/maria/mrr.result
index 5c709fb34e5..2ebf10cf1af 100644
--- a/mysql-test/suite/maria/mrr.result
+++ b/mysql-test/suite/maria/mrr.result
@@ -392,8 +392,6 @@ col_varchar_1024_latin1_key varchar(1024) DEFAULT NULL,
PRIMARY KEY (pk),
KEY col_varchar_1024_latin1_key (col_varchar_1024_latin1_key)
) ENGINE=Aria;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
INSERT INTO t1 VALUES
(1,'z'), (2,'abcdefjhjkl'), (3,'in'), (4,'abcdefjhjkl'), (6,'abcdefjhjkl'),
(11,'zx'), (12,'abcdefjhjm'), (13,'jn'), (14,'abcdefjhjp'), (16,'abcdefjhjr');
@@ -407,7 +405,7 @@ WHERE
table1.col_varchar_1024_latin1_key = table2.col_varchar_10_latin1 AND table1.pk<>0 ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE table2 ALL NULL NULL NULL NULL 2 Using where
-1 SIMPLE table1 ref PRIMARY,col_varchar_1024_latin1_key col_varchar_1024_latin1_key 1003 test.table2.col_varchar_10_latin1 2 Using where
+1 SIMPLE table1 ref PRIMARY,col_varchar_1024_latin1_key col_varchar_1024_latin1_key 1027 test.table2.col_varchar_10_latin1 2 Using index condition(BKA); Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
SELECT count(*)
FROM t1 AS table1, t2 AS table2
WHERE
@@ -425,12 +423,12 @@ set join_buffer_size=10240;
CREATE TABLE t1 (
f2 varchar(32) COLLATE latin1_swedish_ci,
f3 int(11),
-f4 varchar(1024) COLLATE utf8_bin,
-f5 varchar(1024) COLLATE latin1_bin,
+f4 varchar(2048) COLLATE utf8_bin,
+f5 varchar(2048) COLLATE latin1_bin,
KEY (f5)
) ENGINE=Aria TRANSACTIONAL=0 ;
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Warning 1071 Specified key was too long; max key length is 2000 bytes
# Fill the table with some data
SELECT alias2.* , alias1.f2
FROM
diff --git a/mysql-test/suite/maria/mrr.test b/mysql-test/suite/maria/mrr.test
index 6c6a8c4e7b6..f3addd6c0f5 100644
--- a/mysql-test/suite/maria/mrr.test
+++ b/mysql-test/suite/maria/mrr.test
@@ -144,8 +144,8 @@ set join_buffer_size=10240;
CREATE TABLE t1 (
f2 varchar(32) COLLATE latin1_swedish_ci,
f3 int(11),
- f4 varchar(1024) COLLATE utf8_bin,
- f5 varchar(1024) COLLATE latin1_bin,
+ f4 varchar(2048) COLLATE utf8_bin,
+ f5 varchar(2048) COLLATE latin1_bin,
KEY (f5)
) ENGINE=Aria TRANSACTIONAL=0 ;