1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Merge 10.2 into 10.3

This commit is contained in:
Marko Mäkelä
2019-07-02 17:46:22 +03:00
320 changed files with 23190 additions and 7611 deletions

View File

@@ -1,406 +0,0 @@
SET default_storage_engine=InnoDB;
# Test 1) Show the page size from Information Schema
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_page_size';
variable_value
4096
# Test 2) The number of buffer pool pages is dependent upon the page size.
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
variable_value
{checked_valid}
# Test 3) Query some information_shema tables that are dependent upon
# the page size.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
i.name index_name, i.page_no root_page, i.type,
i.n_fields, i.merge_threshold
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
WHERE t.table_id = i.table_id
AND t.name LIKE 'mysql%'
ORDER BY t.name, i.index_id;
table_name n_cols table_flags index_name root_page type n_fields merge_threshold
mysql/innodb_index_stats 11 33 PRIMARY 3 3 4 50
mysql/innodb_table_stats 9 33 PRIMARY 3 3 2 50
mysql/transaction_registry 8 33 PRIMARY 3 3 1 50
mysql/transaction_registry 8 33 commit_id 4 2 1 50
mysql/transaction_registry 8 33 begin_timestamp 5 0 1 50
mysql/transaction_registry 8 33 commit_timestamp 6 0 2 50
CREATE TABLE t1 (a INT KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=innodb;
CREATE TABLE t2 (a INT KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=innodb;
CREATE TABLE t3 (a INT KEY, b TEXT) ROW_FORMAT=COMPRESSED ENGINE=innodb;
CREATE TABLE t4 (a INT KEY, b TEXT) ROW_FORMAT=DYNAMIC ENGINE=innodb;
SELECT t.name table_name, t.n_cols, t.flag table_flags,
i.name index_name, i.page_no root_page, i.type,
i.n_fields, i.merge_threshold
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
WHERE t.table_id = i.table_id
AND t.name LIKE 'test%'
ORDER BY t.name, i.name;
table_name n_cols table_flags index_name root_page type n_fields merge_threshold
test/t1 5 0 PRIMARY 3 3 1 50
test/t2 5 1 PRIMARY 3 3 1 50
test/t3 5 37 PRIMARY 3 3 1 50
test/t4 5 33 PRIMARY 3 3 1 50
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
test/t1 Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t1.ibd
test/t2 Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t2.ibd
test/t3 Single DEFAULT 2048 Compressed MYSQLD_DATADIR/test/t3.ibd
test/t4 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4.ibd
DROP TABLE t1, t2, t3, t4;
# Test 4) The maximum row size is dependent upon the page size.
# Redundant: 1979, Compact: 1982.
# Compressed: 1982, Dynamic: 1982.
# Each row format has its own amount of overhead that
# varies depending on number of fields and other overhead.
SET SESSION innodb_strict_mode = ON;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(127)
) ROW_FORMAT=redundant;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(128)
) ROW_FORMAT=redundant;
ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(155)
) ROW_FORMAT=compact;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(156)
) ROW_FORMAT=compact;
ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(76)
) ROW_FORMAT=compressed;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(79)
) ROW_FORMAT=compressed;
ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(155)
) ROW_FORMAT=dynamic;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(156)
) ROW_FORMAT=dynamic;
ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
CREATE TABLE t1 (a varchar(64) character set utf8,
b varchar(64) character set utf8,
c varchar(64) character set utf8,
d varchar(64) character set utf8,
PRIMARY KEY (a,b,c,d))
ENGINE=innodb;
DROP TABLE t1;
CREATE TABLE t1 (a varchar(64) character set utf8,
b varchar(64) character set utf8,
c varchar(64) character set utf8,
d varchar(65) character set utf8,
PRIMARY KEY (a,b,c,d))
ENGINE=innodb;
ERROR 42000: Specified key was too long; max key length is 768 bytes
CREATE TABLE t1 (a varchar(64) character set utf8,
b varchar(64) character set utf8,
c varchar(64) character set utf8,
d varchar(64) character set utf8,
e varchar(64) character set utf8,
PRIMARY KEY (a), KEY (b,c,d,e))
ENGINE=innodb;
DROP TABLE t1;
CREATE TABLE t1 (a varchar(64) character set utf8,
b varchar(64) character set utf8,
c varchar(64) character set utf8,
d varchar(64) character set utf8,
e varchar(65) character set utf8,
PRIMARY KEY (a), KEY (b,c,d,e))
ENGINE=innodb;
ERROR 42000: Specified key was too long; max key length is 768 bytes
# Test 5) Make sure that KEY_BLOCK_SIZE=4, 2 & 1 are all
# accepted and that KEY_BLOCK_SIZE=16 & 8 are rejected
# in strict mode and converted to 4 in non-strict mode.
SET SESSION innodb_strict_mode = ON;
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 4.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE=8 cannot be larger than 4.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=4
ALTER TABLE t1 KEY_BLOCK_SIZE=2;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=2
ALTER TABLE t1 KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=1
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED
DROP TABLE t1;
SET SESSION innodb_strict_mode = OFF;
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=16
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=8.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=8.
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=8
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=4
ALTER TABLE t1 KEY_BLOCK_SIZE=2;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=2
ALTER TABLE t1 KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=1
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED
DROP TABLE t1;
# Test 6) Make sure that KEY_BLOCK_SIZE = 8 and 16
# are both rejected when innodb_file_per_table=OFF
SET SESSION innodb_strict_mode = ON;
SET GLOBAL innodb_file_per_table = OFF;
SHOW VARIABLES LIKE 'innodb_file_per_table';
Variable_name Value
innodb_file_per_table OFF
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE=8 cannot be larger than 4.
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 4.
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_per_table = ON;
# Test 7) Not included here; 16k only
# Test 8) Test creating a table that could lead to undo log overflow.
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
o blob,p blob,q blob,r blob,s blob,t blob,u blob)
ENGINE=InnoDB ROW_FORMAT=dynamic;
SET @a = repeat('a', 767);
SET @b = repeat('b', 767);
SET @c = repeat('c', 767);
SET @d = repeat('d', 767);
SET @e = repeat('e', 767);
INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b;
CREATE INDEX t1a ON t1 (a(767));
UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c;
CREATE INDEX t1b ON t1 (b(767));
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
ROLLBACK;
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d,k=@d,l=@d,m=@d,
n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
COMMIT;
CREATE INDEX t1c ON t1 (c(767));
UPDATE t1 SET c=@e;
CREATE INDEX t1d ON t1 (d(767));
BEGIN;
UPDATE t1 SET d=@e;
ROLLBACK;
CREATE INDEX t1e ON t1 (e(767));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` blob DEFAULT NULL,
`b` blob DEFAULT NULL,
`c` blob DEFAULT NULL,
`d` blob DEFAULT NULL,
`e` blob DEFAULT NULL,
`f` blob DEFAULT NULL,
`g` blob DEFAULT NULL,
`h` blob DEFAULT NULL,
`i` blob DEFAULT NULL,
`j` blob DEFAULT NULL,
`k` blob DEFAULT NULL,
`l` blob DEFAULT NULL,
`m` blob DEFAULT NULL,
`n` blob DEFAULT NULL,
`o` blob DEFAULT NULL,
`p` blob DEFAULT NULL,
`q` blob DEFAULT NULL,
`r` blob DEFAULT NULL,
`s` blob DEFAULT NULL,
`t` blob DEFAULT NULL,
`u` blob DEFAULT NULL,
KEY `t1a` (`a`(767)),
KEY `t1b` (`b`(767)),
KEY `t1c` (`c`(767)),
KEY `t1d` (`d`(767)),
KEY `t1e` (`e`(767))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
DROP TABLE t1;
SET SESSION innodb_strict_mode = OFF;
CREATE TABLE t1(
pk01 varchar(48), pk02 varchar(48), pk03 varchar(48), pk04 varchar(48),
pk05 varchar(48), pk06 varchar(48), pk07 varchar(48), pk08 varchar(48),
pk09 varchar(48), pk10 varchar(48), pk11 varchar(48), pk12 varchar(48),
pk13 varchar(48), pk14 varchar(48), pk15 varchar(48), pk16 varchar(48),
sk01 varchar(48), sk02 varchar(48), sk03 varchar(48), sk04 varchar(48),
sk05 varchar(48), sk06 varchar(48), sk07 varchar(48), sk08 varchar(48),
sk09 varchar(48), sk10 varchar(48), sk11 varchar(48), sk12 varchar(48),
sk13 varchar(48), sk14 varchar(48), sk15 varchar(48), sk16 varchar(48),
PRIMARY KEY pk(pk01,pk02,pk03,pk04,pk05,pk06,pk07,pk08,
pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16),
KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08,
sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16))
ROW_FORMAT=Redundant ENGINE=InnoDB;
SET @r = repeat('a', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('b', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('c', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('d', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('e', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
DELETE from t1;
DROP TABLE t1;
CREATE TABLE t1(
pk01 varchar(48), pk02 varchar(48), pk03 varchar(48), pk04 varchar(48),
pk05 varchar(48), pk06 varchar(48), pk07 varchar(48), pk08 varchar(48),
pk09 varchar(48), pk10 varchar(48), pk11 varchar(48), pk12 varchar(48),
pk13 varchar(48), pk14 varchar(48), pk15 varchar(48), pk16 varchar(48),
sk01 varchar(48), sk02 varchar(48), sk03 varchar(48), sk04 varchar(48),
sk05 varchar(48), sk06 varchar(48), sk07 varchar(48), sk08 varchar(48),
sk09 varchar(48), sk10 varchar(48), sk11 varchar(48), sk12 varchar(48),
sk13 varchar(48), sk14 varchar(48), sk15 varchar(48), sk16 varchar(48),
PRIMARY KEY pk(pk01,pk02,pk03,pk04,pk05,pk06,pk07,pk08,
pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16),
KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08,
sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16))
ROW_FORMAT=Compressed KEY_BLOCK_SIZE=4 ENGINE=InnoDB;
SET @r = repeat('a', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('b', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('c', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('d', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('e', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
DELETE from t1;
DROP TABLE t1;
SET SESSION innodb_strict_mode = off;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
Warning 139 Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
drop table t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
drop table t1;
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
Warning 139 Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
DROP TABLE t1;
CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;

View File

@@ -1,437 +0,0 @@
SET default_storage_engine=InnoDB;
# Test 1) Show the page size from Information Schema
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_page_size';
variable_value
8192
# Test 2) The number of buffer pool pages is dependent upon the page size.
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
variable_value
{checked_valid}
# Test 3) Query some information_shema tables that are dependent upon
# the page size.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
i.name index_name, i.page_no root_page, i.type,
i.n_fields, i.merge_threshold
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
WHERE t.table_id = i.table_id
AND t.name LIKE 'mysql%'
ORDER BY t.name, i.index_id;
table_name n_cols table_flags index_name root_page type n_fields merge_threshold
mysql/innodb_index_stats 11 33 PRIMARY 3 3 4 50
mysql/innodb_table_stats 9 33 PRIMARY 3 3 2 50
mysql/transaction_registry 8 33 PRIMARY 3 3 1 50
mysql/transaction_registry 8 33 commit_id 4 2 1 50
mysql/transaction_registry 8 33 begin_timestamp 5 0 1 50
mysql/transaction_registry 8 33 commit_timestamp 6 0 2 50
CREATE TABLE t1 (a INT KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=innodb;
CREATE TABLE t2 (a INT KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=innodb;
CREATE TABLE t3 (a INT KEY, b TEXT) ROW_FORMAT=COMPRESSED ENGINE=innodb;
CREATE TABLE t4 (a INT KEY, b TEXT) ROW_FORMAT=DYNAMIC ENGINE=innodb;
SELECT t.name table_name, t.n_cols, t.flag table_flags,
i.name index_name, i.page_no root_page, i.type,
i.n_fields, i.merge_threshold
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
WHERE t.table_id = i.table_id
AND t.name LIKE 'test%'
ORDER BY t.name, i.name;
table_name n_cols table_flags index_name root_page type n_fields merge_threshold
test/t1 5 0 PRIMARY 3 3 1 50
test/t2 5 1 PRIMARY 3 3 1 50
test/t3 5 39 PRIMARY 3 3 1 50
test/t4 5 33 PRIMARY 3 3 1 50
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
test/t1 Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t1.ibd
test/t2 Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t2.ibd
test/t3 Single DEFAULT 4096 Compressed MYSQLD_DATADIR/test/t3.ibd
test/t4 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4.ibd
DROP TABLE t1, t2, t3, t4;
# Test 4) The maximum row size is dependent upon the page size.
# Redundant: 4027, Compact: 4030.
# Compressed: 4030, Dynamic: 4030.
# Each row format has its own amount of overhead that
# varies depending on number of fields and other overhead.
SET SESSION innodb_strict_mode = ON;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(155)
) ROW_FORMAT=redundant;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(156)
) ROW_FORMAT=redundant;
ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(202)
) ROW_FORMAT=compact;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(203)
) ROW_FORMAT=compact;
ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(103)
) ROW_FORMAT=compressed;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(106)
) ROW_FORMAT=compressed;
ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(202)
) ROW_FORMAT=dynamic;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(203)
) ROW_FORMAT=dynamic;
ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
CREATE TABLE t1 (a varchar(128) character set utf8,
b varchar(128) character set utf8,
c varchar(128) character set utf8,
d varchar(128) character set utf8,
PRIMARY KEY (a,b,c,d))
ENGINE=innodb;
DROP TABLE t1;
CREATE TABLE t1 (a varchar(128) character set utf8,
b varchar(128) character set utf8,
c varchar(128) character set utf8,
d varchar(129) character set utf8,
PRIMARY KEY (a,b,c,d))
ENGINE=innodb;
ERROR 42000: Specified key was too long; max key length is 1536 bytes
CREATE TABLE t1 (a varchar(128) character set utf8,
b varchar(128) character set utf8,
c varchar(128) character set utf8,
d varchar(128) character set utf8,
e varchar(128) character set utf8,
PRIMARY KEY (a), KEY (b,c,d,e))
ENGINE=innodb;
DROP TABLE t1;
CREATE TABLE t1 (a varchar(128) character set utf8,
b varchar(128) character set utf8,
c varchar(128) character set utf8,
d varchar(128) character set utf8,
e varchar(129) character set utf8,
PRIMARY KEY (a), KEY (b,c,d,e))
ENGINE=innodb;
ERROR 42000: Specified key was too long; max key length is 1536 bytes
# Test 5) Make sure that KEY_BLOCK_SIZE=8, 4, 2 & 1 are all
# accepted and that KEY_BLOCK_SIZE=16 is rejected in
# strict mode and converted to 8 in non-strict mode.
SET SESSION innodb_strict_mode = ON;
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 8.
Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=8
ALTER TABLE t1 KEY_BLOCK_SIZE=4;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=4
ALTER TABLE t1 KEY_BLOCK_SIZE=2;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=2
ALTER TABLE t1 KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=1
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED
DROP TABLE t1;
SET SESSION innodb_strict_mode = OFF;
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=16
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=8
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=4
ALTER TABLE t1 KEY_BLOCK_SIZE=2;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=2
ALTER TABLE t1 KEY_BLOCK_SIZE=1;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=1
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED
DROP TABLE t1;
# Test 6) Make sure that KEY_BLOCK_SIZE = 8 and 16
# are rejected when innodb_file_per_table=OFF
SET SESSION innodb_strict_mode = ON;
SET GLOBAL innodb_file_per_table = OFF;
SHOW VARIABLES LIKE 'innodb_file_per_table';
Variable_name Value
innodb_file_per_table OFF
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 8.
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_per_table = ON;
# Test 7) Not included here; 16k only
# Test 8) Test creating a table that could lead to undo log overflow.
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
o blob,p blob,q blob,r blob,s blob,t blob,u blob)
ENGINE=InnoDB ROW_FORMAT=dynamic;
SET @a = repeat('a', 767);
SET @b = repeat('b', 767);
SET @c = repeat('c', 767);
SET @d = repeat('d', 767);
SET @e = repeat('e', 767);
INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b;
CREATE INDEX t1a ON t1 (a(767));
CREATE INDEX t1b ON t1 (b(767));
UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c;
CREATE INDEX t1c ON t1 (c(767));
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
ROLLBACK;
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d,k=@d,l=@d,m=@d,
n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
COMMIT;
CREATE INDEX t1d ON t1 (d(767));
UPDATE t1 SET d=@e;
CREATE INDEX t1e ON t1 (e(767));
UPDATE t1 SET e=@e;
CREATE INDEX t1f ON t1 (f(767));
UPDATE t1 SET f=@e;
CREATE INDEX t1g ON t1 (g(767));
UPDATE t1 SET g=@e;
CREATE INDEX t1h ON t1 (h(767));
UPDATE t1 SET h=@e;
CREATE INDEX t1i ON t1 (i(767));
UPDATE t1 SET i=@e;
CREATE INDEX t1k ON t1 (j(767));
CREATE INDEX t1j ON t1 (j(500));
BEGIN;
UPDATE t1 SET j=@e;
ROLLBACK;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` blob DEFAULT NULL,
`b` blob DEFAULT NULL,
`c` blob DEFAULT NULL,
`d` blob DEFAULT NULL,
`e` blob DEFAULT NULL,
`f` blob DEFAULT NULL,
`g` blob DEFAULT NULL,
`h` blob DEFAULT NULL,
`i` blob DEFAULT NULL,
`j` blob DEFAULT NULL,
`k` blob DEFAULT NULL,
`l` blob DEFAULT NULL,
`m` blob DEFAULT NULL,
`n` blob DEFAULT NULL,
`o` blob DEFAULT NULL,
`p` blob DEFAULT NULL,
`q` blob DEFAULT NULL,
`r` blob DEFAULT NULL,
`s` blob DEFAULT NULL,
`t` blob DEFAULT NULL,
`u` blob DEFAULT NULL,
KEY `t1a` (`a`(767)),
KEY `t1b` (`b`(767)),
KEY `t1c` (`c`(767)),
KEY `t1d` (`d`(767)),
KEY `t1e` (`e`(767)),
KEY `t1f` (`f`(767)),
KEY `t1g` (`g`(767)),
KEY `t1h` (`h`(767)),
KEY `t1i` (`i`(767)),
KEY `t1k` (`j`(767)),
KEY `t1j` (`j`(500))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
DROP TABLE t1;
SET SESSION innodb_strict_mode = OFF;
CREATE TABLE t1(
pk01 varchar(96), pk02 varchar(96), pk03 varchar(96), pk04 varchar(96),
pk05 varchar(96), pk06 varchar(96), pk07 varchar(96), pk08 varchar(96),
pk09 varchar(96), pk10 varchar(96), pk11 varchar(96), pk12 varchar(96),
pk13 varchar(96), pk14 varchar(96), pk15 varchar(96), pk16 varchar(96),
sk01 varchar(96), sk02 varchar(96), sk03 varchar(96), sk04 varchar(96),
sk05 varchar(96), sk06 varchar(96), sk07 varchar(96), sk08 varchar(96),
sk09 varchar(96), sk10 varchar(96), sk11 varchar(96), sk12 varchar(96),
sk13 varchar(96), sk14 varchar(96), sk15 varchar(96), sk16 varchar(96),
PRIMARY KEY pk(pk01,pk02,pk03,pk04,pk05,pk06,pk07,pk08,
pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16),
KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08,
sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16))
ROW_FORMAT=Redundant ENGINE=InnoDB;
SET @r = repeat('a', 96);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('b', 96);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('c', 96);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('d', 96);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('e', 96);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
DELETE from t1;
DROP TABLE t1;
CREATE TABLE t1(
pk01 varchar(96), pk02 varchar(96), pk03 varchar(96), pk04 varchar(96),
pk05 varchar(96), pk06 varchar(96), pk07 varchar(96), pk08 varchar(96),
pk09 varchar(96), pk10 varchar(96), pk11 varchar(96), pk12 varchar(96),
pk13 varchar(96), pk14 varchar(96), pk15 varchar(96), pk16 varchar(96),
sk01 varchar(96), sk02 varchar(96), sk03 varchar(96), sk04 varchar(96),
sk05 varchar(96), sk06 varchar(96), sk07 varchar(96), sk08 varchar(96),
sk09 varchar(96), sk10 varchar(96), sk11 varchar(96), sk12 varchar(96),
sk13 varchar(96), sk14 varchar(96), sk15 varchar(96), sk16 varchar(96),
PRIMARY KEY pk(pk01,pk02,pk03,pk04,pk05,pk06,pk07,pk08,
pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16),
KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08,
sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16))
ROW_FORMAT=Compressed KEY_BLOCK_SIZE=8 ENGINE=InnoDB;
SET @r = repeat('a', 96);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('b', 96);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('c', 96);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('d', 96);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('e', 96);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
DELETE from t1;
DROP TABLE t1;
SET SESSION innodb_strict_mode = off;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
Warning 139 Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
Warnings:
Warning 139 Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
drop table t1;
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
Warning 139 Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
DROP TABLE t1;
CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;

