Browse Source
MDEV-11824 Allow ROW_FORMAT=DYNAMIC in the InnoDB system tablespace
MDEV-11824 Allow ROW_FORMAT=DYNAMIC in the InnoDB system tablespace
When MySQL 5.7.9 (and MariaDB Server 10.2) introduced innodb_default_row_format and made ROW_FORMAT=DYNAMIC the default, it became possible to create any ROW_FORMAT tables in the InnoDB system tablespace, except ROW_FORMAT=COMPRESSED. In MySQL 5.7, it is possible to create ROW_FORMAT=DYNAMIC tables when TABLESPACE=innodb_system is explicitly specified. Because MariaDB Server 10.2 does not support the MySQL 5.7 TABLESPACE=innodb_system attribute for tables, we should allow ROW_FORMAT=DYNAMIC when innodb_file_per_table=0. Also, remove the test innodb_zip.innodb-create-options, which was an outdated copy of innodb_zip.create_options.pull/258/merge
7 changed files with 37 additions and 1471 deletions
-
24mysql-test/suite/innodb_zip/r/create_options.result
-
870mysql-test/suite/innodb_zip/r/innodb-create-options.result
-
9mysql-test/suite/innodb_zip/r/innodb-zip.result
-
18mysql-test/suite/innodb_zip/t/create_options.test
-
561mysql-test/suite/innodb_zip/t/innodb-create-options.test
-
13mysql-test/suite/innodb_zip/t/innodb-zip.test
-
9storage/innobase/handler/ha_innodb.cc
@ -1,870 +0,0 @@ |
|||
SET default_storage_engine=InnoDB; |
|||
SET GLOBAL innodb_file_format=`Barracuda`; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html |
|||
SET GLOBAL innodb_file_per_table=ON; |
|||
SET SESSION innodb_strict_mode = ON; |
|||
# Test 1) StrictMode=ON, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0 |
|||
# KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified' |
|||
DROP TABLE IF EXISTS t1; |
|||
Warnings: |
|||
Note 1051 Unknown table 'test.t1' |
|||
# 'FIXED' is sent to InnoDB since it is used by MyISAM. |
|||
# But it is an invalid mode in InnoDB |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED; |
|||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: invalid ROW_FORMAT specifier. |
|||
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=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 |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT 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 Compact row_format=COMPACT |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC 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 Dynamic row_format=DYNAMIC |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT 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 Redundant row_format=REDUNDANT |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT 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 Dynamic |
|||
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: invalid ROW_FORMAT specifier. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE' |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Dynamic |
|||
# Test 2) StrictMode=ON, CREATE with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE |
|||
# KEY_BLOCK_SIZE is incompatible with COMPACT, REDUNDANT, & DYNAMIC |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1; |
|||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. |
|||
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=REDUNDANT KEY_BLOCK_SIZE=2; |
|||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. |
|||
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=DYNAMIC KEY_BLOCK_SIZE=4; |
|||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. |
|||
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=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 ADD COLUMN f1 INT; |
|||
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 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT 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 key_block_size=1 |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
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 key_block_size=1 |
|||
# Test 3) StrictMode=ON, ALTER with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ); |
|||
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: invalid ROW_FORMAT specifier. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE' |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT 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 key_block_size=1 |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED 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 |
|||
# Test 4) StrictMode=ON, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid non-zero KEY_BLOCK_SIZE |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Compact row_format=COMPACT |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=2; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT; |
|||
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 Redundant row_format=REDUNDANT |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=4; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC; |
|||
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 Dynamic row_format=DYNAMIC |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=2; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
|||
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 |
|||
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 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT 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 key_block_size=1 |
|||
# Test 5) StrictMode=ON, CREATE with a valid KEY_BLOCK_SIZE |
|||
# ALTER with each ROW_FORMAT |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=2; |
|||
SHOW CREATE TABLE t1; |
|||
Table Create Table |
|||
t1 CREATE TABLE `t1` ( |
|||
`i` int(11) DEFAULT NULL |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2 |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW CREATE TABLE t1; |
|||
Table Create Table |
|||
t1 CREATE TABLE `t1` ( |
|||
`i` int(11) DEFAULT NULL, |
|||
`f1` int(11) DEFAULT NULL |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2 |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
|||
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 ROW_FORMAT=DEFAULT 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 Dynamic |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT; |
|||
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 Compact row_format=COMPACT |
|||
# Test 6) StrictMode=ON, CREATE with an invalid KEY_BLOCK_SIZE. |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=9; |
|||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16] |
|||
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 |
|||
# Test 7) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and |
|||
# and a valid non-zero KEY_BLOCK_SIZE are rejected with Antelope |
|||
# and that they can be set to default values during strict mode. |
|||
SET GLOBAL innodb_file_format=Antelope; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html |
|||
DROP TABLE IF EXISTS t1; |
|||
Warnings: |
|||
Note 1051 Unknown table 'test.t1' |
|||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=4; |
|||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. |
|||
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; |
|||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope. |
|||
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=DYNAMIC; |
|||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope. |
|||
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=REDUNDANT; |
|||
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 Redundant row_format=REDUNDANT |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; |
|||
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 Compact row_format=COMPACT |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT; |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=2; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT' |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT' |
|||
SET GLOBAL innodb_file_format=Barracuda; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; |
|||
SET GLOBAL innodb_file_format=Antelope; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
Warnings: |
|||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4. |
|||
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope. |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. |
|||
SHOW CREATE TABLE t1; |
|||
Table Create Table |
|||
t1 CREATE TABLE `t1` ( |
|||
`i` int(11) DEFAULT NULL, |
|||
`f1` int(11) DEFAULT NULL |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
ALTER TABLE t1 ADD COLUMN f2 INT; |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
SET GLOBAL innodb_file_format=Barracuda; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html |
|||
# Test 8) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and |
|||
# and a valid non-zero KEY_BLOCK_SIZE are rejected with |
|||
# innodb_file_per_table=OFF and that they can be set to default |
|||
# values during strict mode. |
|||
SET GLOBAL innodb_file_per_table=OFF; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1; |
|||
ERROR HY000: Can't create table `test`.`t1` (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`.`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; |
|||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. |
|||
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=DYNAMIC; |
|||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table. |
|||
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=REDUNDANT; |
|||
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 Redundant row_format=REDUNDANT |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; |
|||
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 Compact row_format=COMPACT |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT; |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=1; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT' |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC; |
|||
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT' |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table. |
|||
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT' |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT; |
|||
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 Compact row_format=COMPACT |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT; |
|||
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 Redundant row_format=REDUNDANT |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT; |
|||
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 Dynamic |
|||
SET GLOBAL innodb_file_per_table=ON; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; |
|||
SET GLOBAL innodb_file_per_table=OFF; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
ALTER TABLE t1 ADD COLUMN f2 INT; |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
SET GLOBAL innodb_file_per_table=ON; |
|||
################################################## |
|||
SET SESSION innodb_strict_mode = OFF; |
|||
# Test 9) StrictMode=OFF, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0 |
|||
# KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified' |
|||
# 'FIXED' is sent to InnoDB since it is used by MyISAM. |
|||
# It is an invalid mode in InnoDB, use COMPACT |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED; |
|||
Warnings: |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Dynamic row_format=FIXED |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED 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 |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT 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 Compact row_format=COMPACT |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC 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 Dynamic row_format=DYNAMIC |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT 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 Redundant row_format=REDUNDANT |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT 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 Dynamic |
|||
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0; |
|||
Warnings: |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Dynamic row_format=FIXED |
|||
# Test 10) StrictMode=OFF, CREATE with each ROW_FORMAT & a valid KEY_BLOCK_SIZE |
|||
# KEY_BLOCK_SIZE is ignored with COMPACT, REDUNDANT, & DYNAMIC |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Compact row_format=COMPACT key_block_size=1 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Redundant row_format=REDUNDANT key_block_size=2 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Dynamic row_format=DYNAMIC key_block_size=4 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED 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 ADD COLUMN f1 INT; |
|||
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 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT 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 key_block_size=1 |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
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 key_block_size=1 |
|||
# Test 11) StrictMode=OFF, ALTER with each ROW_FORMAT & a valid KEY_BLOCK_SIZE |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ); |
|||
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Dynamic row_format=FIXED key_block_size=1 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ); |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Compact row_format=COMPACT key_block_size=2 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ); |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Dynamic row_format=DYNAMIC key_block_size=4 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ); |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Redundant row_format=REDUNDANT key_block_size=2 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ); |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT 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 key_block_size=1 |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED 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 |
|||
# Test 12) StrictMode=OFF, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid KEY_BLOCK_SIZE |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Compact row_format=COMPACT |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=2; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Compact row_format=COMPACT key_block_size=2 |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Redundant row_format=REDUNDANT key_block_size=2 |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Dynamic row_format=DYNAMIC key_block_size=2 |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
|||
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=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 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT 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 key_block_size=2 |
|||
# Test 13) StrictMode=OFF, CREATE with a valid KEY_BLOCK_SIZE |
|||
# ALTER with each ROW_FORMAT |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
SHOW CREATE TABLE t1; |
|||
Table Create Table |
|||
t1 CREATE TABLE `t1` ( |
|||
`i` int(11) DEFAULT NULL |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1 |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
SHOW CREATE TABLE t1; |
|||
Table Create Table |
|||
t1 CREATE TABLE `t1` ( |
|||
`i` int(11) DEFAULT NULL, |
|||
`f1` int(11) DEFAULT NULL |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1 |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Compact row_format=COMPACT key_block_size=1 |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Redundant row_format=REDUNDANT key_block_size=1 |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Dynamic row_format=DYNAMIC key_block_size=1 |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
|||
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 ROW_FORMAT=DEFAULT 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 Dynamic |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT; |
|||
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 Compact row_format=COMPACT |
|||
# Test 14) StrictMode=OFF, CREATE with an invalid KEY_BLOCK_SIZE, |
|||
# it defaults to half of the page size. |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=15; |
|||
Warnings: |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=15. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=15. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Dynamic key_block_size=15 |
|||
# Test 15) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a |
|||
valid KEY_BLOCK_SIZE are remembered but not used when ROW_FORMAT |
|||
is reverted to Antelope and then used again when ROW_FORMAT=Barracuda. |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED 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 |
|||
SET GLOBAL innodb_file_format=Antelope; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
Warnings: |
|||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1. |
|||
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope. |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. |
|||
SHOW WARNINGS; |
|||
Level Code Message |
|||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. |
|||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1. |
|||
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope. |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
TABLE_NAME ROW_FORMAT CREATE_OPTIONS |
|||
t1 Dynamic row_format=COMPRESSED key_block_size=1 |
|||
SET GLOBAL innodb_file_format=Barracuda; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html |
|||
ALTER TABLE t1 ADD COLUMN f2 INT; |
|||
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 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; |
|||
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 Dynamic row_format=DYNAMIC |
|||
SET GLOBAL innodb_file_format=Antelope; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
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 Dynamic row_format=DYNAMIC |
|||
SET GLOBAL innodb_file_format=Barracuda; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html |
|||
ALTER TABLE t1 ADD COLUMN f2 INT; |
|||
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 Dynamic row_format=DYNAMIC |
|||
# Test 16) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a |
|||
valid KEY_BLOCK_SIZE are remembered but not used when innodb_file_per_table=OFF |
|||
and then used again when innodb_file_per_table=ON. |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED 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 |
|||
SET GLOBAL innodb_file_per_table=OFF; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
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 |
|||
SET GLOBAL innodb_file_per_table=ON; |
|||
ALTER TABLE t1 ADD COLUMN f2 INT; |
|||
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 |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; |
|||
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 Dynamic row_format=DYNAMIC |
|||
SET GLOBAL innodb_file_per_table=OFF; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
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 Dynamic row_format=DYNAMIC |
|||
SET GLOBAL innodb_file_per_table=ON; |
|||
ALTER TABLE t1 ADD COLUMN f2 INT; |
|||
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 Dynamic row_format=DYNAMIC |
|||
# Cleanup |
|||
DROP TABLE IF EXISTS t1; |
|||
Warnings: |
|||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html |
|||
@ -1,561 +0,0 @@ |
|||
--source include/have_innodb.inc |
|||
# Tests for various combinations of ROW_FORMAT and KEY_BLOCK_SIZE |
|||
# Related bugs; |
|||
# Bug#54679: ALTER TABLE causes compressed row_format to revert to compact |
|||
# Bug#56628: ALTER TABLE .. KEY_BLOCK_SIZE=0 produces untrue warning or unnecessary error |
|||
# Bug#56632: ALTER TABLE implicitly changes ROW_FORMAT to COMPRESSED |
|||
# Rules for interpreting CREATE_OPTIONS |
|||
# 1) Create options on an ALTER are added to the options on the |
|||
# previous CREATE or ALTER statements. |
|||
# 2) KEY_BLOCK_SIZE=0 is considered a unspecified value. |
|||
# If the current ROW_FORMAT has explicitly been set to COMPRESSED, |
|||
# InnoDB will use a default value of 8. Otherwise KEY_BLOCK_SIZE |
|||
# will not be used. |
|||
# 3) ROW_FORMAT=DEFAULT allows InnoDB to choose its own default, COMPACT. |
|||
# 4) ROW_FORMAT=DEFAULT and KEY_BLOCK_SIZE=0 can be used at any time to |
|||
# unset or erase the values persisted in the MySQL dictionary and |
|||
# by SHOW CTREATE TABLE. |
|||
# 5) When incompatible values for ROW_FORMAT and KEY_BLOCK_SIZE are |
|||
# both explicitly given, the ROW_FORMAT is always used in non-strict |
|||
# mode. |
|||
# 6) InnoDB will automatically convert a table to COMPRESSED only if a |
|||
# valid non-zero KEY_BLOCK_SIZE has been given and ROW_FORMAT=DEFAULT |
|||
# or has not been used on a previous CREATE TABLE or ALTER TABLE. |
|||
# 7) InnoDB strict mode is designed to prevent incompatible create |
|||
# options from being used together. |
|||
# 8) The non-strict behavior is intended to permit you to import a |
|||
# mysqldump file into a database that does not support compressed |
|||
# tables, even if the source database contained compressed tables. |
|||
# All invalid values and/or incompatible combinations of ROW_FORMAT |
|||
# and KEY_BLOCK_SIZE are automatically corrected |
|||
# |
|||
# *** innodb_strict_mode=ON *** |
|||
# 1) Valid ROW_FORMATs are COMPRESSED, COMPACT, DEFAULT, DYNAMIC |
|||
# & REDUNDANT. All others are rejected. |
|||
# 2) Valid KEY_BLOCK_SIZEs are 0,1,2,4,8,16. All others are rejected. |
|||
# 3) KEY_BLOCK_SIZE=0 can be used to set it to 'unspecified'. |
|||
# 4) KEY_BLOCK_SIZE=1,2,4,8 & 16 are incompatible with COMPACT, DYNAMIC & |
|||
# REDUNDANT. |
|||
# 5) KEY_BLOCK_SIZE=1,2,4,8 & 16 as well as ROW_FORMAT=COMPRESSED and |
|||
# ROW_FORMAT=DYNAMIC are incompatible with innodb_file_format=Antelope |
|||
# and innodb_file_per_table=OFF |
|||
# 6) KEY_BLOCK_SIZE on an ALTER must occur with ROW_FORMAT=COMPRESSED |
|||
# or ROW_FORMAT=DEFAULT if the ROW_FORMAT was previously specified |
|||
# as COMPACT, DYNAMIC or REDUNDANT. |
|||
# 7) KEY_BLOCK_SIZE on an ALTER can occur without a ROW_FORMAT if the |
|||
# previous ROW_FORMAT was DEFAULT, COMPRESSED, or unspecified. |
|||
# |
|||
# *** innodb_strict_mode=OFF *** |
|||
# 1. Ignore a bad KEY_BLOCK_SIZE, defaulting it to 8. |
|||
# 2. Ignore a bad ROW_FORMAT, defaulting to COMPACT. |
|||
# 3. Ignore a valid KEY_BLOCK_SIZE when an incompatible but valid |
|||
# ROW_FORMAT is specified. |
|||
# 4. If innodb_file_format=Antelope or innodb_file_per_table=OFF |
|||
# it will ignore ROW_FORMAT=COMPRESSED or DYNAMIC and it will |
|||
# ignore all non-zero KEY_BLOCK_SIZEs. |
|||
# |
|||
# See InnoDB documentation page "SQL Compression Syntax Warnings and Errors" |
|||
# This test case does not try to create tables with KEY_BLOCK_SIZE > 4 |
|||
# since they are rejected for InnoDB page sizes of 8k and 16k. |
|||
# See innodb_16k and innodb_8k for those tests. |
|||
|
|||
-- source include/have_innodb.inc |
|||
SET default_storage_engine=InnoDB; |
|||
|
|||
--disable_query_log |
|||
# These values can change during the test |
|||
LET $innodb_file_format_orig=`select @@innodb_file_format`; |
|||
LET $innodb_file_per_table_orig=`select @@innodb_file_per_table`; |
|||
LET $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`; |
|||
--enable_query_log |
|||
|
|||
SET GLOBAL innodb_file_format=`Barracuda`; |
|||
SET GLOBAL innodb_file_per_table=ON; |
|||
|
|||
# The first half of these tests are with strict mode ON. |
|||
SET SESSION innodb_strict_mode = ON; |
|||
|
|||
--echo # Test 1) StrictMode=ON, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0 |
|||
--echo # KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified' |
|||
DROP TABLE IF EXISTS t1; |
|||
--echo # 'FIXED' is sent to InnoDB since it is used by MyISAM. |
|||
--echo # But it is an invalid mode in InnoDB |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
--error ER_CANT_CREATE_TABLE |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
SHOW WARNINGS; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
|
|||
|
|||
--echo # Test 2) StrictMode=ON, CREATE with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE |
|||
--echo # KEY_BLOCK_SIZE is incompatible with COMPACT, REDUNDANT, & DYNAMIC |
|||
DROP TABLE IF EXISTS t1; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
--error ER_CANT_CREATE_TABLE |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
SHOW WARNINGS; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
--error ER_CANT_CREATE_TABLE |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
SHOW WARNINGS; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
--error ER_CANT_CREATE_TABLE |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
SHOW WARNINGS; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
|
|||
--echo # Test 3) StrictMode=ON, ALTER with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ); |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; |
|||
SHOW WARNINGS; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
|
|||
--echo # Test 4) StrictMode=ON, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid non-zero KEY_BLOCK_SIZE |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=4; |
|||
SHOW WARNINGS; |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
--echo # Test 5) StrictMode=ON, CREATE with a valid KEY_BLOCK_SIZE |
|||
--echo # ALTER with each ROW_FORMAT |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=2; |
|||
SHOW CREATE TABLE t1; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW CREATE TABLE t1; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT; |
|||
SHOW WARNINGS; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT; |
|||
SHOW WARNINGS; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC; |
|||
SHOW WARNINGS; |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
--echo # Test 6) StrictMode=ON, CREATE with an invalid KEY_BLOCK_SIZE. |
|||
DROP TABLE IF EXISTS t1; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
--error ER_CANT_CREATE_TABLE |
|||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=9; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
SHOW WARNINGS; |
|||
|
|||
--echo # Test 7) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and |
|||
--echo # and a valid non-zero KEY_BLOCK_SIZE are rejected with Antelope |
|||
--echo # and that they can be set to default values during strict mode. |
|||
SET GLOBAL innodb_file_format=Antelope; |
|||
DROP TABLE IF EXISTS t1; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
--error ER_CANT_CREATE_TABLE |
|||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=4; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
SHOW WARNINGS; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
--error ER_CANT_CREATE_TABLE |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
SHOW WARNINGS; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
--error ER_CANT_CREATE_TABLE |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
SHOW WARNINGS; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT; |
|||
SHOW WARNINGS; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
|||
SHOW WARNINGS; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC; |
|||
SHOW WARNINGS; |
|||
SET GLOBAL innodb_file_format=Barracuda; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; |
|||
SET GLOBAL innodb_file_format=Antelope; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW CREATE TABLE t1; |
|||
SHOW WARNINGS; |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
ALTER TABLE t1 ADD COLUMN f2 INT; |
|||
SHOW WARNINGS; |
|||
SET GLOBAL innodb_file_format=Barracuda; |
|||
|
|||
--echo # Test 8) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and |
|||
--echo # and a valid non-zero KEY_BLOCK_SIZE are rejected with |
|||
--echo # innodb_file_per_table=OFF and that they can be set to default |
|||
--echo # values during strict mode. |
|||
SET GLOBAL innodb_file_per_table=OFF; |
|||
DROP TABLE IF EXISTS t1; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
--error ER_CANT_CREATE_TABLE |
|||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
SHOW WARNINGS; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
--error ER_CANT_CREATE_TABLE |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
SHOW WARNINGS; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
--error ER_CANT_CREATE_TABLE |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; |
|||
--replace_regex / - .*[0-9]*[)]/)/ |
|||
SHOW WARNINGS; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT; |
|||
SHOW WARNINGS; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
|||
SHOW WARNINGS; |
|||
--error ER_ILLEGAL_HA_CREATE_OPTION |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC; |
|||
SHOW WARNINGS; |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
SET GLOBAL innodb_file_per_table=ON; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; |
|||
SET GLOBAL innodb_file_per_table=OFF; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW WARNINGS; |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
ALTER TABLE t1 ADD COLUMN f2 INT; |
|||
SHOW WARNINGS; |
|||
SET GLOBAL innodb_file_per_table=ON; |
|||
|
|||
--echo ################################################## |
|||
SET SESSION innodb_strict_mode = OFF; |
|||
|
|||
--echo # Test 9) StrictMode=OFF, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0 |
|||
--echo # KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified' |
|||
--echo # 'FIXED' is sent to InnoDB since it is used by MyISAM. |
|||
--echo # It is an invalid mode in InnoDB, use COMPACT |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
--echo # Test 10) StrictMode=OFF, CREATE with each ROW_FORMAT & a valid KEY_BLOCK_SIZE |
|||
--echo # KEY_BLOCK_SIZE is ignored with COMPACT, REDUNDANT, & DYNAMIC |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
|
|||
--echo # Test 11) StrictMode=OFF, ALTER with each ROW_FORMAT & a valid KEY_BLOCK_SIZE |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ); |
|||
ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ); |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ); |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ); |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ); |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
|
|||
--echo # Test 12) StrictMode=OFF, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid KEY_BLOCK_SIZE |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 KEY_BLOCK_SIZE=4; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
--echo # Test 13) StrictMode=OFF, CREATE with a valid KEY_BLOCK_SIZE |
|||
--echo # ALTER with each ROW_FORMAT |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
SHOW CREATE TABLE t1; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW WARNINGS; |
|||
SHOW CREATE TABLE t1; |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=COMPRESSED; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
ALTER TABLE t1 ROW_FORMAT=COMPACT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
--echo # Test 14) StrictMode=OFF, CREATE with an invalid KEY_BLOCK_SIZE, |
|||
--echo # it defaults to half of the page size. |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=15; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
--echo # Test 15) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a |
|||
--echo valid KEY_BLOCK_SIZE are remembered but not used when ROW_FORMAT |
|||
--echo is reverted to Antelope and then used again when ROW_FORMAT=Barracuda. |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
SET GLOBAL innodb_file_format=Antelope; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
SET GLOBAL innodb_file_format=Barracuda; |
|||
ALTER TABLE t1 ADD COLUMN f2 INT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
SET GLOBAL innodb_file_format=Antelope; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
SET GLOBAL innodb_file_format=Barracuda; |
|||
ALTER TABLE t1 ADD COLUMN f2 INT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
--echo # Test 16) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a |
|||
--echo valid KEY_BLOCK_SIZE are remembered but not used when innodb_file_per_table=OFF |
|||
--echo and then used again when innodb_file_per_table=ON. |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
SET GLOBAL innodb_file_per_table=OFF; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
SET GLOBAL innodb_file_per_table=ON; |
|||
ALTER TABLE t1 ADD COLUMN f2 INT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
DROP TABLE IF EXISTS t1; |
|||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
SET GLOBAL innodb_file_per_table=OFF; |
|||
ALTER TABLE t1 ADD COLUMN f1 INT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
SET GLOBAL innodb_file_per_table=ON; |
|||
ALTER TABLE t1 ADD COLUMN f2 INT; |
|||
SHOW WARNINGS; |
|||
SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; |
|||
|
|||
|
|||
--echo # Cleanup |
|||
DROP TABLE IF EXISTS t1; |
|||
|
|||
--disable_query_log |
|||
EVAL SET GLOBAL innodb_file_format=$innodb_file_format_orig; |
|||
EVAL SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig; |
|||
EVAL SET SESSION innodb_strict_mode=$innodb_strict_mode_orig; |
|||
--enable_query_log |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue