mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
10.0-base merge
This commit is contained in:
561
mysql-test/suite/innodb_zip/t/innodb-create-options.test
Normal file
561
mysql-test/suite/innodb_zip/t/innodb-create-options.test
Normal file
@ -0,0 +1,561 @@
|
||||
--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
|
||||
|
374
mysql-test/suite/innodb_zip/t/innodb-zip.test
Normal file
374
mysql-test/suite/innodb_zip/t/innodb-zip.test
Normal file
@ -0,0 +1,374 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS mysqltest_innodb_zip;
|
||||
--enable_warnings
|
||||
|
||||
CREATE DATABASE mysqltest_innodb_zip;
|
||||
USE mysqltest_innodb_zip;
|
||||
SELECT table_name, row_format, data_length, index_length
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema='mysqltest_innodb_zip';
|
||||
|
||||
let $per_table=`select @@innodb_file_per_table`;
|
||||
let $format=`select @@innodb_file_format`;
|
||||
let $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
|
||||
let $innodb_file_format_orig=`select @@innodb_file_format`;
|
||||
let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
|
||||
SET @save_innodb_stats_on_metadata=@@global.innodb_stats_on_metadata;
|
||||
|
||||
|
||||
--let $query_i_s = SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql'
|
||||
|
||||
set session innodb_strict_mode=0;
|
||||
set global innodb_file_per_table=off;
|
||||
set global innodb_file_format=`0`;
|
||||
SET @@global.innodb_stats_on_metadata=ON;
|
||||
|
||||
create table t0(a int primary key) engine=innodb row_format=compressed;
|
||||
create table t00(a int primary key) engine=innodb
|
||||
key_block_size=4 row_format=compressed;
|
||||
create table t1(a int primary key) engine=innodb row_format=dynamic;
|
||||
create table t2(a int primary key) engine=innodb row_format=redundant;
|
||||
create table t3(a int primary key) engine=innodb row_format=compact;
|
||||
create table t4(a int primary key) engine=innodb key_block_size=9;
|
||||
create table t5(a int primary key) engine=innodb
|
||||
key_block_size=1 row_format=redundant;
|
||||
|
||||
set global innodb_file_per_table=on;
|
||||
create table t6(a int primary key) engine=innodb
|
||||
key_block_size=1 row_format=redundant;
|
||||
set global innodb_file_format=`1`;
|
||||
create table t7(a int primary key) engine=innodb
|
||||
key_block_size=1 row_format=redundant;
|
||||
create table t8(a int primary key) engine=innodb
|
||||
key_block_size=1 row_format=fixed;
|
||||
create table t9(a int primary key) engine=innodb
|
||||
key_block_size=1 row_format=compact;
|
||||
create table t10(a int primary key) engine=innodb
|
||||
key_block_size=1 row_format=dynamic;
|
||||
create table t11(a int primary key) engine=innodb
|
||||
key_block_size=1 row_format=compressed;
|
||||
create table t12(a int primary key) engine=innodb
|
||||
key_block_size=1;
|
||||
create table t13(a int primary key) engine=innodb
|
||||
row_format=compressed;
|
||||
create table t14(a int primary key) engine=innodb key_block_size=9;
|
||||
|
||||
--replace_result 16384 {valid} 8192 {valid} 4096 {valid} 2048 {valid}
|
||||
--eval $query_i_s
|
||||
|
||||
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
|
||||
alter table t1 key_block_size=0;
|
||||
alter table t1 row_format=dynamic;
|
||||
--replace_result 16384 {valid} 8192 {valid} 4096 {valid}
|
||||
--eval $query_i_s
|
||||
alter table t1 row_format=compact;
|
||||
--replace_result 16384 {valid} 8192 {valid} 4096 {valid}
|
||||
--eval $query_i_s
|
||||
alter table t1 row_format=redundant;
|
||||
--replace_result 16384 {valid} 8192 {valid} 4096 {valid}
|
||||
--eval $query_i_s
|
||||
drop table t1;
|
||||
|
||||
create table t1(a int not null, b text, index(b(10))) engine=innodb
|
||||
key_block_size=1;
|
||||
|
||||
create table t2(b text)engine=innodb;
|
||||
insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000)));
|
||||
|
||||
insert into t1 select 1, b from t2;
|
||||
commit;
|
||||
|
||||
connect (a,localhost,root,,mysqltest_innodb_zip);
|
||||
connect (b,localhost,root,,mysqltest_innodb_zip);
|
||||
|
||||
connection a;
|
||||
begin;
|
||||
update t1 set b=repeat('B',100);
|
||||
|
||||
connection b;
|
||||
select a,left(b,40) from t1 natural join t2;
|
||||
|
||||
connection a;
|
||||
rollback;
|
||||
|
||||
connection b;
|
||||
select a,left(b,40) from t1 natural join t2;
|
||||
|
||||
connection default;
|
||||
disconnect a;
|
||||
disconnect b;
|
||||
|
||||
analyze table t1;
|
||||
analyze table t2;
|
||||
--replace_result 16384 {valid} 12288 {valid}
|
||||
--eval $query_i_s
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Bug #50945 moved to innodb_16k.test, innodb_8k.test, & innodb_4k.test
|
||||
#
|
||||
|
||||
#
|
||||
# Test blob column inheritance (mantis issue#36)
|
||||
#
|
||||
|
||||
create table t1( c1 int not null, c2 blob, c3 blob, c4 blob,
|
||||
primary key(c1, c2(22), c3(22)))
|
||||
engine = innodb row_format = dynamic;
|
||||
begin;
|
||||
insert into t1 values(1, repeat('A', 20000), repeat('B', 20000),
|
||||
repeat('C', 20000));
|
||||
|
||||
update t1 set c3 = repeat('D', 20000) where c1 = 1;
|
||||
commit;
|
||||
|
||||
# one blob column which is unchanged in update and part of PK
|
||||
# one blob column which is changed and part of of PK
|
||||
# one blob column which is not part of PK and is unchanged
|
||||
select count(*) from t1 where c2 = repeat('A', 20000);
|
||||
select count(*) from t1 where c3 = repeat('D', 20000);
|
||||
select count(*) from t1 where c4 = repeat('C', 20000);
|
||||
|
||||
update t1 set c3 = repeat('E', 20000) where c1 = 1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
#
|
||||
# Test innodb_file_format
|
||||
#
|
||||
set global innodb_file_format=`0`;
|
||||
select @@innodb_file_format;
|
||||
set global innodb_file_format=`1`;
|
||||
select @@innodb_file_format;
|
||||
-- error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_file_format=`2`;
|
||||
-- error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_file_format=`-1`;
|
||||
set global innodb_file_format=`Antelope`;
|
||||
set global innodb_file_format=`Barracuda`;
|
||||
-- error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_file_format=`Cheetah`;
|
||||
-- error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_file_format=`abc`;
|
||||
-- error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_file_format=`1a`;
|
||||
-- error ER_WRONG_VALUE_FOR_VAR
|
||||
set global innodb_file_format=``;
|
||||
|
||||
#test strict mode.
|
||||
# this does not work anymore, has been removed from mysqltest
|
||||
# -- enable_errors
|
||||
set global innodb_file_per_table = on;
|
||||
set global innodb_file_format = `1`;
|
||||
|
||||
set innodb_strict_mode = off;
|
||||
create table t1 (id int primary key) engine = innodb key_block_size = 0;
|
||||
drop table t1;
|
||||
|
||||
#set strict_mode
|
||||
set innodb_strict_mode = on;
|
||||
|
||||
#Test different values of KEY_BLOCK_SIZE
|
||||
|
||||
create table t1 (id int primary key) engine = innodb key_block_size = 0;
|
||||
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t2 (id int primary key) engine = innodb key_block_size = 9;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
|
||||
|
||||
create table t3 (id int primary key) engine = innodb key_block_size = 1;
|
||||
create table t4 (id int primary key) engine = innodb key_block_size = 2;
|
||||
create table t5 (id int primary key) engine = innodb key_block_size = 4;
|
||||
# These tests are now done in innodb_16k, innodb_8k and innodb_4k
|
||||
# where they get different result depending on page size
|
||||
# create table t6 (id int primary key) engine = innodb key_block_size = 8;
|
||||
# create table t7 (id int primary key) engine = innodb key_block_size = 16;
|
||||
|
||||
#check various ROW_FORMAT values.
|
||||
create table t8 (id int primary key) engine = innodb row_format = compressed;
|
||||
create table t9 (id int primary key) engine = innodb row_format = dynamic;
|
||||
create table t10(id int primary key) engine = innodb row_format = compact;
|
||||
create table t11(id int primary key) engine = innodb row_format = redundant;
|
||||
|
||||
--replace_result 16384 {valid} 8192 {valid} 4096 {valid} 2048 {valid}
|
||||
--eval $query_i_s
|
||||
drop table t1, t3, t4, t5, t8, t9, t10, t11;
|
||||
|
||||
#test different values of ROW_FORMAT with KEY_BLOCK_SIZE
|
||||
create table t1 (id int primary key) engine = innodb
|
||||
key_block_size = 4 row_format = compressed;
|
||||
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t2 (id int primary key) engine = innodb
|
||||
key_block_size = 4 row_format = redundant;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t3 (id int primary key) engine = innodb
|
||||
key_block_size = 4 row_format = compact;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t4 (id int primary key) engine = innodb
|
||||
key_block_size = 4 row_format = dynamic;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
|
||||
create table t5 (id int primary key) engine = innodb
|
||||
key_block_size = 4 row_format = default;
|
||||
|
||||
--eval $query_i_s
|
||||
drop table t1, t5;
|
||||
|
||||
#test multiple errors
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t1 (id int primary key) engine = innodb
|
||||
key_block_size = 9 row_format = redundant;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t2 (id int primary key) engine = innodb
|
||||
key_block_size = 9 row_format = compact;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t2 (id int primary key) engine = innodb
|
||||
key_block_size = 9 row_format = dynamic;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
|
||||
--eval $query_i_s
|
||||
|
||||
#test valid values with innodb_file_per_table unset
|
||||
set global innodb_file_per_table = off;
|
||||
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t1 (id int primary key) engine = innodb key_block_size = 1;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t2 (id int primary key) engine = innodb key_block_size = 2;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t3 (id int primary key) engine = innodb key_block_size = 4;
|
||||
show warnings;
|
||||
|
||||
# Tests for key_block_size = 8 and 16 were moved to innodb_16k, innodb_8k
|
||||
# and innodb_4k since they get different warnings with smaller page sizes.
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t6 (id int primary key) engine = innodb row_format = compressed;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t7 (id int primary key) engine = innodb row_format = dynamic;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
create table t8 (id int primary key) engine = innodb row_format = compact;
|
||||
create table t9 (id int primary key) engine = innodb row_format = redundant;
|
||||
|
||||
--replace_result 16384 {valid} 8192 {valid} 4096 {valid}
|
||||
--eval $query_i_s
|
||||
drop table t8, t9;
|
||||
|
||||
#test valid values with innodb_file_format unset
|
||||
set global innodb_file_per_table = on;
|
||||
set global innodb_file_format = `0`;
|
||||
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t1 (id int primary key) engine = innodb key_block_size = 1;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t2 (id int primary key) engine = innodb key_block_size = 2;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t3 (id int primary key) engine = innodb key_block_size = 4;
|
||||
show warnings;
|
||||
|
||||
# Tests for key_block_size = 8 and 16 were moved to innodb_16k, innodb_8k
|
||||
# and innodb_4k since they get different warnings with smaller page sizes.
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t6 (id int primary key) engine = innodb row_format = compressed;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t7 (id int primary key) engine = innodb row_format = dynamic;
|
||||
--replace_regex / - .*[0-9]*[)]/)/
|
||||
show warnings;
|
||||
create table t8 (id int primary key) engine = innodb row_format = compact;
|
||||
create table t9 (id int primary key) engine = innodb row_format = redundant;
|
||||
|
||||
--replace_result 16384 {valid} 8192 {valid} 4096 {valid}
|
||||
--eval $query_i_s
|
||||
drop table t8, t9;
|
||||
|
||||
eval set global innodb_file_per_table=$per_table;
|
||||
eval set global innodb_file_format=$format;
|
||||
#
|
||||
# Testing of tablespace tagging
|
||||
#
|
||||
-- disable_info
|
||||
set global innodb_file_per_table=on;
|
||||
set global innodb_file_format=`Barracuda`;
|
||||
set global innodb_file_format_max=`Antelope`;
|
||||
create table normal_table (
|
||||
c1 int
|
||||
) engine = innodb;
|
||||
select @@innodb_file_format_max;
|
||||
create table zip_table (
|
||||
c1 int
|
||||
) engine = innodb key_block_size = 4;
|
||||
select @@innodb_file_format_max;
|
||||
set global innodb_file_format_max=`Antelope`;
|
||||
select @@innodb_file_format_max;
|
||||
-- disable_result_log
|
||||
show table status;
|
||||
-- enable_result_log
|
||||
select @@innodb_file_format_max;
|
||||
drop table normal_table, zip_table;
|
||||
-- disable_result_log
|
||||
|
||||
#
|
||||
# restore environment to the state it was before this test execution
|
||||
#
|
||||
|
||||
-- disable_query_log
|
||||
eval set global innodb_file_format=$format;
|
||||
eval set global innodb_file_per_table=$per_table;
|
||||
eval set session innodb_strict_mode=$innodb_strict_mode_orig;
|
||||
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
|
||||
eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
|
||||
SET @@global.innodb_stats_on_metadata=@save_innodb_stats_on_metadata;
|
||||
--enable_query_log
|
||||
|
||||
USE test;
|
||||
DROP DATABASE mysqltest_innodb_zip;
|
||||
|
1159
mysql-test/suite/innodb_zip/t/innodb_bug36169.test
Normal file
1159
mysql-test/suite/innodb_zip/t/innodb_bug36169.test
Normal file
File diff suppressed because it is too large
Load Diff
30
mysql-test/suite/innodb_zip/t/innodb_bug36172.test
Normal file
30
mysql-test/suite/innodb_zip/t/innodb_bug36172.test
Normal file
@ -0,0 +1,30 @@
|
||||
--source include/have_innodb.inc
|
||||
#
|
||||
# Test case for bug 36172
|
||||
#
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
SET storage_engine=InnoDB;
|
||||
|
||||
# we do not really care about what gets printed, we are only
|
||||
# interested in getting success or failure according to our
|
||||
# expectations
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
|
||||
let $file_format=`select @@innodb_file_format`;
|
||||
let $file_per_table=`select @@innodb_file_per_table`;
|
||||
SET GLOBAL innodb_file_format='Barracuda';
|
||||
SET GLOBAL innodb_file_per_table=on;
|
||||
|
||||
DROP TABLE IF EXISTS `table0`;
|
||||
CREATE TABLE `table0` ( `col0` tinyint(1) DEFAULT NULL, `col1` tinyint(1) DEFAULT NULL, `col2` tinyint(4) DEFAULT NULL, `col3` date DEFAULT NULL, `col4` time DEFAULT NULL, `col5` set('test1','test2','test3') DEFAULT NULL, `col6` time DEFAULT NULL, `col7` text, `col8` decimal(10,0) DEFAULT NULL, `col9` set('test1','test2','test3') DEFAULT NULL, `col10` float DEFAULT NULL, `col11` double DEFAULT NULL, `col12` enum('test1','test2','test3') DEFAULT NULL, `col13` tinyblob, `col14` year(4) DEFAULT NULL, `col15` set('test1','test2','test3') DEFAULT NULL, `col16` decimal(10,0) DEFAULT NULL, `col17` decimal(10,0) DEFAULT NULL, `col18` blob, `col19` datetime DEFAULT NULL, `col20` double DEFAULT NULL, `col21` decimal(10,0) DEFAULT NULL, `col22` datetime DEFAULT NULL, `col23` decimal(10,0) DEFAULT NULL, `col24` decimal(10,0) DEFAULT NULL, `col25` longtext, `col26` tinyblob, `col27` time DEFAULT NULL, `col28` tinyblob, `col29` enum('test1','test2','test3') DEFAULT NULL, `col30` smallint(6) DEFAULT NULL, `col31` double DEFAULT NULL, `col32` float DEFAULT NULL, `col33` char(175) DEFAULT NULL, `col34` tinytext, `col35` tinytext, `col36` tinyblob, `col37` tinyblob, `col38` tinytext, `col39` mediumblob, `col40` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `col41` double DEFAULT NULL, `col42` smallint(6) DEFAULT NULL, `col43` longblob, `col44` varchar(80) DEFAULT NULL, `col45` mediumtext, `col46` decimal(10,0) DEFAULT NULL, `col47` bigint(20) DEFAULT NULL, `col48` date DEFAULT NULL, `col49` tinyblob, `col50` date DEFAULT NULL, `col51` tinyint(1) DEFAULT NULL, `col52` mediumint(9) DEFAULT NULL, `col53` float DEFAULT NULL, `col54` tinyblob, `col55` longtext, `col56` smallint(6) DEFAULT NULL, `col57` enum('test1','test2','test3') DEFAULT NULL, `col58` datetime DEFAULT NULL, `col59` mediumtext, `col60` varchar(232) DEFAULT NULL, `col61` decimal(10,0) DEFAULT NULL, `col62` year(4) DEFAULT NULL, `col63` smallint(6) DEFAULT NULL, `col64` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col65` blob, `col66` longblob, `col67` int(11) DEFAULT NULL, `col68` longtext, `col69` enum('test1','test2','test3') DEFAULT NULL, `col70` int(11) DEFAULT NULL, `col71` time DEFAULT NULL, `col72` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col73` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col74` varchar(170) DEFAULT NULL, `col75` set('test1','test2','test3') DEFAULT NULL, `col76` tinyblob, `col77` bigint(20) DEFAULT NULL, `col78` decimal(10,0) DEFAULT NULL, `col79` datetime DEFAULT NULL, `col80` year(4) DEFAULT NULL, `col81` decimal(10,0) DEFAULT NULL, `col82` longblob, `col83` text, `col84` char(83) DEFAULT NULL, `col85` decimal(10,0) DEFAULT NULL, `col86` float DEFAULT NULL, `col87` int(11) DEFAULT NULL, `col88` varchar(145) DEFAULT NULL, `col89` date DEFAULT NULL, `col90` decimal(10,0) DEFAULT NULL, `col91` decimal(10,0) DEFAULT NULL, `col92` mediumblob, `col93` time DEFAULT NULL, KEY `idx0` (`col69`,`col90`,`col8`), KEY `idx1` (`col60`), KEY `idx2` (`col60`,`col70`,`col74`), KEY `idx3` (`col22`,`col32`,`col72`,`col30`), KEY `idx4` (`col29`), KEY `idx5` (`col19`,`col45`(143)), KEY `idx6` (`col46`,`col48`,`col5`,`col39`(118)), KEY `idx7` (`col48`,`col61`), KEY `idx8` (`col93`), KEY `idx9` (`col31`), KEY `idx10` (`col30`,`col21`), KEY `idx11` (`col67`), KEY `idx12` (`col44`,`col6`,`col8`,`col38`(226)), KEY `idx13` (`col71`,`col41`,`col15`,`col49`(88)), KEY `idx14` (`col78`), KEY `idx15` (`col63`,`col67`,`col64`), KEY `idx16` (`col17`,`col86`), KEY `idx17` (`col77`,`col56`,`col10`,`col55`(24)), KEY `idx18` (`col62`), KEY `idx19` (`col31`,`col57`,`col56`,`col53`), KEY `idx20` (`col46`), KEY `idx21` (`col83`(54)), KEY `idx22` (`col51`,`col7`(120)), KEY `idx23` (`col7`(163),`col31`,`col71`,`col14`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
|
||||
insert ignore into `table0` set `col23` = 7887371.5084383683, `col24` = 4293854615.6906948000, `col25` = 'vitalist', `col26` = 'widespread', `col27` = '3570490', `col28` = 'habitual', `col30` = -5471, `col31` = 4286985783.6771750000, `col32` = 6354540.9826654866, `col33` = 'defoliation', `col34` = 'logarithms', `col35` = 'tegument\'s', `col36` = 'scouting\'s', `col37` = 'intermittency', `col38` = 'elongates', `col39` = 'prophecies', `col40` = '20560103035939', `col41` = 4292809130.0544143000, `col42` = 22057, `col43` = 'Hess\'s', `col44` = 'bandstand', `col45` = 'phenylketonuria', `col46` = 6338767.4018677324, `col47` = 5310247, `col48` = '12592418', `col49` = 'churchman\'s', `col50` = '32226125', `col51` = -58, `col52` = -6207968, `col53` = 1244839.3255104220, `col54` = 'robotized', `col55` = 'monotonous', `col56` = -26909, `col58` = '20720107023550', `col59` = 'suggestiveness\'s', `col60` = 'gemology', `col61` = 4287800670.2229986000, `col62` = '1944', `col63` = -16827, `col64` = '20700107212324', `col65` = 'Nicolais', `col66` = 'apteryx', `col67` = 6935317, `col68` = 'stroganoff', `col70` = 3316430, `col71` = '3277608', `col72` = '19300511045918', `col73` = '20421201003327', `col74` = 'attenuant', `col75` = '15173', `col76` = 'upstroke\'s', `col77` = 8118987, `col78` = 6791516.2735374002, `col79` = '20780701144624', `col80` = '2134', `col81` = 4290682351.3127537000, `col82` = 'unexplainably', `col83` = 'Storm', `col84` = 'Greyso\'s', `col85` = 4289119212.4306774000, `col86` = 7617575.8796655172, `col87` = -6325335, `col88` = 'fondue\'s', `col89` = '40608940', `col90` = 1659421.8093508712, `col91` = 8346904.6584368423, `col92` = 'reloads', `col93` = '5188366';
|
||||
CHECK TABLE table0 EXTENDED;
|
||||
INSERT IGNORE INTO `table0` SET `col19` = '19940127002709', `col20` = 2383927.9055146948, `col21` = 4293243420.5621204000, `col22` = '20511211123705', `col23` = 4289899778.6573381000, `col24` = 4293449279.0540481000, `col25` = 'emphysemic', `col26` = 'dentally', `col27` = '2347406', `col28` = 'eruct', `col30` = 1222, `col31` = 4294372994.9941406000, `col32` = 4291385574.1173744000, `col33` = 'borrowing\'s', `col34` = 'septics', `col35` = 'ratter\'s', `col36` = 'Kaye', `col37` = 'Florentia', `col38` = 'allium', `col39` = 'barkeep', `col40` = '19510407003441', `col41` = 4293559200.4215522000, `col42` = 22482, `col43` = 'decussate', `col44` = 'Brom\'s', `col45` = 'violated', `col46` = 4925506.4635456400, `col47` = 930549, `col48` = '51296066', `col49` = 'voluminously', `col50` = '29306676', `col51` = -88, `col52` = -2153690, `col53` = 4290250202.1464887000, `col54` = 'expropriation', `col55` = 'Aberdeen\'s', `col56` = 20343, `col58` = '19640415171532', `col59` = 'extern', `col60` = 'Ubana', `col61` = 4290487961.8539081000, `col62` = '2147', `col63` = -24271, `col64` = '20750801194548', `col65` = 'Cunaxa\'s', `col66` = 'pasticcio', `col67` = 2795817, `col68` = 'Indore\'s', `col70` = 6864127, `col71` = '1817832', `col72` = '20540506114211', `col73` = '20040101012300', `col74` = 'rationalized', `col75` = '45522', `col76` = 'indene', `col77` = -6964559, `col78` = 4247535.5266884370, `col79` = '20720416124357', `col80` = '2143', `col81` = 4292060102.4466386000, `col82` = 'striving', `col83` = 'boneblack\'s', `col84` = 'redolent', `col85` = 6489697.9009369183, `col86` = 4287473465.9731131000, `col87` = 7726015, `col88` = 'perplexed', `col89` = '17153791', `col90` = 5478587.1108127078, `col91` = 4287091404.7004304000, `col92` = 'Boulez\'s', `col93` = '2931278';
|
||||
CHECK TABLE table0 EXTENDED;
|
||||
DROP TABLE table0;
|
||||
EVAL SET GLOBAL innodb_file_format=$file_format;
|
||||
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
|
107
mysql-test/suite/innodb_zip/t/innodb_bug52745.test
Normal file
107
mysql-test/suite/innodb_zip/t/innodb_bug52745.test
Normal file
@ -0,0 +1,107 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
let $file_format=`select @@innodb_file_format`;
|
||||
let $file_per_table=`select @@innodb_file_per_table`;
|
||||
SET GLOBAL innodb_file_format='Barracuda';
|
||||
SET GLOBAL innodb_file_per_table=on;
|
||||
|
||||
CREATE TABLE bug52745 (
|
||||
a2 int(10) unsigned DEFAULT NULL,
|
||||
col37 time DEFAULT NULL,
|
||||
col38 char(229) CHARACTER SET utf8 DEFAULT NULL,
|
||||
col39 text,
|
||||
col40 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
col41 int(10) unsigned DEFAULT NULL,
|
||||
col42 varchar(248) CHARACTER SET utf8 DEFAULT NULL,
|
||||
col43 smallint(5) unsigned zerofill DEFAULT NULL,
|
||||
col44 varchar(150) CHARACTER SET utf8 DEFAULT NULL,
|
||||
col45 float unsigned zerofill DEFAULT NULL,
|
||||
col46 binary(1) DEFAULT NULL,
|
||||
col47 tinyint(4) DEFAULT NULL,
|
||||
col48 tinyint(1) DEFAULT NULL,
|
||||
col49 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
col50 binary(1) DEFAULT NULL,
|
||||
col51 double unsigned zerofill DEFAULT NULL,
|
||||
col52 int(10) unsigned DEFAULT NULL,
|
||||
col53 time DEFAULT NULL,
|
||||
col54 double unsigned DEFAULT NULL,
|
||||
col55 time DEFAULT NULL,
|
||||
col56 mediumtext CHARACTER SET latin2,
|
||||
col57 blob,
|
||||
col58 decimal(52,16) unsigned zerofill NOT NULL DEFAULT '000000000000000000000000000000000000.0000000000000000',
|
||||
col59 binary(1) DEFAULT NULL,
|
||||
col60 longblob,
|
||||
col61 time DEFAULT NULL,
|
||||
col62 longtext CHARACTER SET utf8 COLLATE utf8_persian_ci,
|
||||
col63 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
col64 int(10) unsigned DEFAULT NULL,
|
||||
col65 date DEFAULT NULL,
|
||||
col66 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
col67 binary(1) DEFAULT NULL,
|
||||
col68 tinyblob,
|
||||
col69 date DEFAULT NULL,
|
||||
col70 tinyint(3) unsigned zerofill DEFAULT NULL,
|
||||
col71 varchar(44) CHARACTER SET utf8 DEFAULT NULL,
|
||||
col72 datetime DEFAULT NULL,
|
||||
col73 smallint(5) unsigned zerofill DEFAULT NULL,
|
||||
col74 longblob,
|
||||
col75 bit(34) DEFAULT NULL,
|
||||
col76 float unsigned zerofill DEFAULT NULL,
|
||||
col77 year(2) DEFAULT NULL,
|
||||
col78 tinyint(3) unsigned DEFAULT NULL,
|
||||
col79 set('msfheowh','tbpxbgf','by','wahnrjw','myqfasxz','rsokyumrt') CHARACTER SET latin2 DEFAULT NULL,
|
||||
col80 datetime DEFAULT NULL,
|
||||
col81 smallint(6) DEFAULT NULL,
|
||||
col82 enum('xtaurnqfqz','rifrse','kuzwpbvb','niisabk','zxavro','rbvasv','','uulrfaove','','') DEFAULT NULL,
|
||||
col83 bigint(20) unsigned zerofill DEFAULT NULL,
|
||||
col84 float unsigned zerofill DEFAULT NULL,
|
||||
col85 double DEFAULT NULL,
|
||||
col86 enum('ylannv','','vlkhycqc','snke','cxifustp','xiaxaswzp','oxl') CHARACTER SET latin1 COLLATE latin1_german2_ci DEFAULT NULL,
|
||||
col87 varbinary(221) DEFAULT NULL,
|
||||
col88 double unsigned DEFAULT NULL,
|
||||
col89 float unsigned zerofill DEFAULT NULL,
|
||||
col90 tinyblob
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||
|
||||
INSERT INTO bug52745 SET
|
||||
col40='0000-00-00 00:00:00',
|
||||
col51=16547,
|
||||
col53='7711484',
|
||||
col54=-28604,
|
||||
col55='7112612',
|
||||
col56='wakefulness\'',
|
||||
col57=repeat('absorbefacient\'',106),
|
||||
col58=11027,
|
||||
col59='AM09gW7',
|
||||
col60=repeat('Noelani\'',16),
|
||||
col61='2520576',
|
||||
col62='substitutiv',
|
||||
col63='19950106155112',
|
||||
col64=-12038,
|
||||
col65='86238806',
|
||||
col66='19600719080256',
|
||||
col68=repeat('Sagittarius\'',54),
|
||||
col69='38943902',
|
||||
col70=1232,
|
||||
col71='Elora\'',
|
||||
col74=repeat('zipp',11),
|
||||
col75='0',
|
||||
col76=23254,
|
||||
col78=13247,
|
||||
col79='56219',
|
||||
col80='20500609035724',
|
||||
col81=11632,
|
||||
col82=7,
|
||||
col84=-23863,
|
||||
col85=6341,
|
||||
col87='HZdkf.4 s7t,5Rmq 8so fmr,ruGLUG25TrtI.yQ 2SuHq0ML7rw7.4 b2yf2E5TJxOtBBZImezDnzpj,uPYfznnEUDN1e9aQoO 2DsplB7TFWy oQJ br HLF :F,eQ p4i1oWsr lL3PG,hjCz6hYqN h1QTjLCjrv:QCdSzpYBibJAtZCxLOk3l6Blsh.W',
|
||||
col88=16894,
|
||||
col89=6161,
|
||||
col90=repeat('gale',48);
|
||||
|
||||
SHOW WARNINGS;
|
||||
|
||||
DROP TABLE bug52745;
|
||||
|
||||
EVAL SET GLOBAL innodb_file_format=$file_format;
|
||||
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
|
22
mysql-test/suite/innodb_zip/t/innodb_bug53591.test
Normal file
22
mysql-test/suite/innodb_zip/t/innodb_bug53591.test
Normal file
@ -0,0 +1,22 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
let $file_format=`select @@innodb_file_format`;
|
||||
let $file_per_table=`select @@innodb_file_per_table`;
|
||||
|
||||
SET GLOBAL innodb_file_format='Barracuda';
|
||||
SET GLOBAL innodb_file_per_table=on;
|
||||
|
||||
set old_alter_table=0;
|
||||
|
||||
CREATE TABLE bug53591(a text charset utf8 not null)
|
||||
ENGINE=InnoDB KEY_BLOCK_SIZE=1;
|
||||
-- replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid}
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
ALTER TABLE bug53591 ADD PRIMARY KEY(a(220));
|
||||
-- replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid}
|
||||
SHOW WARNINGS;
|
||||
|
||||
DROP TABLE bug53591;
|
||||
|
||||
EVAL SET GLOBAL innodb_file_format=$file_format;
|
||||
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
|
139
mysql-test/suite/innodb_zip/t/innodb_bug56680.test
Normal file
139
mysql-test/suite/innodb_zip/t/innodb_bug56680.test
Normal file
@ -0,0 +1,139 @@
|
||||
--source include/have_innodb.inc
|
||||
#
|
||||
# Bug #56680 InnoDB may return wrong results from a case-insensitive index
|
||||
#
|
||||
-- disable_query_log
|
||||
SET @tx_isolation_orig = @@tx_isolation;
|
||||
SET @innodb_file_per_table_orig = @@innodb_file_per_table;
|
||||
SET @innodb_file_format_orig = @@innodb_file_format;
|
||||
# The flag innodb_change_buffering_debug is only available in debug builds.
|
||||
# It instructs InnoDB to try to evict pages from the buffer pool when
|
||||
# change buffering is possible, so that the change buffer will be used
|
||||
# whenever possible.
|
||||
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
|
||||
SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
|
||||
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
|
||||
SET GLOBAL innodb_change_buffering_debug = 1;
|
||||
-- enable_query_log
|
||||
SET GLOBAL tx_isolation='REPEATABLE-READ';
|
||||
SET GLOBAL innodb_file_format=Barracuda;
|
||||
SET GLOBAL innodb_file_per_table=on;
|
||||
|
||||
CREATE TABLE bug56680(
|
||||
a INT AUTO_INCREMENT PRIMARY KEY,
|
||||
b CHAR(1),
|
||||
c INT,
|
||||
INDEX(b))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO bug56680 VALUES(0,'x',1);
|
||||
BEGIN;
|
||||
SELECT b FROM bug56680;
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
connection con1;
|
||||
BEGIN;
|
||||
UPDATE bug56680 SET b='X';
|
||||
|
||||
connection default;
|
||||
# This should return the last committed value 'x', but would return 'X'
|
||||
# due to a bug in row_search_for_mysql().
|
||||
SELECT b FROM bug56680;
|
||||
# This would always return the last committed value 'x'.
|
||||
SELECT * FROM bug56680;
|
||||
|
||||
connection con1;
|
||||
ROLLBACK;
|
||||
disconnect con1;
|
||||
|
||||
connection default;
|
||||
|
||||
SELECT b FROM bug56680;
|
||||
|
||||
# For the rest of this test, use the READ UNCOMMITTED isolation level
|
||||
# to see what exists in the secondary index.
|
||||
SET GLOBAL tx_isolation='READ-UNCOMMITTED';
|
||||
|
||||
# Create enough rows for the table, so that the insert buffer will be
|
||||
# used for modifying the secondary index page. There must be multiple
|
||||
# index pages, because changes to the root page are never buffered.
|
||||
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
|
||||
|
||||
BEGIN;
|
||||
SELECT b FROM bug56680 LIMIT 2;
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
connection con1;
|
||||
BEGIN;
|
||||
DELETE FROM bug56680 WHERE a=1;
|
||||
# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
|
||||
INSERT INTO bug56680 VALUES(1,'X',1);
|
||||
|
||||
# This should force an insert buffer merge, and return 'X' in the first row.
|
||||
SELECT b FROM bug56680 LIMIT 3;
|
||||
|
||||
connection default;
|
||||
SELECT b FROM bug56680 LIMIT 2;
|
||||
CHECK TABLE bug56680;
|
||||
|
||||
connection con1;
|
||||
ROLLBACK;
|
||||
SELECT b FROM bug56680 LIMIT 2;
|
||||
CHECK TABLE bug56680;
|
||||
|
||||
connection default;
|
||||
disconnect con1;
|
||||
|
||||
SELECT b FROM bug56680 LIMIT 2;
|
||||
|
||||
CREATE TABLE bug56680_2(
|
||||
a INT AUTO_INCREMENT PRIMARY KEY,
|
||||
b VARCHAR(2) CHARSET latin1 COLLATE latin1_german2_ci,
|
||||
c INT,
|
||||
INDEX(b))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO bug56680_2 SELECT 0,_latin1 0xdf,c FROM bug56680;
|
||||
|
||||
BEGIN;
|
||||
SELECT HEX(b) FROM bug56680_2 LIMIT 2;
|
||||
DELETE FROM bug56680_2 WHERE a=1;
|
||||
# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
|
||||
INSERT INTO bug56680_2 VALUES(1,'SS',1);
|
||||
|
||||
# This should force an insert buffer merge, and return 'SS' in the first row.
|
||||
SELECT HEX(b) FROM bug56680_2 LIMIT 3;
|
||||
CHECK TABLE bug56680_2;
|
||||
|
||||
# Test this with compressed tables.
|
||||
ALTER TABLE bug56680_2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||
|
||||
SELECT HEX(b) FROM bug56680_2 LIMIT 2;
|
||||
DELETE FROM bug56680_2 WHERE a=1;
|
||||
# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
|
||||
INSERT INTO bug56680_2 VALUES(1,_latin1 0xdf,1);
|
||||
|
||||
# This should force an insert buffer merge, and return 0xdf in the first row.
|
||||
SELECT HEX(b) FROM bug56680_2 LIMIT 3;
|
||||
CHECK TABLE bug56680_2;
|
||||
|
||||
DROP TABLE bug56680_2;
|
||||
DROP TABLE bug56680;
|
||||
|
||||
-- disable_query_log
|
||||
SET GLOBAL tx_isolation = @tx_isolation_orig;
|
||||
SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig;
|
||||
SET GLOBAL innodb_file_format = @innodb_file_format_orig;
|
||||
-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
|
||||
SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;
|
@ -0,0 +1 @@
|
||||
--innodb-buffer-pool-size=8M
|
59
mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test
Normal file
59
mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test
Normal file
@ -0,0 +1,59 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
let $per_table=`select @@innodb_file_per_table`;
|
||||
let $format=`select @@innodb_file_format`;
|
||||
|
||||
-- let $query_i_s = SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0
|
||||
|
||||
set global innodb_file_per_table=on;
|
||||
set global innodb_file_format=`1`;
|
||||
|
||||
create table t1(a text) engine=innodb key_block_size=8;
|
||||
|
||||
-- disable_query_log
|
||||
|
||||
# insert some rows so we are using compressed pages
|
||||
-- let $i = 10
|
||||
while ($i)
|
||||
{
|
||||
insert into t1 values(repeat('abcdefghijklmnopqrstuvwxyz',100));
|
||||
dec $i;
|
||||
}
|
||||
-- enable_query_log
|
||||
|
||||
# we should be using some 8K pages
|
||||
-- eval $query_i_s
|
||||
|
||||
drop table t1;
|
||||
|
||||
# because of lazy eviction at drop table in 5.5 there should be some
|
||||
# used 8K pages
|
||||
-- eval $query_i_s
|
||||
|
||||
# create a non-compressed table and insert enough into it to evict
|
||||
# compressed pages
|
||||
create table t2(a text) engine=innodb;
|
||||
|
||||
-- disable_query_log
|
||||
|
||||
-- let $i = 400
|
||||
while ($i)
|
||||
{
|
||||
insert into t2 values(repeat('abcdefghijklmnopqrstuvwxyz',1000));
|
||||
dec $i;
|
||||
}
|
||||
|
||||
-- enable_query_log
|
||||
|
||||
# now there should be no 8K pages in the buffer pool
|
||||
-- eval $query_i_s
|
||||
|
||||
drop table t2;
|
||||
|
||||
#
|
||||
# restore environment to the state it was before this test execution
|
||||
#
|
||||
|
||||
-- disable_query_log
|
||||
eval set global innodb_file_format=$format;
|
||||
eval set global innodb_file_per_table=$per_table;
|
438
mysql-test/suite/innodb_zip/t/innodb_index_large_prefix.test
Normal file
438
mysql-test/suite/innodb_zip/t/innodb_index_large_prefix.test
Normal file
@ -0,0 +1,438 @@
|
||||
# Testcase for worklog #5743: Lift the limit of index key prefixes
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_16k.inc
|
||||
SET default_storage_engine=InnoDB;
|
||||
|
||||
let $innodb_file_format_orig=`select @@innodb_file_format`;
|
||||
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
|
||||
let $innodb_large_prefix_orig=`select @@innodb_large_prefix`;
|
||||
|
||||
set global innodb_file_format="Barracuda";
|
||||
set global innodb_file_per_table=1;
|
||||
set global innodb_large_prefix=1;
|
||||
|
||||
-- echo ### Test 1 ###
|
||||
# Create a table of DYNAMIC format, with a primary index of 1000 bytes in
|
||||
# size
|
||||
create table worklog5743(a TEXT not null, primary key (a(1000))) ROW_FORMAT=DYNAMIC;
|
||||
show warnings;
|
||||
|
||||
# Do some insertion and update to excercise the external cache
|
||||
# code path
|
||||
insert into worklog5743 values(repeat("a", 20000));
|
||||
|
||||
# default session, update the table
|
||||
update worklog5743 set a = (repeat("b", 16000));
|
||||
|
||||
# Create a secondary index
|
||||
create index idx on worklog5743(a(2000));
|
||||
show warnings;
|
||||
|
||||
# Start a few sessions to do selections on table being updated in default
|
||||
# session, so it would rebuild the previous version from undo log.
|
||||
# 1) Default session: Initiate an update on the externally stored column
|
||||
# 2) Session con1: Select from table with repeated read
|
||||
# 3) Session con2: Select from table with read uncommitted
|
||||
# 4) Default session: rollback updates
|
||||
|
||||
begin;
|
||||
update worklog5743 set a = (repeat("x", 17000));
|
||||
|
||||
# Start a new session to select the column to force it build
|
||||
# an earlier version of the clustered index through undo log. So it should
|
||||
# just see the result of repeat("b", 16000)
|
||||
select @@session.tx_isolation;
|
||||
--connect (con1,localhost,root,,)
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
select a = repeat("b", 16000) from worklog5743;
|
||||
|
||||
# Start another session doing "read uncommitted" query, it
|
||||
# should see the uncommitted update
|
||||
--connect (con2,localhost,root,,)
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
|
||||
# Roll back the transaction
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743;
|
||||
|
||||
-- echo ### Test 2 ###
|
||||
# Create a table with only a secondary index has large prefix column
|
||||
create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC;
|
||||
show warnings;
|
||||
create index idx on worklog5743(a1, a2(2000));
|
||||
show warnings;
|
||||
|
||||
insert into worklog5743 values(9, repeat("a", 10000));
|
||||
|
||||
begin;
|
||||
|
||||
update worklog5743 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
# Do read uncommitted in another session, it would show there is no
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743;
|
||||
|
||||
-- echo ### Test 3 ###
|
||||
# Create a table with a secondary index has small (50 bytes) prefix column
|
||||
create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC;
|
||||
|
||||
create index idx on worklog5743(a1, a2(50));
|
||||
|
||||
insert into worklog5743 values(9, repeat("a", 10000));
|
||||
|
||||
begin;
|
||||
|
||||
update worklog5743 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
# Do read uncommitted in another session, it would show there is no
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743;
|
||||
|
||||
-- echo ### Test 4 ###
|
||||
# Create compressed tables with each KEY_BLOCK_SIZE.
|
||||
create table worklog5743_1(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=1;
|
||||
create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2;
|
||||
create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4;
|
||||
create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8;
|
||||
create table worklog5743_16(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=16;
|
||||
|
||||
# The maximum overall index record (not prefix) length of a
|
||||
# compressed table is dependent on innodb-page-size (IPS),
|
||||
# key_block_size (KBS) and the number of fields (NF).
|
||||
# "Too big row" error (HA_ERR_TO_BIG_ROW) will be returned if this
|
||||
# limit is exceeded.
|
||||
# See page_zip_empty_size() and Bug #47495 for more detail.
|
||||
|
||||
# Test edge cases for indexes using key_block_size=1
|
||||
set global innodb_large_prefix=0;
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create index idx1 on worklog5743_1(a2(4000));
|
||||
show warnings;
|
||||
set global innodb_large_prefix=1;
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create index idx2 on worklog5743_1(a2(4000));
|
||||
show warnings;
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create index idx3 on worklog5743_1(a2(436));
|
||||
show warnings;
|
||||
# Bug#13391353 Limit is one byte less on on 32bit-Linux only
|
||||
create index idx4 on worklog5743_1(a2(434));
|
||||
show warnings;
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create index idx5 on worklog5743_1(a1, a2(430));
|
||||
show warnings;
|
||||
# Bug#13391353 Limit is one byte less on on 32bit-Linux only
|
||||
create index idx6 on worklog5743_1(a1, a2(428));
|
||||
show warnings;
|
||||
|
||||
# Test edge cases for indexes using key_block_size=2
|
||||
set global innodb_large_prefix=0;
|
||||
create index idx1 on worklog5743_2(a2(4000));
|
||||
show warnings;
|
||||
set global innodb_large_prefix=1;
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create index idx2 on worklog5743_2(a2(4000));
|
||||
show warnings;
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create index idx3 on worklog5743_2(a2(948));
|
||||
show warnings;
|
||||
# Bug#13391353 Limit is one byte less on on 32bit-Linux only
|
||||
create index idx4 on worklog5743_2(a2(946));
|
||||
show warnings;
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create index idx5 on worklog5743_2(a1, a2(942));
|
||||
show warnings;
|
||||
# Bug#13391353 Limit is one byte less on on 32bit-Linux only
|
||||
create index idx6 on worklog5743_2(a1, a2(940));
|
||||
show warnings;
|
||||
|
||||
# Test edge cases for indexes using key_block_size=4
|
||||
set global innodb_large_prefix=0;
|
||||
create index idx1 on worklog5743_4(a2(4000));
|
||||
show warnings;
|
||||
set global innodb_large_prefix=1;
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create index idx2 on worklog5743_4(a2(4000));
|
||||
show warnings;
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create index idx3 on worklog5743_4(a2(1972));
|
||||
show warnings;
|
||||
# Bug#13391353 Limit is one byte less on on 32bit-Linux only
|
||||
create index idx4 on worklog5743_4(a2(1970));
|
||||
show warnings;
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create index idx5 on worklog5743_4(a1, a2(1966));
|
||||
show warnings;
|
||||
# Bug#13391353 Limit is one byte less on on 32bit-Linux only
|
||||
create index idx6 on worklog5743_4(a1, a2(1964));
|
||||
show warnings;
|
||||
|
||||
# Test edge cases for indexes using key_block_size=8
|
||||
set global innodb_large_prefix=0;
|
||||
create index idx1 on worklog5743_8(a2(1000));
|
||||
show warnings;
|
||||
set global innodb_large_prefix=1;
|
||||
create index idx2 on worklog5743_8(a2(3073));
|
||||
show warnings;
|
||||
create index idx3 on worklog5743_8(a2(3072));
|
||||
show warnings;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx4 on worklog5743_8(a1, a2(3069));
|
||||
show warnings;
|
||||
create index idx5 on worklog5743_8(a1, a2(3068));
|
||||
show warnings;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx6 on worklog5743_8(a1, a2(2000), a3(1069));
|
||||
show warnings;
|
||||
create index idx7 on worklog5743_8(a1, a2(2000), a3(1068));
|
||||
show warnings;
|
||||
|
||||
# Test edge cases for indexes using key_block_size=16
|
||||
set global innodb_large_prefix=0;
|
||||
create index idx1 on worklog5743_16(a2(1000));
|
||||
show warnings;
|
||||
set global innodb_large_prefix=1;
|
||||
create index idx2 on worklog5743_16(a2(3073));
|
||||
show warnings;
|
||||
create index idx3 on worklog5743_16(a2(3072));
|
||||
show warnings;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx4 on worklog5743_16(a1, a2(3069));
|
||||
show warnings;
|
||||
create index idx5 on worklog5743_16(a1, a2(3068));
|
||||
show warnings;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx6 on worklog5743_16(a1, a2(2000), a3(1069));
|
||||
show warnings;
|
||||
create index idx7 on worklog5743_16(a1, a2(2000), a3(1068));
|
||||
show warnings;
|
||||
|
||||
# Insert a large record into each of these tables.
|
||||
insert into worklog5743_1 values(9, repeat("a", 10000));
|
||||
insert into worklog5743_2 values(9, repeat("a", 10000));
|
||||
insert into worklog5743_4 values(9, repeat("a", 10000));
|
||||
insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000));
|
||||
insert into worklog5743_16 values(9, repeat("a", 10000), repeat("a", 10000));
|
||||
|
||||
# Now if we change the global innodb_large_prefix back to 767,
|
||||
# updates to these indexes should still be allowed.
|
||||
set global innodb_large_prefix=0;
|
||||
insert into worklog5743_1 values(2, repeat("b", 10000));
|
||||
insert into worklog5743_2 values(2, repeat("b", 10000));
|
||||
insert into worklog5743_4 values(2, repeat("b", 10000));
|
||||
insert into worklog5743_8 values(2, repeat("b", 10000), repeat("b", 10000));
|
||||
insert into worklog5743_16 values(2, repeat("b", 10000), repeat("b", 10000));
|
||||
set global innodb_large_prefix=1;
|
||||
|
||||
select a1, left(a2, 20) from worklog5743_1;
|
||||
select a1, left(a2, 20) from worklog5743_2;
|
||||
select a1, left(a2, 20) from worklog5743_4;
|
||||
select a1, left(a2, 20) from worklog5743_8;
|
||||
select a1, left(a2, 20) from worklog5743_16;
|
||||
|
||||
begin;
|
||||
|
||||
update worklog5743_1 set a1 = 1000;
|
||||
update worklog5743_2 set a1 = 1000;
|
||||
update worklog5743_4 set a1 = 1000;
|
||||
update worklog5743_8 set a1 = 1000;
|
||||
update worklog5743_16 set a1 = 1000;
|
||||
select a1, left(a2, 20) from worklog5743_1;
|
||||
select a1, left(a2, 20) from worklog5743_2;
|
||||
select a1, left(a2, 20) from worklog5743_4;
|
||||
select a1, left(a2, 20) from worklog5743_8;
|
||||
select a1, left(a2, 20) from worklog5743_16;
|
||||
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
|
||||
explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
|
||||
explain select a1, left(a2, 20) from worklog5743_8 where a1 = 9;
|
||||
explain select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_8 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
|
||||
|
||||
# Do read uncommitted in another session, it would show there is no
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_8 where a1 = 9;
|
||||
select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743_1;
|
||||
drop table worklog5743_2;
|
||||
drop table worklog5743_4;
|
||||
drop table worklog5743_8;
|
||||
drop table worklog5743_16;
|
||||
|
||||
-- echo ### Test 5 ###
|
||||
# Create a table with large varchar columns and create indexes
|
||||
# directly on these large columns to show that prefix limit is
|
||||
# automatically applied and to show that limit.
|
||||
create table worklog5743(a1 int,
|
||||
a2 varchar(20000),
|
||||
a3 varchar(3073),
|
||||
a4 varchar(3072),
|
||||
a5 varchar(3069),
|
||||
a6 varchar(3068))
|
||||
ROW_FORMAT=DYNAMIC;
|
||||
create index idx1 on worklog5743(a2);
|
||||
create index idx2 on worklog5743(a3);
|
||||
create index idx3 on worklog5743(a4);
|
||||
show warnings;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx4 on worklog5743(a1, a2);
|
||||
show warnings;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx5 on worklog5743(a1, a5);
|
||||
show warnings;
|
||||
create index idx6 on worklog5743(a1, a6);
|
||||
show warnings;
|
||||
show create table worklog5743;
|
||||
|
||||
insert into worklog5743 values(9,
|
||||
repeat("a", 20000), repeat("a", 3073),
|
||||
repeat("a", 3072), repeat("a", 3069),
|
||||
repeat("a", 3068));
|
||||
|
||||
begin;
|
||||
|
||||
update worklog5743 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
explain select a1 from worklog5743 where a1 = 9;
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
|
||||
# Do read uncommitted, it would show there is no row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743;
|
||||
|
||||
-- echo ### Test 6 ###
|
||||
# Create a table with old format, and the limit is 768 bytes.
|
||||
-- error ER_INDEX_COLUMN_TOO_LONG
|
||||
create table worklog5743(a TEXT not null, primary key (a(1000)));
|
||||
|
||||
create table worklog5743(a TEXT);
|
||||
|
||||
# Excercise the column length check in ha_innobase::add_index()
|
||||
-- error ER_INDEX_COLUMN_TOO_LONG
|
||||
create index idx on worklog5743(a(768));
|
||||
|
||||
# This should be successful
|
||||
create index idx on worklog5743(a(767));
|
||||
|
||||
# Perform some DMLs
|
||||
insert into worklog5743 values(repeat("a", 20000));
|
||||
|
||||
begin;
|
||||
insert into worklog5743 values(repeat("b", 20000));
|
||||
update worklog5743 set a = (repeat("x", 25000));
|
||||
|
||||
# Start a new session to select the table to force it build
|
||||
# an earlier version of the cluster index through undo log
|
||||
select @@session.tx_isolation;
|
||||
--connection con1
|
||||
select a = repeat("a", 20000) from worklog5743;
|
||||
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a = repeat("x", 25000) from worklog5743;
|
||||
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743;
|
||||
|
||||
-- echo ### Test 7 ###
|
||||
# Some border line tests on the column length.
|
||||
# We have a limit of 3072 bytes for Barracuda table
|
||||
create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC;
|
||||
|
||||
# Length exceeds maximum supported key length
|
||||
# It will be auto-truncated to 3072
|
||||
create index idx1 on worklog5743(a(3073));
|
||||
create index idx2 on worklog5743(a(3072));
|
||||
show create table worklog5743;
|
||||
drop table worklog5743;
|
||||
|
||||
# We have a limit of 767 bytes for Antelope tables
|
||||
create table worklog5743(a TEXT not null) ROW_FORMAT=REDUNDANT;
|
||||
-- error ER_INDEX_COLUMN_TOO_LONG
|
||||
create index idx on worklog5743(a(768));
|
||||
create index idx2 on worklog5743(a(767));
|
||||
drop table worklog5743;
|
||||
|
||||
create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT;
|
||||
-- error ER_INDEX_COLUMN_TOO_LONG
|
||||
create index idx on worklog5743(a(768));
|
||||
create index idx2 on worklog5743(a(767));
|
||||
drop table worklog5743;
|
||||
|
||||
|
||||
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
|
||||
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
|
||||
eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
|
||||
--connection con1
|
||||
--disconnect con1
|
||||
--source include/wait_until_disconnected.inc
|
||||
--connection con2
|
||||
--disconnect con2
|
||||
--source include/wait_until_disconnected.inc
|
||||
--connection default
|
||||
|
1392
mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test
Normal file
1392
mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user