View File

@@ -0,0 +1,469 @@
--- page_size.result
+++ page_size,4k.result
@@ -3,7 +3,7 @@
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_page_size';
variable_value
-16384
+4096
# Test 3) Query some information_shema tables that are dependent upon
# the page size.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
@@ -36,13 +36,13 @@
table_name n_cols table_flags index_name root_page type n_fields merge_threshold
test/t1 5 0 PRIMARY 3 3 1 50
test/t2 5 1 PRIMARY 3 3 1 50
-test/t3 5 41 PRIMARY 3 3 1 50
+test/t3 5 37 PRIMARY 3 3 1 50
test/t4 5 33 PRIMARY 3 3 1 50
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
test/t1 Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t1.ibd
test/t2 Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t2.ibd
-test/t3 Single DEFAULT 8192 Compressed MYSQLD_DATADIR/test/t3.ibd
+test/t3 Single DEFAULT 2048 Compressed MYSQLD_DATADIR/test/t3.ibd
test/t4 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4.ibd
DROP TABLE t1, t2, t3, t4;
# Test 4) The maximum row size is dependent upon the page size.
@@ -51,141 +51,90 @@
SET SESSION innodb_strict_mode = ON;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(211)
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(127)
) ROW_FORMAT=redundant;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(212)
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(128)
) ROW_FORMAT=redundant;
-ERROR 42000: Row size too large (> 8123). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246)
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(155)
) ROW_FORMAT=compact;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247)
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(156)
) ROW_FORMAT=compact;
-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(157)
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(76)
) ROW_FORMAT=compressed;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(160)
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(79)
) ROW_FORMAT=compressed;
-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246)
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(155)
) ROW_FORMAT=dynamic;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247)
+c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(156)
) ROW_FORMAT=dynamic;
-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
-CREATE TABLE t1 (a varchar(255) character set utf8,
-b varchar(255) character set utf8,
-c varchar(255) character set utf8,
-d varchar(255) character set utf8,
-e varchar(4) character set utf8,
-PRIMARY KEY (a,b,c,d,e))
+ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+CREATE TABLE t1 (a varchar(98) character set utf8,
+b varchar(98) character set utf8,
+c varchar(98) character set utf8,
+d varchar(97) character set utf8,
+PRIMARY KEY (a,b,c,d))
ENGINE=innodb;
DROP TABLE t1;
-CREATE TABLE t1 (a varchar(255) character set utf8,
-b varchar(255) character set utf8,
-c varchar(255) character set utf8,
-d varchar(255) character set utf8,
-e varchar(5) character set utf8,
-PRIMARY KEY (a,b,c,d,e))
+CREATE TABLE t1 (a varchar(98) character set utf8,
+b varchar(98) character set utf8,
+c varchar(98) character set utf8,
+d varchar(98) character set utf8,
+PRIMARY KEY (a,b,c,d))
ENGINE=innodb;
-ERROR 42000: Specified key was too long; max key length is 3072 bytes
-CREATE TABLE t1 (a varchar(255) character set utf8,
-b varchar(255) character set utf8,
-c varchar(255) character set utf8,
-d varchar(255) character set utf8,
-e varchar(255) character set utf8,
-f varchar(4) character set utf8,
-PRIMARY KEY (a), KEY (b,c,d,e,f))
+ERROR 42000: Specified key was too long; max key length is 1173 bytes
+CREATE TABLE t1 (a varchar(98) character set utf8,
+b varchar(98) character set utf8,
+c varchar(98) character set utf8,
+d varchar(98) character set utf8,
+e varchar(97) character set utf8,
+PRIMARY KEY (a), KEY (b,c,d,e))
ENGINE=innodb;
DROP TABLE t1;
-CREATE TABLE t1 (a varchar(255) character set utf8,
-b varchar(255) character set utf8,
-c varchar(255) character set utf8,
-d varchar(255) character set utf8,
-e varchar(255) character set utf8,
-f varchar(5) character set utf8,
-PRIMARY KEY (a), KEY (b,c,d,e,f))
+CREATE TABLE t1 (a varchar(98) character set utf8,
+b varchar(98) character set utf8,
+c varchar(98) character set utf8,
+d varchar(98) character set utf8,
+e varchar(98) character set utf8,
+PRIMARY KEY (a), KEY (b,c,d,e))
ENGINE=innodb;
-ERROR 42000: Specified key was too long; max key length is 3072 bytes
+ERROR 42000: Specified key was too long; max key length is 1173 bytes
# Test 5) KEY_BLOCK_SIZE validation
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
-SELECT table_name, row_format, create_options
-FROM information_schema.tables WHERE table_name = 't1';
-table_name row_format create_options
-t1 Compressed row_format=COMPRESSED key_block_size=16
-ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 4.
+Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
-SELECT table_name, row_format, create_options
-FROM information_schema.tables WHERE table_name = 't1';
-table_name row_format create_options
-t1 Compressed row_format=COMPRESSED key_block_size=8
+Warning 1478 InnoDB: KEY_BLOCK_SIZE=8 cannot be larger than 4.
+Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 KEY_BLOCK_SIZE=4;
SHOW WARNINGS;
Level Code Message
@@ -217,15 +166,21 @@
DROP TABLE t1;
SET SESSION innodb_strict_mode = OFF;
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
SHOW WARNINGS;
Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED key_block_size=16
ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=8.
SHOW WARNINGS;
Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=8.
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
@@ -269,6 +224,7 @@
ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
+Warning 1478 InnoDB: KEY_BLOCK_SIZE=8 cannot be larger than 4.
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
@@ -276,105 +232,11 @@
ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
+Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 4.
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_per_table = ON;
-# Test 7) This series of tests were moved from innodb-index to here
-# because the second alter table t1 assumes a 16k page size.
-# Moving the test allows the rest of innodb-index to be run on all
-# page sizes. The previously disabled portions of this test were
-# moved as well.
-CREATE TABLE t2(d varchar(17) PRIMARY KEY) ENGINE=innodb DEFAULT CHARSET=utf8;
-CREATE TABLE t3(a int PRIMARY KEY) ENGINE=innodb;
-INSERT INTO t3 VALUES (22),(44),(33),(55),(66);
-INSERT INTO t2 VALUES ('jejdkrun87'),('adfd72nh9k'),
-('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
-CREATE TABLE t1(a int, b blob, c text, d text NOT NULL)
-ENGINE=innodb DEFAULT CHARSET=utf8 STATS_PERSISTENT=0;
-INSERT INTO t1
-SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3 order by a, d;
-DROP TABLE t2, t3;
-SELECT COUNT(*) FROM t1 WHERE a=44;
-COUNT(*)
-5
-SELECT a,
-LENGTH(b),b=LEFT(REPEAT(d,100*a),65535),LENGTH(c),c=REPEAT(d,20*a),d FROM t1
-ORDER BY 1, 2, 3, 4, 5, 6;
-a LENGTH(b) b=LEFT(REPEAT(d,100*a),65535) LENGTH(c) c=REPEAT(d,20*a) d
-22 22000 1 4400 1 adfd72nh9k
-22 22000 1 4400 1 jejdkrun87
-22 26400 1 5280 1 adfdpplkeock
-22 28600 1 5720 1 adfdijnmnb78k
-22 35200 1 7040 1 adfdijn0loKNHJik
-33 33000 1 6600 1 adfd72nh9k
-33 33000 1 6600 1 jejdkrun87
-33 39600 1 7920 1 adfdpplkeock
-33 42900 1 8580 1 adfdijnmnb78k
-33 52800 1 10560 1 adfdijn0loKNHJik
-44 44000 1 8800 1 adfd72nh9k
-44 44000 1 8800 1 jejdkrun87
-44 52800 1 10560 1 adfdpplkeock
-44 57200 1 11440 1 adfdijnmnb78k
-44 65535 1 14080 1 adfdijn0loKNHJik
-55 55000 1 11000 1 adfd72nh9k
-55 55000 1 11000 1 jejdkrun87
-55 65535 1 13200 1 adfdpplkeock
-55 65535 1 14300 1 adfdijnmnb78k
-55 65535 1 17600 1 adfdijn0loKNHJik
-66 65535 1 13200 1 adfd72nh9k
-66 65535 1 13200 1 jejdkrun87
-66 65535 1 15840 1 adfdpplkeock
-66 65535 1 17160 1 adfdijnmnb78k
-66 65535 1 21120 1 adfdijn0loKNHJik
-ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20));
-ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
-DELETE FROM t1 WHERE d='null';
-ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20));
-ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
-DELETE FROM t1 WHERE a%2;
-CHECK TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-ALTER TABLE t1 ADD PRIMARY KEY (a,b(255),c(255)), ADD KEY (b(767));
-SELECT COUNT(*) FROM t1 WHERE a=44;
-COUNT(*)
-5
-SELECT a,
-LENGTH(b), b=LEFT(REPEAT(d,100*a), 65535),LENGTH(c), c=REPEAT(d,20*a), d FROM t1;
-a LENGTH(b) b=LEFT(REPEAT(d,100*a), 65535) LENGTH(c) c=REPEAT(d,20*a) d
-22 22000 1 4400 1 adfd72nh9k
-22 35200 1 7040 1 adfdijn0loKNHJik
-22 28600 1 5720 1 adfdijnmnb78k
-22 26400 1 5280 1 adfdpplkeock
-22 22000 1 4400 1 jejdkrun87
-44 44000 1 8800 1 adfd72nh9k
-44 65535 1 14080 1 adfdijn0loKNHJik
-44 57200 1 11440 1 adfdijnmnb78k
-44 52800 1 10560 1 adfdpplkeock
-44 44000 1 8800 1 jejdkrun87
-66 65535 1 13200 1 adfd72nh9k
-66 65535 1 21120 1 adfdijn0loKNHJik
-66 65535 1 17160 1 adfdijnmnb78k
-66 65535 1 15840 1 adfdpplkeock
-66 65535 1 13200 1 jejdkrun87
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` blob NOT NULL,
- `c` text NOT NULL,
- `d` text NOT NULL,
- PRIMARY KEY (`a`,`b`(255),`c`(255)),
- KEY `b` (`b`(767))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0
-CHECK TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-EXPLAIN SELECT * FROM t1 WHERE b LIKE 'adfd%';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range b b 769 NULL 12 Using where
-DROP TABLE t1;
# Test 8) Test creating a table that could lead to undo log overflow.
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
@@ -389,10 +251,6 @@
UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b;
CREATE INDEX t1a ON t1 (a(767));
-CREATE INDEX t1b ON t1 (b(767));
-CREATE INDEX t1c ON t1 (c(767));
-CREATE INDEX t1d ON t1 (d(767));
-CREATE INDEX t1e ON t1 (e(767));
UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c;
CREATE INDEX t1f ON t1 (f(767));
@@ -407,37 +265,15 @@
COMMIT;
CREATE INDEX t1g ON t1 (g(767));
UPDATE t1 SET g=@e;
-CREATE INDEX t1h ON t1 (h(767));
-UPDATE t1 SET h=@e;
-CREATE INDEX t1i ON t1 (i(767));
-UPDATE t1 SET i=@e;
-CREATE INDEX t1j ON t1 (j(767));
-UPDATE t1 SET j=@e;
-CREATE INDEX t1k ON t1 (k(767));
-UPDATE t1 SET k=@e;
-CREATE INDEX t1l ON t1 (l(767));
-UPDATE t1 SET l=@e;
-CREATE INDEX t1m ON t1 (m(767));
-UPDATE t1 SET m=@e;
-CREATE INDEX t1n ON t1 (n(767));
-UPDATE t1 SET n=@e;
-CREATE INDEX t1o ON t1 (o(767));
-UPDATE t1 SET o=@e;
-CREATE INDEX t1p ON t1 (p(767));
-UPDATE t1 SET p=@e;
-CREATE INDEX t1q ON t1 (q(767));
-UPDATE t1 SET q=@e;
-CREATE INDEX t1r ON t1 (r(767));
-UPDATE t1 SET r=@e;
-CREATE INDEX t1s ON t1 (s(767));
-UPDATE t1 SET s=@e;
CREATE INDEX t1t ON t1 (t(767));
BEGIN;
UPDATE t1 SET t=@e;
ROLLBACK;
CREATE INDEX t1u ON t1 (u(767));
-CREATE INDEX t1ut ON t1 (u(767), t(767));
-CREATE INDEX t1st ON t1 (s(767), t(767));
+CREATE INDEX t1ut ON t1 (u(767));
+Warnings:
+Note 1831 Duplicate index `t1ut`. This is deprecated and will be disallowed in a future release
+CREATE INDEX t1st ON t1 (s(767));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -463,28 +299,12 @@
`t` blob DEFAULT NULL,
`u` blob DEFAULT NULL,
KEY `t1a` (`a`(767)),
- KEY `t1b` (`b`(767)),
- KEY `t1c` (`c`(767)),
- KEY `t1d` (`d`(767)),
- KEY `t1e` (`e`(767)),
KEY `t1f` (`f`(767)),
KEY `t1g` (`g`(767)),
- KEY `t1h` (`h`(767)),
- KEY `t1i` (`i`(767)),
- KEY `t1j` (`j`(767)),
- KEY `t1k` (`k`(767)),
- KEY `t1l` (`l`(767)),
- KEY `t1m` (`m`(767)),
- KEY `t1n` (`n`(767)),
- KEY `t1o` (`o`(767)),
- KEY `t1p` (`p`(767)),
- KEY `t1q` (`q`(767)),
- KEY `t1r` (`r`(767)),
- KEY `t1s` (`s`(767)),
KEY `t1t` (`t`(767)),
KEY `t1u` (`u`(767)),
- KEY `t1ut` (`u`(767),`t`(767)),
- KEY `t1st` (`s`(767),`t`(767))
+ KEY `t1ut` (`u`(767)),
+ KEY `t1st` (`s`(767))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
DROP TABLE t1;
# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
@@ -565,27 +385,25 @@
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
-PRIMARY KEY (c(767),d(767)))
+PRIMARY KEY (c(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+Warning 139 Row size too large (> 1982). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
-PRIMARY KEY (c(767),d(767)))
+PRIMARY KEY (c(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
-Warnings:
-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
-PRIMARY KEY (c(767),d(767)))
+PRIMARY KEY (c(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
DROP TABLE t1;
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+Warning 139 Row size too large (> 1982). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
DROP TABLE t1;
CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;

View File

@@ -0,0 +1,415 @@
--- page_size.result
+++ page_size,8k.result
@@ -3,7 +3,7 @@
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_page_size';
variable_value
-16384
+8192
# Test 3) Query some information_shema tables that are dependent upon
# the page size.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
@@ -36,13 +36,13 @@
table_name n_cols table_flags index_name root_page type n_fields merge_threshold
test/t1 5 0 PRIMARY 3 3 1 50
test/t2 5 1 PRIMARY 3 3 1 50
-test/t3 5 41 PRIMARY 3 3 1 50
+test/t3 5 39 PRIMARY 3 3 1 50
test/t4 5 33 PRIMARY 3 3 1 50
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
test/t1 Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t1.ibd
test/t2 Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t2.ibd
-test/t3 Single DEFAULT 8192 Compressed MYSQLD_DATADIR/test/t3.ibd
+test/t3 Single DEFAULT 4096 Compressed MYSQLD_DATADIR/test/t3.ibd
test/t4 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4.ibd
DROP TABLE t1, t2, t3, t4;
# Test 4) The maximum row size is dependent upon the page size.
@@ -53,133 +53,97 @@
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(211)
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(155)
) ROW_FORMAT=redundant;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(212)
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(156)
) ROW_FORMAT=redundant;
-ERROR 42000: Row size too large (> 8123). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246)
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(202)
) ROW_FORMAT=compact;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247)
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(203)
) ROW_FORMAT=compact;
-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(157)
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(103)
) ROW_FORMAT=compressed;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(160)
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(106)
) ROW_FORMAT=compressed;
-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246)
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(202)
) ROW_FORMAT=dynamic;
DROP TABLE t1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247)
+c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(203)
) ROW_FORMAT=dynamic;
-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
-CREATE TABLE t1 (a varchar(255) character set utf8,
-b varchar(255) character set utf8,
-c varchar(255) character set utf8,
-d varchar(255) character set utf8,
-e varchar(4) character set utf8,
-PRIMARY KEY (a,b,c,d,e))
+ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+CREATE TABLE t1 (a varchar(128) character set utf8,
+b varchar(128) character set utf8,
+c varchar(128) character set utf8,
+d varchar(128) character set utf8,
+PRIMARY KEY (a,b,c,d))
ENGINE=innodb;
DROP TABLE t1;
-CREATE TABLE t1 (a varchar(255) character set utf8,
-b varchar(255) character set utf8,
-c varchar(255) character set utf8,
-d varchar(255) character set utf8,
-e varchar(5) character set utf8,
-PRIMARY KEY (a,b,c,d,e))
+CREATE TABLE t1 (a varchar(128) character set utf8,
+b varchar(128) character set utf8,
+c varchar(128) character set utf8,
+d varchar(129) character set utf8,
+PRIMARY KEY (a,b,c,d))
ENGINE=innodb;
-ERROR 42000: Specified key was too long; max key length is 3072 bytes
-CREATE TABLE t1 (a varchar(255) character set utf8,
-b varchar(255) character set utf8,
-c varchar(255) character set utf8,
-d varchar(255) character set utf8,
-e varchar(255) character set utf8,
-f varchar(4) character set utf8,
-PRIMARY KEY (a), KEY (b,c,d,e,f))
+ERROR 42000: Specified key was too long; max key length is 1536 bytes
+CREATE TABLE t1 (a varchar(128) character set utf8,
+b varchar(128) character set utf8,
+c varchar(128) character set utf8,
+d varchar(128) character set utf8,
+e varchar(128) character set utf8,
+PRIMARY KEY (a), KEY (b,c,d,e))
ENGINE=innodb;
DROP TABLE t1;
-CREATE TABLE t1 (a varchar(255) character set utf8,
-b varchar(255) character set utf8,
-c varchar(255) character set utf8,
-d varchar(255) character set utf8,
-e varchar(255) character set utf8,
-f varchar(5) character set utf8,
-PRIMARY KEY (a), KEY (b,c,d,e,f))
+CREATE TABLE t1 (a varchar(128) character set utf8,
+b varchar(128) character set utf8,
+c varchar(128) character set utf8,
+d varchar(128) character set utf8,
+e varchar(129) character set utf8,
+PRIMARY KEY (a), KEY (b,c,d,e))
ENGINE=innodb;
-ERROR 42000: Specified key was too long; max key length is 3072 bytes
+ERROR 42000: Specified key was too long; max key length is 1536 bytes
# Test 5) KEY_BLOCK_SIZE validation
-CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
-SELECT table_name, row_format, create_options
-FROM information_schema.tables WHERE table_name = 't1';
-table_name row_format create_options
-t1 Compressed row_format=COMPRESSED key_block_size=16
-ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 8.
+Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
@@ -217,8 +181,11 @@
DROP TABLE t1;
SET SESSION innodb_strict_mode = OFF;
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
SHOW WARNINGS;
Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
@@ -276,105 +243,11 @@
ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
+Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 8.
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_per_table = ON;
-# Test 7) This series of tests were moved from innodb-index to here
-# because the second alter table t1 assumes a 16k page size.
-# Moving the test allows the rest of innodb-index to be run on all
-# page sizes. The previously disabled portions of this test were
-# moved as well.
-CREATE TABLE t2(d varchar(17) PRIMARY KEY) ENGINE=innodb DEFAULT CHARSET=utf8;
-CREATE TABLE t3(a int PRIMARY KEY) ENGINE=innodb;
-INSERT INTO t3 VALUES (22),(44),(33),(55),(66);
-INSERT INTO t2 VALUES ('jejdkrun87'),('adfd72nh9k'),
-('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
-CREATE TABLE t1(a int, b blob, c text, d text NOT NULL)
-ENGINE=innodb DEFAULT CHARSET=utf8 STATS_PERSISTENT=0;
-INSERT INTO t1
-SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3 order by a, d;
-DROP TABLE t2, t3;
-SELECT COUNT(*) FROM t1 WHERE a=44;
-COUNT(*)
-5
-SELECT a,
-LENGTH(b),b=LEFT(REPEAT(d,100*a),65535),LENGTH(c),c=REPEAT(d,20*a),d FROM t1
-ORDER BY 1, 2, 3, 4, 5, 6;
-a LENGTH(b) b=LEFT(REPEAT(d,100*a),65535) LENGTH(c) c=REPEAT(d,20*a) d
-22 22000 1 4400 1 adfd72nh9k
-22 22000 1 4400 1 jejdkrun87
-22 26400 1 5280 1 adfdpplkeock
-22 28600 1 5720 1 adfdijnmnb78k
-22 35200 1 7040 1 adfdijn0loKNHJik
-33 33000 1 6600 1 adfd72nh9k
-33 33000 1 6600 1 jejdkrun87
-33 39600 1 7920 1 adfdpplkeock
-33 42900 1 8580 1 adfdijnmnb78k
-33 52800 1 10560 1 adfdijn0loKNHJik
-44 44000 1 8800 1 adfd72nh9k
-44 44000 1 8800 1 jejdkrun87
-44 52800 1 10560 1 adfdpplkeock
-44 57200 1 11440 1 adfdijnmnb78k
-44 65535 1 14080 1 adfdijn0loKNHJik
-55 55000 1 11000 1 adfd72nh9k
-55 55000 1 11000 1 jejdkrun87
-55 65535 1 13200 1 adfdpplkeock
-55 65535 1 14300 1 adfdijnmnb78k
-55 65535 1 17600 1 adfdijn0loKNHJik
-66 65535 1 13200 1 adfd72nh9k
-66 65535 1 13200 1 jejdkrun87
-66 65535 1 15840 1 adfdpplkeock
-66 65535 1 17160 1 adfdijnmnb78k
-66 65535 1 21120 1 adfdijn0loKNHJik
-ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20));
-ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
-DELETE FROM t1 WHERE d='null';
-ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20));
-ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
-DELETE FROM t1 WHERE a%2;
-CHECK TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-ALTER TABLE t1 ADD PRIMARY KEY (a,b(255),c(255)), ADD KEY (b(767));
-SELECT COUNT(*) FROM t1 WHERE a=44;
-COUNT(*)
-5
-SELECT a,
-LENGTH(b), b=LEFT(REPEAT(d,100*a), 65535),LENGTH(c), c=REPEAT(d,20*a), d FROM t1;
-a LENGTH(b) b=LEFT(REPEAT(d,100*a), 65535) LENGTH(c) c=REPEAT(d,20*a) d
-22 22000 1 4400 1 adfd72nh9k
-22 35200 1 7040 1 adfdijn0loKNHJik
-22 28600 1 5720 1 adfdijnmnb78k
-22 26400 1 5280 1 adfdpplkeock
-22 22000 1 4400 1 jejdkrun87
-44 44000 1 8800 1 adfd72nh9k
-44 65535 1 14080 1 adfdijn0loKNHJik
-44 57200 1 11440 1 adfdijnmnb78k
-44 52800 1 10560 1 adfdpplkeock
-44 44000 1 8800 1 jejdkrun87
-66 65535 1 13200 1 adfd72nh9k
-66 65535 1 21120 1 adfdijn0loKNHJik
-66 65535 1 17160 1 adfdijnmnb78k
-66 65535 1 15840 1 adfdpplkeock
-66 65535 1 13200 1 jejdkrun87
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` blob NOT NULL,
- `c` text NOT NULL,
- `d` text NOT NULL,
- PRIMARY KEY (`a`,`b`(255),`c`(255)),
- KEY `b` (`b`(767))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0
-CHECK TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-EXPLAIN SELECT * FROM t1 WHERE b LIKE 'adfd%';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range b b 769 NULL 12 Using where
-DROP TABLE t1;
# Test 8) Test creating a table that could lead to undo log overflow.
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
@@ -389,10 +262,6 @@
UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b;
CREATE INDEX t1a ON t1 (a(767));
-CREATE INDEX t1b ON t1 (b(767));
-CREATE INDEX t1c ON t1 (c(767));
-CREATE INDEX t1d ON t1 (d(767));
-CREATE INDEX t1e ON t1 (e(767));
UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c;
CREATE INDEX t1f ON t1 (f(767));
@@ -407,30 +276,6 @@
COMMIT;
CREATE INDEX t1g ON t1 (g(767));
UPDATE t1 SET g=@e;
-CREATE INDEX t1h ON t1 (h(767));
-UPDATE t1 SET h=@e;
-CREATE INDEX t1i ON t1 (i(767));
-UPDATE t1 SET i=@e;
-CREATE INDEX t1j ON t1 (j(767));
-UPDATE t1 SET j=@e;
-CREATE INDEX t1k ON t1 (k(767));
-UPDATE t1 SET k=@e;
-CREATE INDEX t1l ON t1 (l(767));
-UPDATE t1 SET l=@e;
-CREATE INDEX t1m ON t1 (m(767));
-UPDATE t1 SET m=@e;
-CREATE INDEX t1n ON t1 (n(767));
-UPDATE t1 SET n=@e;
-CREATE INDEX t1o ON t1 (o(767));
-UPDATE t1 SET o=@e;
-CREATE INDEX t1p ON t1 (p(767));
-UPDATE t1 SET p=@e;
-CREATE INDEX t1q ON t1 (q(767));
-UPDATE t1 SET q=@e;
-CREATE INDEX t1r ON t1 (r(767));
-UPDATE t1 SET r=@e;
-CREATE INDEX t1s ON t1 (s(767));
-UPDATE t1 SET s=@e;
CREATE INDEX t1t ON t1 (t(767));
BEGIN;
UPDATE t1 SET t=@e;
@@ -463,24 +308,8 @@
`t` blob DEFAULT NULL,
`u` blob DEFAULT NULL,
KEY `t1a` (`a`(767)),
- KEY `t1b` (`b`(767)),
- KEY `t1c` (`c`(767)),
- KEY `t1d` (`d`(767)),
- KEY `t1e` (`e`(767)),
KEY `t1f` (`f`(767)),
KEY `t1g` (`g`(767)),
- KEY `t1h` (`h`(767)),
- KEY `t1i` (`i`(767)),
- KEY `t1j` (`j`(767)),
- KEY `t1k` (`k`(767)),
- KEY `t1l` (`l`(767)),
- KEY `t1m` (`m`(767)),
- KEY `t1n` (`n`(767)),
- KEY `t1o` (`o`(767)),
- KEY `t1p` (`p`(767)),
- KEY `t1q` (`q`(767)),
- KEY `t1r` (`r`(767)),
- KEY `t1s` (`s`(767)),
KEY `t1t` (`t`(767)),
KEY `t1u` (`u`(767)),
KEY `t1ut` (`u`(767),`t`(767)),
@@ -568,14 +397,14 @@
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+Warning 139 Row size too large (> 4030). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
Warnings:
-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+Warning 139 Row size too large (> 4030). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
@@ -585,7 +414,7 @@
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+Warning 139 Row size too large (> 4030). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
DROP TABLE t1;
CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;

View File

@@ -4,7 +4,6 @@ SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_page_size';
variable_value
16384
# Test 2) The number of buffer pool pages is dependent upon the page size.
# Test 3) Query some information_shema tables that are dependent upon
# the page size.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
@@ -47,8 +46,6 @@ test/t3 Single DEFAULT 8192 Compressed MYSQLD_DATADIR/test/t3.ibd
test/t4 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4.ibd
DROP TABLE t1, t2, t3, t4;
# Test 4) The maximum row size is dependent upon the page size.
# Redundant: 8123, Compact: 8126.
# Compressed: 8126, Dynamic: 8126.
# Each row format has its own amount of overhead that
# varies depending on number of fields and other overhead.
SET SESSION innodb_strict_mode = ON;
@@ -174,9 +171,7 @@ f varchar(5) character set utf8,
PRIMARY KEY (a), KEY (b,c,d,e,f))
ENGINE=innodb;
ERROR 42000: Specified key was too long; max key length is 3072 bytes
# Test 5) Make sure that KEY_BLOCK_SIZE=16, 8, 4, 2 & 1
# are all accepted.
SET SESSION innodb_strict_mode = ON;
# Test 5) KEY_BLOCK_SIZE validation
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
SHOW WARNINGS;
Level Code Message
@@ -264,22 +259,21 @@ FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
t1 Compressed row_format=COMPRESSED
DROP TABLE t1;
# Test 6) Make sure that KEY_BLOCK_SIZE = 8 and 16
# are rejected when innodb_file_per_table=OFF
# Test 6) KEY_BLOCK_SIZE with innodb_file_per_table=OFF
SET SESSION innodb_strict_mode = ON;
SET GLOBAL innodb_file_per_table = OFF;
SHOW VARIABLES LIKE 'innodb_file_per_table';
Variable_name Value
innodb_file_per_table OFF
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
Got one of the listed errors
ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
Got one of the listed errors
ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
@@ -493,124 +487,7 @@ t1 CREATE TABLE `t1` (
KEY `t1st` (`s`(767),`t`(767))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
DROP TABLE t1;
# Bug #12429576 - Test an assertion failure on purge.
CREATE TABLE t1_purge (
A int,
B blob, C blob, D blob, E blob,
F blob, G blob, H blob,
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
INDEX (A)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t1_purge VALUES (1,
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
CREATE TABLE t2_purge (
A int PRIMARY KEY,
B blob, C blob, D blob, E blob,
F blob, G blob, H blob, I blob,
J blob, K blob, L blob,
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t2_purge VALUES (1,
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
CREATE TABLE t3_purge (
A int,
B varchar(800), C varchar(800), D varchar(800), E varchar(800),
F varchar(800), G varchar(800), H varchar(800),
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
INDEX (A)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t3_purge SELECT * FROM t1_purge;
CREATE TABLE t4_purge (
A int PRIMARY KEY,
B varchar(800), C varchar(800), D varchar(800), E varchar(800),
F varchar(800), G varchar(800), H varchar(800), I varchar(800),
J varchar(800), K varchar(800), L varchar(800),
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t4_purge SELECT * FROM t2_purge;
DELETE FROM t1_purge;
DELETE FROM t2_purge;
DELETE FROM t3_purge;
DELETE FROM t4_purge;
SET @r=REPEAT('a',500);
CREATE TABLE t12637786(a int,
v1 varchar(500), v2 varchar(500), v3 varchar(500),
v4 varchar(500), v5 varchar(500), v6 varchar(500),
v7 varchar(500), v8 varchar(500), v9 varchar(500),
v10 varchar(500), v11 varchar(500), v12 varchar(500),
v13 varchar(500), v14 varchar(500), v15 varchar(500),
v16 varchar(500), v17 varchar(500), v18 varchar(500)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
CREATE INDEX idx1 ON t12637786(a,v1);
INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t12637786 SET a=1000;
DELETE FROM t12637786;
# Bug#12963823 - Test that the purge thread does not crash when
CREATE TABLE t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
ENGINE=innodb ROW_FORMAT=dynamic;
SET @r = REPEAT('a', 767);
INSERT INTO t12963823 VALUES (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
CREATE INDEX ndx_a ON t12963823 (a(500));
CREATE INDEX ndx_b ON t12963823 (b(500));
CREATE INDEX ndx_c ON t12963823 (c(500));
CREATE INDEX ndx_d ON t12963823 (d(500));
CREATE INDEX ndx_e ON t12963823 (e(500));
CREATE INDEX ndx_f ON t12963823 (f(500));
CREATE INDEX ndx_k ON t12963823 (k(500));
CREATE INDEX ndx_l ON t12963823 (l(500));
SET @r = REPEAT('b', 500);
UPDATE t12963823 set a=@r,b=@r,c=@r,d=@r;
UPDATE t12963823 set e=@r,f=@r,g=@r,h=@r;
UPDATE t12963823 set i=@r,j=@r,k=@r,l=@r;
UPDATE t12963823 set m=@r,n=@r,o=@r,p=@r;
ALTER TABLE t12963823 DROP INDEX ndx_a;
ALTER TABLE t12963823 DROP INDEX ndx_b;
CREATE INDEX ndx_g ON t12963823 (g(500));
CREATE INDEX ndx_h ON t12963823 (h(500));
CREATE INDEX ndx_i ON t12963823 (i(500));
CREATE INDEX ndx_j ON t12963823 (j(500));
CREATE INDEX ndx_m ON t12963823 (m(500));
CREATE INDEX ndx_n ON t12963823 (n(500));
CREATE INDEX ndx_o ON t12963823 (o(500));
CREATE INDEX ndx_p ON t12963823 (p(500));
SHOW CREATE TABLE t12963823;
Table Create Table
t12963823 CREATE TABLE `t12963823` (
`a` blob DEFAULT NULL,
`b` blob DEFAULT NULL,
`c` blob DEFAULT NULL,
`d` blob DEFAULT NULL,
`e` blob DEFAULT NULL,
`f` blob DEFAULT NULL,
`g` blob DEFAULT NULL,
`h` blob DEFAULT NULL,
`i` blob DEFAULT NULL,
`j` blob DEFAULT NULL,
`k` blob DEFAULT NULL,
`l` blob DEFAULT NULL,
`m` blob DEFAULT NULL,
`n` blob DEFAULT NULL,
`o` blob DEFAULT NULL,
`p` blob DEFAULT NULL,
KEY `ndx_c` (`c`(500)),
KEY `ndx_d` (`d`(500)),
KEY `ndx_e` (`e`(500)),
KEY `ndx_f` (`f`(500)),
KEY `ndx_k` (`k`(500)),
KEY `ndx_l` (`l`(500)),
KEY `ndx_g` (`g`(500)),
KEY `ndx_h` (`h`(500)),
KEY `ndx_i` (`i`(500)),
KEY `ndx_j` (`j`(500)),
KEY `ndx_m` (`m`(500)),
KEY `ndx_n` (`n`(500)),
KEY `ndx_o` (`o`(500)),
KEY `ndx_p` (`p`(500))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
SET SESSION innodb_strict_mode = ON;
CREATE TABLE bug12547647(
a int NOT NULL, b blob NOT NULL, c text,
PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
@@ -623,7 +500,69 @@ SHOW WARNINGS;
Level Code Message
ROLLBACK;
DROP TABLE bug12547647;
SET SESSION innodb_strict_mode = off;
SET SESSION innodb_strict_mode = OFF;
CREATE TABLE t1(
pk01 varchar(48), pk02 varchar(48), pk03 varchar(48), pk04 varchar(48),
pk05 varchar(48), pk06 varchar(48), pk07 varchar(48), pk08 varchar(48),
pk09 varchar(48), pk10 varchar(48), pk11 varchar(48), pk12 varchar(48),
pk13 varchar(48), pk14 varchar(48), pk15 varchar(48), pk16 varchar(48),
sk01 varchar(48), sk02 varchar(48), sk03 varchar(48), sk04 varchar(48),
sk05 varchar(48), sk06 varchar(48), sk07 varchar(48), sk08 varchar(48),
sk09 varchar(48), sk10 varchar(48), sk11 varchar(48), sk12 varchar(48),
sk13 varchar(48), sk14 varchar(48), sk15 varchar(48), sk16 varchar(48),
PRIMARY KEY pk(pk01,pk02,pk03,pk04,pk05,pk06,pk07,pk08,
pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16),
KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08,
sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16))
ROW_FORMAT=Redundant ENGINE=InnoDB;
SET @r = repeat('a', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('b', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('c', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('d', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('e', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
DELETE from t1;
DROP TABLE t1;
CREATE TABLE t1(
pk01 varchar(48), pk02 varchar(48), pk03 varchar(48), pk04 varchar(48),
pk05 varchar(48), pk06 varchar(48), pk07 varchar(48), pk08 varchar(48),
pk09 varchar(48), pk10 varchar(48), pk11 varchar(48), pk12 varchar(48),
pk13 varchar(48), pk14 varchar(48), pk15 varchar(48), pk16 varchar(48),
sk01 varchar(48), sk02 varchar(48), sk03 varchar(48), sk04 varchar(48),
sk05 varchar(48), sk06 varchar(48), sk07 varchar(48), sk08 varchar(48),
sk09 varchar(48), sk10 varchar(48), sk11 varchar(48), sk12 varchar(48),
sk13 varchar(48), sk14 varchar(48), sk15 varchar(48), sk16 varchar(48),
PRIMARY KEY pk(pk01,pk02,pk03,pk04,pk05,pk06,pk07,pk08,
pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16),
KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08,
sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16))
ROW_FORMAT=Compressed KEY_BLOCK_SIZE=4 ENGINE=InnoDB;
SET @r = repeat('a', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('b', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('c', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('d', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
SET @r = repeat('e', 48);
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
DELETE from t1;
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767),d(767)))
@@ -642,7 +581,7 @@ CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
drop table t1;
DROP TABLE t1;
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
@@ -652,50 +591,3 @@ CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;
#
# Bug#56862 Execution of a query that uses index merge returns a wrong result
#
CREATE TABLE t1 (
pk int NOT NULL AUTO_INCREMENT PRIMARY KEY,
a int,
b int,
INDEX idx(a))
ENGINE=INNODB;
INSERT INTO t1(a,b) VALUES
(11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
(3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
(6, 600), (18, 1800), (9, 900), (10, 1000), (7, 700),
(13, 1300), (15, 1500), (19, 1900), (16, 1600), (20, 2000);
INSERT INTO t1(a,b) SELECT a+20, b+2000 FROM t1;
INSERT INTO t1(a,b) SELECT a+40, b+4000 FROM t1;
INSERT INTO t1(a,b) SELECT a+80, b+8000 FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1 VALUES (1000000, 0, 0);
set @optimizer_switch_saved=@@optimizer_switch;
SET SESSION optimizer_switch='derived_merge=off';
SET SESSION sort_buffer_size = 1024*36;
EXPLAIN
SELECT COUNT(*) FROM
(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 1537
2 DERIVED t1 index_merge PRIMARY,idx idx,PRIMARY 5,4 NULL 1537 Using sort_union(idx,PRIMARY); Using where
SELECT COUNT(*) FROM
(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
COUNT(*)
1537
set @@optimizer_switch=@optimizer_switch_saved;
SET SESSION sort_buffer_size = DEFAULT;
DROP TABLE t1;
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
DROP TABLE t12637786;
DROP TABLE t12963823;