mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge InnoDB 5.7 from mysql-5.7.9.
Contains also MDEV-10547: Test multi_update_innodb fails with InnoDB 5.7 The failure happened because 5.7 has changed the signature of the bool handler::primary_key_is_clustered() const virtual function ("const" was added). InnoDB was using the old signature which caused the function not to be used. MDEV-10550: Parallel replication lock waits/deadlock handling does not work with InnoDB 5.7 Fixed mutexing problem on lock_trx_handle_wait. Note that rpl_parallel and rpl_optimistic_parallel tests still fail. MDEV-10156 : Group commit tests fail on 10.2 InnoDB (branch bb-10.2-jan) Reason: incorrect merge MDEV-10550: Parallel replication can't sync with master in InnoDB 5.7 (branch bb-10.2-jan) Reason: incorrect merge
This commit is contained in:
715
mysql-test/suite/innodb_zip/t/16k.test
Normal file
715
mysql-test/suite/innodb_zip/t/16k.test
Normal file
@ -0,0 +1,715 @@
|
||||
# Tests for setting innodb-page-size=16k; default value
|
||||
--source include/big_test.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_16k.inc
|
||||
SET default_storage_engine=InnoDB;
|
||||
|
||||
--disable_query_log
|
||||
let $MYSQLD_DATADIR = `select @@datadir`;
|
||||
let $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
|
||||
|
||||
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
|
||||
# These values can change during the test
|
||||
--enable_query_log
|
||||
|
||||
--echo # Test 1) Show the page size from Information Schema
|
||||
--disable_warnings
|
||||
SELECT variable_value FROM information_schema.global_status
|
||||
WHERE LOWER(variable_name) = 'innodb_page_size';
|
||||
--enable_warnings
|
||||
|
||||
--echo # Test 2) The number of buffer pool pages is dependent upon the page size.
|
||||
--disable_warnings
|
||||
--replace_result 1535 {checked_valid} 1536 {checked_valid}
|
||||
SELECT variable_value FROM information_schema.global_status
|
||||
WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
|
||||
--enable_warnings
|
||||
|
||||
--echo # Test 3) Query some information_shema tables that are dependent upon
|
||||
--echo # the page size.
|
||||
# Show the metadata for tables in schema 'mysql'.
|
||||
# Pulled from innodb-system-table-view.test
|
||||
# The IDs of mysql.innodb_table_stats and mysql.innodb_index_stats are
|
||||
# unpredictable. They depend on whether mtr has created the database for
|
||||
# this test from scratch or is using a previously created database where
|
||||
# those tables have been dropped and recreated. Since we cannot force mtr
|
||||
# to use a freshly created database for this test we do not return the
|
||||
# table or index IDs. We can return the space IS of mysql schema tables
|
||||
# since they are created consistently during bootstrap.
|
||||
SELECT t.name table_name, t.n_cols, t.flag table_flags,
|
||||
i.name index_name, i.page_no root_page, i.type,
|
||||
i.n_fields, i.merge_threshold
|
||||
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
|
||||
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
|
||||
WHERE t.table_id = i.table_id
|
||||
AND t.name LIKE 'mysql%'
|
||||
ORDER BY t.name, i.index_id;
|
||||
|
||||
CREATE TABLE t1 (a INT KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=innodb;
|
||||
CREATE TABLE t2 (a INT KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=innodb;
|
||||
CREATE TABLE t3 (a INT KEY, b TEXT) ROW_FORMAT=COMPRESSED ENGINE=innodb;
|
||||
CREATE TABLE t4 (a INT KEY, b TEXT) ROW_FORMAT=DYNAMIC ENGINE=innodb;
|
||||
|
||||
# Show the metadata for tables in schema 'test'.
|
||||
# Do not return the space ID since this tablespace may have existed before
|
||||
# this test runs. The root page number of each index should be consistent
|
||||
# within a file-per-table tablespace.
|
||||
SELECT t.name table_name, t.n_cols, t.flag table_flags,
|
||||
i.name index_name, i.page_no root_page, i.type,
|
||||
i.n_fields, i.merge_threshold
|
||||
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
|
||||
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
|
||||
WHERE t.table_id = i.table_id
|
||||
AND t.name LIKE 'test%'
|
||||
ORDER BY t.name, i.name;
|
||||
--source suite/innodb/include/show_i_s_tablespaces.inc
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
|
||||
--echo # Test 4) The maximum row size is dependent upon the page size.
|
||||
--echo # Redundant: 8123, Compact: 8126.
|
||||
--echo # Compressed: 8126, Dynamic: 8126.
|
||||
--echo # Each row format has its own amount of overhead that
|
||||
--echo # varies depending on number of fields and other overhead.
|
||||
|
||||
SET SESSION innodb_strict_mode = ON;
|
||||
|
||||
# Redundant table; 8011 bytes with 40 char fields
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
|
||||
c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
|
||||
c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
|
||||
c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
|
||||
c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(211)
|
||||
) ROW_FORMAT=redundant;
|
||||
DROP TABLE t1;
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
|
||||
c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
|
||||
c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
|
||||
c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
|
||||
c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(212)
|
||||
) ROW_FORMAT=redundant;
|
||||
|
||||
# Compact table; 8096 bytes with 40 CHAR fields
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
|
||||
c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
|
||||
c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
|
||||
c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
|
||||
c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246)
|
||||
) ROW_FORMAT=compact;
|
||||
DROP TABLE t1;
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
|
||||
c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
|
||||
c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
|
||||
c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
|
||||
c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247)
|
||||
) ROW_FORMAT=compact;
|
||||
|
||||
# Compressed table; 7959 bytes with 40 CHAR fields
|
||||
# Bug#13391353 Limit is 7957 on 32-Linux only
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
|
||||
c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
|
||||
c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
|
||||
c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
|
||||
c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(157)
|
||||
) ROW_FORMAT=compressed;
|
||||
DROP TABLE t1;
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
|
||||
c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
|
||||
c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
|
||||
c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
|
||||
c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(160)
|
||||
) ROW_FORMAT=compressed;
|
||||
|
||||
# Dynamic table; 8096 bytes with 40 CHAR fields
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
|
||||
c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
|
||||
c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
|
||||
c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
|
||||
c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246)
|
||||
) ROW_FORMAT=dynamic;
|
||||
DROP TABLE t1;
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
|
||||
c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
|
||||
c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
|
||||
c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
|
||||
c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247)
|
||||
) ROW_FORMAT=dynamic;
|
||||
|
||||
#
|
||||
# Test the maximum key length
|
||||
# Moved from innodb-index.test since each page size has its own max key length.
|
||||
# Max Key Length is 3072 for 16k pages.
|
||||
# Max key Part length is 767
|
||||
# InnoDB assumes 3 bytes for each UTF8 character.
|
||||
#
|
||||
CREATE TABLE t1 (a varchar(255) character set utf8,
|
||||
b varchar(255) character set utf8,
|
||||
c varchar(255) character set utf8,
|
||||
d varchar(255) character set utf8,
|
||||
e varchar(4) character set utf8,
|
||||
PRIMARY KEY (a,b,c,d,e))
|
||||
ENGINE=innodb;
|
||||
DROP TABLE t1;
|
||||
--error ER_TOO_LONG_KEY
|
||||
CREATE TABLE t1 (a varchar(255) character set utf8,
|
||||
b varchar(255) character set utf8,
|
||||
c varchar(255) character set utf8,
|
||||
d varchar(255) character set utf8,
|
||||
e varchar(5) character set utf8,
|
||||
PRIMARY KEY (a,b,c,d,e))
|
||||
ENGINE=innodb;
|
||||
CREATE TABLE t1 (a varchar(255) character set utf8,
|
||||
b varchar(255) character set utf8,
|
||||
c varchar(255) character set utf8,
|
||||
d varchar(255) character set utf8,
|
||||
e varchar(255) character set utf8,
|
||||
f varchar(4) character set utf8,
|
||||
PRIMARY KEY (a), KEY (b,c,d,e,f))
|
||||
ENGINE=innodb;
|
||||
DROP TABLE t1;
|
||||
--error ER_TOO_LONG_KEY
|
||||
CREATE TABLE t1 (a varchar(255) character set utf8,
|
||||
b varchar(255) character set utf8,
|
||||
c varchar(255) character set utf8,
|
||||
d varchar(255) character set utf8,
|
||||
e varchar(255) character set utf8,
|
||||
f varchar(5) character set utf8,
|
||||
PRIMARY KEY (a), KEY (b,c,d,e,f))
|
||||
ENGINE=innodb;
|
||||
|
||||
--echo # Test 5) Make sure that KEY_BLOCK_SIZE=16, 8, 4, 2 & 1
|
||||
--echo # are all accepted.
|
||||
|
||||
SET SESSION innodb_strict_mode = ON;
|
||||
|
||||
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=8;
|
||||
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';
|
||||
|
||||
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 KEY_BLOCK_SIZE=1;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
DROP TABLE t1;
|
||||
|
||||
SET SESSION innodb_strict_mode = OFF;
|
||||
|
||||
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=8;
|
||||
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';
|
||||
|
||||
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 KEY_BLOCK_SIZE=1;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo # Test 6) Make sure that KEY_BLOCK_SIZE = 8 and 16
|
||||
--echo # are rejected when innodb_file_per_table=OFF
|
||||
# Moved from innodb-zip.test
|
||||
SET SESSION innodb_strict_mode = ON;
|
||||
SET GLOBAL innodb_file_per_table = OFF;
|
||||
SHOW VARIABLES LIKE 'innodb_file_per_table';
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
|
||||
SHOW WARNINGS;
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
|
||||
SHOW WARNINGS;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
SET GLOBAL innodb_file_format = `Antelope`;
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
|
||||
SHOW WARNINGS;
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
|
||||
SHOW WARNINGS;
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
|
||||
|
||||
--echo # Test 7) This series of tests were moved from innodb-index to here
|
||||
--echo # because the second alter table t1 assumes a 16k page size.
|
||||
--echo # Moving the test allows the rest of innodb-index to be run on all
|
||||
--echo # page sizes. The previously disabled portions of this test were
|
||||
--echo # moved as well.
|
||||
|
||||
CREATE TABLE t2(d varchar(17) PRIMARY KEY) ENGINE=innodb DEFAULT CHARSET=utf8;
|
||||
CREATE TABLE t3(a int PRIMARY KEY) ENGINE=innodb;
|
||||
|
||||
INSERT INTO t3 VALUES (22),(44),(33),(55),(66);
|
||||
|
||||
INSERT INTO t2 VALUES ('jejdkrun87'),('adfd72nh9k'),
|
||||
('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
|
||||
|
||||
CREATE TABLE t1(a int, b blob, c text, d text NOT NULL)
|
||||
ENGINE=innodb DEFAULT CHARSET=utf8 STATS_PERSISTENT=0;
|
||||
|
||||
INSERT INTO t1
|
||||
SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3 order by a, d;
|
||||
DROP TABLE t2, t3;
|
||||
SELECT COUNT(*) FROM t1 WHERE a=44;
|
||||
SELECT a,
|
||||
LENGTH(b),b=LEFT(REPEAT(d,100*a),65535),LENGTH(c),c=REPEAT(d,20*a),d FROM t1
|
||||
ORDER BY 1, 2, 3, 4, 5, 6;
|
||||
# in-place alter table should trigger ER_PRIMARY_CANT_HAVE_NULL
|
||||
--error ER_DUP_ENTRY
|
||||
ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20));
|
||||
DELETE FROM t1 WHERE d='null';
|
||||
--error ER_DUP_ENTRY
|
||||
ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20));
|
||||
DELETE FROM t1 WHERE a%2;
|
||||
CHECK TABLE t1;
|
||||
# NULL -> NOT NULL only allowed INPLACE if strict sql_mode is on.
|
||||
# And adding a PRIMARY KEY will also add NOT NULL implicitly!
|
||||
ALTER TABLE t1 ADD PRIMARY KEY (a,b(255),c(255)), ADD KEY (b(767));
|
||||
SELECT COUNT(*) FROM t1 WHERE a=44;
|
||||
SELECT a,
|
||||
LENGTH(b), b=LEFT(REPEAT(d,100*a), 65535),LENGTH(c), c=REPEAT(d,20*a), d FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
CHECK TABLE t1;
|
||||
EXPLAIN SELECT * FROM t1 WHERE b LIKE 'adfd%';
|
||||
|
||||
# The following tests are disabled because of the introduced timeouts for
|
||||
# metadata locks at the MySQL level as part of the fix for
|
||||
# Bug#45225 Locking: hang if drop table with no timeout
|
||||
# The following commands now play with MySQL metadata locks instead of
|
||||
# InnoDB locks
|
||||
# start disabled45225_1
|
||||
##
|
||||
## Test locking
|
||||
##
|
||||
#
|
||||
#CREATE TABLE t2(a int, b varchar(255), PRIMARY KEY(a,b)) ENGINE=innodb;
|
||||
#INSERT INTO t2 SELECT a,LEFT(b,255) FROM t1;
|
||||
#DROP TABLE t1;
|
||||
#RENAME TABLE t2 to t1;
|
||||
#
|
||||
#connect (a,localhost,root,,);
|
||||
#connect (b,localhost,root,,);
|
||||
#connection a;
|
||||
#SET innodb_lock_wait_timeout=1;
|
||||
#begin;
|
||||
## Obtain an IX lock on the table
|
||||
#SELECT a FROM t1 limit 1 FOR UPDATE;
|
||||
#connection b;
|
||||
#SET innodb_lock_wait_timeout=1;
|
||||
## This would require an S lock on the table, conflicting with the IX lock.
|
||||
#--error ER_LOCK_WAIT_TIMEOUT
|
||||
#CREATE INDEX t1ba ON t1 (b,a);
|
||||
#connection a;
|
||||
#commit;
|
||||
#begin;
|
||||
## Obtain an IS lock on the table
|
||||
#SELECT a FROM t1 limit 1 lock in share mode;
|
||||
#connection b;
|
||||
## This will require an S lock on the table. No conflict with the IS lock.
|
||||
#CREATE INDEX t1ba ON t1 (b,a);
|
||||
## This would require an X lock on the table, conflicting with the IS lock.
|
||||
#--error ER_LOCK_WAIT_TIMEOUT
|
||||
#DROP INDEX t1ba ON t1;
|
||||
#connection a;
|
||||
#commit;
|
||||
#EXPLAIN SELECT a FROM t1 ORDER BY b;
|
||||
#--send
|
||||
#SELECT a,sleep(2+a/100) FROM t1 ORDER BY b limit 3;
|
||||
#
|
||||
## The following DROP INDEX will succeed, altough the SELECT above has
|
||||
## opened a read view. However, during the execution of the SELECT,
|
||||
## MySQL should hold a table lock that should block the execution
|
||||
## of the DROP INDEX below.
|
||||
#
|
||||
#connection b;
|
||||
#SELECT sleep(1);
|
||||
#DROP INDEX t1ba ON t1;
|
||||
#
|
||||
## After the index was dropped, subsequent SELECTs will use the same
|
||||
## read view, but they should not be accessing the dropped index any more.
|
||||
#
|
||||
#connection a;
|
||||
#reap;
|
||||
#EXPLAIN SELECT a FROM t1 ORDER BY b;
|
||||
#SELECT a FROM t1 ORDER BY b limit 3;
|
||||
#commit;
|
||||
#
|
||||
#connection default;
|
||||
#disconnect a;
|
||||
#disconnect b;
|
||||
#
|
||||
# end disabled45225_1
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # Test 8) Test creating a table that could lead to undo log overflow.
|
||||
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
|
||||
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
|
||||
o blob,p blob,q blob,r blob,s blob,t blob,u blob)
|
||||
ENGINE=InnoDB ROW_FORMAT=dynamic;
|
||||
SET @a = repeat('a', 767);
|
||||
SET @b = repeat('b', 767);
|
||||
SET @c = repeat('c', 767);
|
||||
SET @d = repeat('d', 767);
|
||||
SET @e = repeat('e', 767);
|
||||
|
||||
# With no indexes defined, we can update all columns to max key part length.
|
||||
INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
|
||||
UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
|
||||
k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b;
|
||||
|
||||
# With this many indexes defined, we can still update all fields.
|
||||
CREATE INDEX t1a ON t1 (a(767));
|
||||
CREATE INDEX t1b ON t1 (b(767));
|
||||
CREATE INDEX t1c ON t1 (c(767));
|
||||
CREATE INDEX t1d ON t1 (d(767));
|
||||
CREATE INDEX t1e ON t1 (e(767));
|
||||
UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
|
||||
k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c;
|
||||
|
||||
# Add one more index and the UNDO record becomes too big to update all columns.
|
||||
# But a single transaction can update the columns in separate statements.
|
||||
# because the UNDO records will be smaller.
|
||||
CREATE INDEX t1f ON t1 (f(767));
|
||||
--error ER_UNDO_RECORD_TOO_BIG
|
||||
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
|
||||
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
|
||||
BEGIN;
|
||||
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
|
||||
UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d,k=@d,l=@d,m=@d,
|
||||
n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
|
||||
COMMIT;
|
||||
|
||||
# More indexes can still be added and a single field can still be updated
|
||||
CREATE INDEX t1g ON t1 (g(767));
|
||||
UPDATE t1 SET g=@e;
|
||||
CREATE INDEX t1h ON t1 (h(767));
|
||||
UPDATE t1 SET h=@e;
|
||||
CREATE INDEX t1i ON t1 (i(767));
|
||||
UPDATE t1 SET i=@e;
|
||||
CREATE INDEX t1j ON t1 (j(767));
|
||||
UPDATE t1 SET j=@e;
|
||||
CREATE INDEX t1k ON t1 (k(767));
|
||||
UPDATE t1 SET k=@e;
|
||||
CREATE INDEX t1l ON t1 (l(767));
|
||||
UPDATE t1 SET l=@e;
|
||||
CREATE INDEX t1m ON t1 (m(767));
|
||||
UPDATE t1 SET m=@e;
|
||||
CREATE INDEX t1n ON t1 (n(767));
|
||||
UPDATE t1 SET n=@e;
|
||||
CREATE INDEX t1o ON t1 (o(767));
|
||||
UPDATE t1 SET o=@e;
|
||||
CREATE INDEX t1p ON t1 (p(767));
|
||||
UPDATE t1 SET p=@e;
|
||||
CREATE INDEX t1q ON t1 (q(767));
|
||||
UPDATE t1 SET q=@e;
|
||||
CREATE INDEX t1r ON t1 (r(767));
|
||||
UPDATE t1 SET r=@e;
|
||||
CREATE INDEX t1s ON t1 (s(767));
|
||||
UPDATE t1 SET s=@e;
|
||||
|
||||
# Add one more index and we cannot update a column to its defined index length.
|
||||
# This is a problem. It means that the DDL is allowed to create a table
|
||||
# that CANNOT be updated. See bug#12953735.
|
||||
CREATE INDEX t1t ON t1 (t(767));
|
||||
--error ER_UNDO_RECORD_TOO_BIG
|
||||
UPDATE t1 SET t=@e;
|
||||
|
||||
CREATE INDEX t1u ON t1 (u(767));
|
||||
CREATE INDEX t1ut ON t1 (u(767), t(767));
|
||||
CREATE INDEX t1st ON t1 (s(767), t(767));
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # Bug #12429576 - Test an assertion failure on purge.
|
||||
# This test is not in innodb_8k or innodb_4k since the bug is not about
|
||||
# page size. It just tests the condition that caused the assertion.
|
||||
CREATE TABLE t1_purge (
|
||||
A int,
|
||||
B blob, C blob, D blob, E blob,
|
||||
F blob, G blob, H blob,
|
||||
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
|
||||
INDEX (A)
|
||||
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
|
||||
INSERT INTO t1_purge VALUES (1,
|
||||
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
|
||||
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
|
||||
|
||||
CREATE TABLE t2_purge (
|
||||
A int PRIMARY KEY,
|
||||
B blob, C blob, D blob, E blob,
|
||||
F blob, G blob, H blob, I blob,
|
||||
J blob, K blob, L blob,
|
||||
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
|
||||
INSERT INTO t2_purge VALUES (1,
|
||||
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
|
||||
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
|
||||
REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
|
||||
|
||||
CREATE TABLE t3_purge (
|
||||
A int,
|
||||
B varchar(800), C varchar(800), D varchar(800), E varchar(800),
|
||||
F varchar(800), G varchar(800), H varchar(800),
|
||||
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
|
||||
INDEX (A)
|
||||
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
|
||||
INSERT INTO t3_purge SELECT * FROM t1_purge;
|
||||
|
||||
CREATE TABLE t4_purge (
|
||||
A int PRIMARY KEY,
|
||||
B varchar(800), C varchar(800), D varchar(800), E varchar(800),
|
||||
F varchar(800), G varchar(800), H varchar(800), I varchar(800),
|
||||
J varchar(800), K varchar(800), L varchar(800),
|
||||
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
|
||||
INSERT INTO t4_purge SELECT * FROM t2_purge;
|
||||
|
||||
# This would trigger the failure (Bug #12429576)
|
||||
# if purge gets a chance to run before DROP TABLE t1_purge, ....
|
||||
DELETE FROM t1_purge;
|
||||
DELETE FROM t2_purge;
|
||||
DELETE FROM t3_purge;
|
||||
DELETE FROM t4_purge;
|
||||
# We need to activate the purge thread.
|
||||
# Instead of doing a --sleep 10 now, do it once at the end.
|
||||
|
||||
# Bug#12637786 - Assertion hit; ut_ad(dict_index_is_clust(index));
|
||||
# A secondary index tuple is found to be too long to fit into a page.
|
||||
# This test is not in innodb_8k or innodb_4k since the bug is not about
|
||||
# page size. It just tests the condition that caused the assertion.
|
||||
SET @r=REPEAT('a',500);
|
||||
CREATE TABLE t12637786(a int,
|
||||
v1 varchar(500), v2 varchar(500), v3 varchar(500),
|
||||
v4 varchar(500), v5 varchar(500), v6 varchar(500),
|
||||
v7 varchar(500), v8 varchar(500), v9 varchar(500),
|
||||
v10 varchar(500), v11 varchar(500), v12 varchar(500),
|
||||
v13 varchar(500), v14 varchar(500), v15 varchar(500),
|
||||
v16 varchar(500), v17 varchar(500), v18 varchar(500)
|
||||
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
CREATE INDEX idx1 ON t12637786(a,v1);
|
||||
INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
UPDATE t12637786 SET a=1000;
|
||||
DELETE FROM t12637786;
|
||||
# We need to activate the purge thread to make sure it does not assert and
|
||||
# is able to clean up the old versions of secondary index entries.
|
||||
# Instead of doing a --sleep 10 now for each test, do it once at the end.
|
||||
|
||||
--echo # Bug#12963823 - Test that the purge thread does not crash when
|
||||
# the number of indexes has changed since the UNDO record was logged.
|
||||
# This test is not in innodb_8k or innodb_4k since the bug is not about
|
||||
# page size. It just tests the condition that caused the crash.
|
||||
CREATE TABLE t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
|
||||
i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
|
||||
ENGINE=innodb ROW_FORMAT=dynamic;
|
||||
SET @r = REPEAT('a', 767);
|
||||
INSERT INTO t12963823 VALUES (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
|
||||
CREATE INDEX ndx_a ON t12963823 (a(500));
|
||||
CREATE INDEX ndx_b ON t12963823 (b(500));
|
||||
CREATE INDEX ndx_c ON t12963823 (c(500));
|
||||
CREATE INDEX ndx_d ON t12963823 (d(500));
|
||||
CREATE INDEX ndx_e ON t12963823 (e(500));
|
||||
CREATE INDEX ndx_f ON t12963823 (f(500));
|
||||
CREATE INDEX ndx_k ON t12963823 (k(500));
|
||||
CREATE INDEX ndx_l ON t12963823 (l(500));
|
||||
|
||||
SET @r = REPEAT('b', 500);
|
||||
UPDATE t12963823 set a=@r,b=@r,c=@r,d=@r;
|
||||
UPDATE t12963823 set e=@r,f=@r,g=@r,h=@r;
|
||||
UPDATE t12963823 set i=@r,j=@r,k=@r,l=@r;
|
||||
UPDATE t12963823 set m=@r,n=@r,o=@r,p=@r;
|
||||
ALTER TABLE t12963823 DROP INDEX ndx_a;
|
||||
ALTER TABLE t12963823 DROP INDEX ndx_b;
|
||||
CREATE INDEX ndx_g ON t12963823 (g(500));
|
||||
CREATE INDEX ndx_h ON t12963823 (h(500));
|
||||
CREATE INDEX ndx_i ON t12963823 (i(500));
|
||||
CREATE INDEX ndx_j ON t12963823 (j(500));
|
||||
CREATE INDEX ndx_m ON t12963823 (m(500));
|
||||
CREATE INDEX ndx_n ON t12963823 (n(500));
|
||||
CREATE INDEX ndx_o ON t12963823 (o(500));
|
||||
CREATE INDEX ndx_p ON t12963823 (p(500));
|
||||
SHOW CREATE TABLE t12963823;
|
||||
# We need to activate the purge thread at this point to see if it crashes.
|
||||
# Instead of doing a --sleep 10 now for each test, do it once at the end.
|
||||
|
||||
--echo # Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
|
||||
# InnoDB cannot know that this undo record would be too big for the undo
|
||||
# page. Too much of text field is stored in the clustered record in this
|
||||
# DYNAMIC row formatted record.
|
||||
# This test is not in innodb_8k or innodb_4k since the bug is not about
|
||||
# page size. It just tests the condition that caused the hang.
|
||||
|
||||
SET SESSION innodb_strict_mode = ON;
|
||||
CREATE TABLE bug12547647(
|
||||
a int NOT NULL, b blob NOT NULL, c text,
|
||||
PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
|
||||
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
INSERT INTO bug12547647 VALUES (5,REPEAT('khdfo5AlOq',1900),REPEAT('g',7751));
|
||||
COMMIT;
|
||||
# The following used to cause a hang while doing infinite undo log allocation.
|
||||
--error ER_UNDO_RECORD_TOO_BIG
|
||||
UPDATE bug12547647 SET c = REPEAT('b',16928);
|
||||
SHOW WARNINGS;
|
||||
DROP TABLE bug12547647;
|
||||
|
||||
# The following should fail in non-strict mode too.
|
||||
# (The fix of Bug #50945 only affects REDUNDANT and COMPACT tables.)
|
||||
SET SESSION innodb_strict_mode = off;
|
||||
CREATE TABLE t1(
|
||||
c text NOT NULL, d text NOT NULL,
|
||||
PRIMARY KEY (c(767),d(767)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(
|
||||
c text NOT NULL, d text NOT NULL,
|
||||
PRIMARY KEY (c(767),d(767)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(
|
||||
c text NOT NULL, d text NOT NULL,
|
||||
PRIMARY KEY (c(767),d(767)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
|
||||
drop table t1;
|
||||
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
|
||||
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#56862 Execution of a query that uses index merge returns a wrong result
|
||||
--echo #
|
||||
|
||||
# Moved to here from innodb_mysql.test. Some PB3 systems sporadically
|
||||
# had timeouts doing this with smaller page sizes.
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk int NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
a int,
|
||||
b int,
|
||||
INDEX idx(a))
|
||||
ENGINE=INNODB;
|
||||
|
||||
INSERT INTO t1(a,b) VALUES
|
||||
(11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
|
||||
(3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
|
||||
(6, 600), (18, 1800), (9, 900), (10, 1000), (7, 700),
|
||||
(13, 1300), (15, 1500), (19, 1900), (16, 1600), (20, 2000);
|
||||
INSERT INTO t1(a,b) SELECT a+20, b+2000 FROM t1;
|
||||
INSERT INTO t1(a,b) SELECT a+40, b+4000 FROM t1;
|
||||
INSERT INTO t1(a,b) SELECT a+80, b+8000 FROM t1;
|
||||
INSERT INTO t1(a,b) SELECT a,b FROM t1;
|
||||
INSERT INTO t1(a,b) SELECT a,b FROM t1;
|
||||
INSERT INTO t1(a,b) SELECT a,b FROM t1;
|
||||
INSERT INTO t1(a,b) SELECT a,b FROM t1;
|
||||
INSERT INTO t1(a,b) SELECT a,b FROM t1;
|
||||
INSERT INTO t1(a,b) SELECT a,b FROM t1;
|
||||
INSERT INTO t1(a,b) SELECT a,b FROM t1;
|
||||
INSERT INTO t1(a,b) SELECT a,b FROM t1;
|
||||
INSERT INTO t1 VALUES (1000000, 0, 0);
|
||||
|
||||
set @optimizer_switch_saved=@@optimizer_switch;
|
||||
SET SESSION optimizer_switch='derived_merge=off';
|
||||
SET SESSION sort_buffer_size = 1024*36;
|
||||
|
||||
EXPLAIN
|
||||
SELECT COUNT(*) FROM
|
||||
(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
|
||||
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
|
||||
|
||||
SELECT COUNT(*) FROM
|
||||
(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
|
||||
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
|
||||
|
||||
set @@optimizer_switch=@optimizer_switch_saved;
|
||||
SET SESSION sort_buffer_size = DEFAULT;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
# The tests that uses these tables required the purge thread to run.
|
||||
# Just in case it has not by now, provide a 10 second wait.
|
||||
--sleep 10
|
||||
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
|
||||
DROP TABLE t12637786;
|
||||
DROP TABLE t12963823;
|
440
mysql-test/suite/innodb_zip/t/4k.test
Normal file
440
mysql-test/suite/innodb_zip/t/4k.test
Normal file
@ -0,0 +1,440 @@
|
||||
# Tests for setting innodb-page-size=4k
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_4k.inc
|
||||
SET default_storage_engine=InnoDB;
|
||||
|
||||
--disable_query_log
|
||||
let $MYSQLD_DATADIR = `select @@datadir`;
|
||||
let $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
|
||||
|
||||
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
|
||||
--enable_query_log
|
||||
|
||||
--echo # Test 1) Show the page size from Information Schema
|
||||
--disable_warnings
|
||||
SELECT variable_value FROM information_schema.global_status
|
||||
WHERE LOWER(variable_name) = 'innodb_page_size';
|
||||
--enable_warnings
|
||||
|
||||
--echo # Test 2) The number of buffer pool pages is dependent upon the page size.
|
||||
--disable_warnings
|
||||
--replace_result 6144 {checked_valid}
|
||||
SELECT variable_value FROM information_schema.global_status
|
||||
WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
|
||||
--enable_warnings
|
||||
|
||||
--echo # Test 3) Query some information_shema tables that are dependent upon
|
||||
--echo # the page size.
|
||||
# Show the metadata for tables in schema 'mysql'.
|
||||
# Pulled from innodb-system-table-view.test
|
||||
# The IDs of mysql.innodb_table_stats and mysql.innodb_index_stats are
|
||||
# unpredictable. They depend on whether mtr has created the database for
|
||||
# this test from scratch or is using a previously created database where
|
||||
# those tables have been dropped and recreated. Since we cannot force mtr
|
||||
# to use a freshly created database for this test we do not return the
|
||||
# table or index IDs. We can return the space IS of mysql schema tables
|
||||
# since they are created consistently during bootstrap.
|
||||
SELECT t.name table_name, t.n_cols, t.flag table_flags,
|
||||
i.name index_name, i.page_no root_page, i.type,
|
||||
i.n_fields, i.merge_threshold
|
||||
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
|
||||
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
|
||||
WHERE t.table_id = i.table_id
|
||||
AND t.name LIKE 'mysql%'
|
||||
ORDER BY t.name, i.index_id;
|
||||
|
||||
CREATE TABLE t1 (a INT KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=innodb;
|
||||
CREATE TABLE t2 (a INT KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=innodb;
|
||||
CREATE TABLE t3 (a INT KEY, b TEXT) ROW_FORMAT=COMPRESSED ENGINE=innodb;
|
||||
CREATE TABLE t4 (a INT KEY, b TEXT) ROW_FORMAT=DYNAMIC ENGINE=innodb;
|
||||
|
||||
# Show the metadata for tables in schema 'test'.
|
||||
# Do not return the space ID since this tablespace may have existed before
|
||||
# this test runs. The root page number of each index should be consistent
|
||||
# within a file-per-table tablespace.
|
||||
SELECT t.name table_name, t.n_cols, t.flag table_flags,
|
||||
i.name index_name, i.page_no root_page, i.type,
|
||||
i.n_fields, i.merge_threshold
|
||||
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
|
||||
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
|
||||
WHERE t.table_id = i.table_id
|
||||
AND t.name LIKE 'test%'
|
||||
ORDER BY t.name, i.name;
|
||||
--source suite/innodb/include/show_i_s_tablespaces.inc
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
|
||||
--echo # Test 4) The maximum row size is dependent upon the page size.
|
||||
--echo # Redundant: 1979, Compact: 1982.
|
||||
--echo # Compressed: 1982, Dynamic: 1982.
|
||||
--echo # Each row format has its own amount of overhead that
|
||||
--echo # varies depending on number of fields and other overhead.
|
||||
|
||||
SET SESSION innodb_strict_mode = ON;
|
||||
|
||||
# Redundant table; 1927 bytes with 10 CHAR fields
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(127)
|
||||
) ROW_FORMAT=redundant;
|
||||
DROP TABLE t1;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(128)
|
||||
) ROW_FORMAT=redundant;
|
||||
|
||||
# Compact table; 1955 bytes with 10 CHAR fields
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(155)
|
||||
) ROW_FORMAT=compact;
|
||||
DROP TABLE t1;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(156)
|
||||
) ROW_FORMAT=compact;
|
||||
|
||||
# Compressed table; 1878 bytes with 10 CHAR fields
|
||||
# Bug#13391353 Limit is 1876 on 32-Linux only
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(76)
|
||||
) ROW_FORMAT=compressed;
|
||||
DROP TABLE t1;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(79)
|
||||
) ROW_FORMAT=compressed;
|
||||
|
||||
# Dynamic table; 1955 bytes with 10 CHAR fields
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(155)
|
||||
) ROW_FORMAT=dynamic;
|
||||
DROP TABLE t1;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(156)
|
||||
) ROW_FORMAT=dynamic;
|
||||
|
||||
#
|
||||
# Test the maximum key length
|
||||
# Moved from innodb-index.test since each page size has its own max key length.
|
||||
# Max Key Length is 768 for 4k pages.
|
||||
#
|
||||
# InnoDB assumes 3 bytes for each UTF8 character.
|
||||
#
|
||||
CREATE TABLE t1 (a varchar(64) character set utf8,
|
||||
b varchar(64) character set utf8,
|
||||
c varchar(64) character set utf8,
|
||||
d varchar(64) character set utf8,
|
||||
PRIMARY KEY (a,b,c,d))
|
||||
ENGINE=innodb;
|
||||
DROP TABLE t1;
|
||||
--error ER_TOO_LONG_KEY
|
||||
CREATE TABLE t1 (a varchar(64) character set utf8,
|
||||
b varchar(64) character set utf8,
|
||||
c varchar(64) character set utf8,
|
||||
d varchar(65) character set utf8,
|
||||
PRIMARY KEY (a,b,c,d))
|
||||
ENGINE=innodb;
|
||||
CREATE TABLE t1 (a varchar(64) character set utf8,
|
||||
b varchar(64) character set utf8,
|
||||
c varchar(64) character set utf8,
|
||||
d varchar(64) character set utf8,
|
||||
e varchar(64) character set utf8,
|
||||
PRIMARY KEY (a), KEY (b,c,d,e))
|
||||
ENGINE=innodb;
|
||||
DROP TABLE t1;
|
||||
--error ER_TOO_LONG_KEY
|
||||
CREATE TABLE t1 (a varchar(64) character set utf8,
|
||||
b varchar(64) character set utf8,
|
||||
c varchar(64) character set utf8,
|
||||
d varchar(64) character set utf8,
|
||||
e varchar(65) character set utf8,
|
||||
PRIMARY KEY (a), KEY (b,c,d,e))
|
||||
ENGINE=innodb;
|
||||
|
||||
--echo # Test 5) Make sure that KEY_BLOCK_SIZE=4, 2 & 1 are all
|
||||
--echo # accepted and that KEY_BLOCK_SIZE=16 & 8 are rejected
|
||||
--echo # in strict mode and converted to 4 in non-strict mode.
|
||||
|
||||
SET SESSION innodb_strict_mode = ON;
|
||||
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
|
||||
SHOW WARNINGS;
|
||||
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
|
||||
SHOW WARNINGS;
|
||||
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
|
||||
SHOW WARNINGS;
|
||||
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 KEY_BLOCK_SIZE=1;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
DROP TABLE t1;
|
||||
|
||||
SET SESSION innodb_strict_mode = OFF;
|
||||
|
||||
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
|
||||
SHOW WARNINGS;
|
||||
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 KEY_BLOCK_SIZE=1;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo # Test 6) Make sure that KEY_BLOCK_SIZE = 8 and 16
|
||||
--echo # are both rejected when innodb_file_per_table=OFF
|
||||
# Moved from innodb-zip.test
|
||||
SET SESSION innodb_strict_mode = ON;
|
||||
SET GLOBAL innodb_file_per_table = OFF;
|
||||
SHOW VARIABLES LIKE 'innodb_file_per_table';
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
|
||||
SHOW WARNINGS;
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
|
||||
SHOW WARNINGS;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
SET GLOBAL innodb_file_format = `Antelope`;
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
|
||||
SHOW WARNINGS;
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
|
||||
SHOW WARNINGS;
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
|
||||
|
||||
--echo # Test 7) Not included here; 16k only
|
||||
|
||||
|
||||
--echo # Test 8) Test creating a table that could lead to undo log overflow.
|
||||
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
|
||||
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
|
||||
o blob,p blob,q blob,r blob,s blob,t blob,u blob)
|
||||
ENGINE=InnoDB ROW_FORMAT=dynamic;
|
||||
SET @a = repeat('a', 767);
|
||||
SET @b = repeat('b', 767);
|
||||
SET @c = repeat('c', 767);
|
||||
SET @d = repeat('d', 767);
|
||||
SET @e = repeat('e', 767);
|
||||
|
||||
# With no indexes defined, we can update all columns to max key part length.
|
||||
INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
|
||||
UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
|
||||
k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b;
|
||||
|
||||
# With one index defined, we can still update all fields.
|
||||
CREATE INDEX t1a ON t1 (a(767));
|
||||
UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
|
||||
k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c;
|
||||
|
||||
# Add one more index and the UNDO record becomes too big to update all columns.
|
||||
# But a single transaction can update the columns in separate statements.
|
||||
# because the UNDO records will be smaller.
|
||||
CREATE INDEX t1b ON t1 (b(767));
|
||||
--error ER_UNDO_RECORD_TOO_BIG
|
||||
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
|
||||
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
|
||||
BEGIN;
|
||||
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
|
||||
UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d,k=@d,l=@d,m=@d,
|
||||
n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
|
||||
COMMIT;
|
||||
|
||||
# Another index can still be added and a single field can still be updated
|
||||
CREATE INDEX t1c ON t1 (c(767));
|
||||
UPDATE t1 SET c=@e;
|
||||
|
||||
# Add one more index and we cannot update a column to its defined index length.
|
||||
# This is a problem. It means that the DDL is allowed to create a table
|
||||
# that CANNOT be updated. See bug#12953735.
|
||||
CREATE INDEX t1d ON t1 (d(767));
|
||||
--error ER_UNDO_RECORD_TOO_BIG
|
||||
UPDATE t1 SET d=@e;
|
||||
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
CREATE INDEX t1e ON t1 (e(767));
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #13336585 - INNODB: CHANGE BUFFERING WITH 4K PAGES CAN ASSERT
|
||||
# IF SECONDARY KEY IS NEAR MAX
|
||||
# If the secondary index tuple is close to half the page size,
|
||||
# ibuf_insert_low() could return DB_TOO_BIG_RECORD, which is not expected
|
||||
# in ibuf_insert(). In order to insure this does not happen, WL5756
|
||||
# imposes a maximum key length of 768 for 4k pages and 1536 for 8k pages.
|
||||
# The existing max key Size for 16k pages is 3072.
|
||||
#
|
||||
|
||||
#-- disable_query_log
|
||||
# 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.
|
||||
# This flag is not used currently since it exposes valgrind error in ibuf
|
||||
# code with the following SQL
|
||||
#-- 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
|
||||
|
||||
# make sure the largest possible key entry can be added to the insert buffer.
|
||||
# Make enough records so that the root page is not a leaf page.
|
||||
SET SESSION innodb_strict_mode = OFF;
|
||||
CREATE TABLE t1(
|
||||
pk01 varchar(48), pk02 varchar(48), pk03 varchar(48), pk04 varchar(48),
|
||||
pk05 varchar(48), pk06 varchar(48), pk07 varchar(48), pk08 varchar(48),
|
||||
pk09 varchar(48), pk10 varchar(48), pk11 varchar(48), pk12 varchar(48),
|
||||
pk13 varchar(48), pk14 varchar(48), pk15 varchar(48), pk16 varchar(48),
|
||||
sk01 varchar(48), sk02 varchar(48), sk03 varchar(48), sk04 varchar(48),
|
||||
sk05 varchar(48), sk06 varchar(48), sk07 varchar(48), sk08 varchar(48),
|
||||
sk09 varchar(48), sk10 varchar(48), sk11 varchar(48), sk12 varchar(48),
|
||||
sk13 varchar(48), sk14 varchar(48), sk15 varchar(48), sk16 varchar(48),
|
||||
PRIMARY KEY pk(pk01,pk02,pk03,pk04,pk05,pk06,pk07,pk08,
|
||||
pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16),
|
||||
KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08,
|
||||
sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16))
|
||||
ROW_FORMAT=Redundant ENGINE=InnoDB;
|
||||
SET @r = repeat('a', 48);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('b', 48);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('c', 48);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('d', 48);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('e', 48);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
DELETE from t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Compressed tables do not compress parent pages. So the whole uncompressed
|
||||
# secondary tuple including the primary key must be able to fit in half the
|
||||
# compressed page size. This record length is enforced at index creation.
|
||||
# So the only way to get an ibuf tuple too big is to make the KEY_BLOCK_SIZE
|
||||
# the same as the page size.
|
||||
CREATE TABLE t1(
|
||||
pk01 varchar(48), pk02 varchar(48), pk03 varchar(48), pk04 varchar(48),
|
||||
pk05 varchar(48), pk06 varchar(48), pk07 varchar(48), pk08 varchar(48),
|
||||
pk09 varchar(48), pk10 varchar(48), pk11 varchar(48), pk12 varchar(48),
|
||||
pk13 varchar(48), pk14 varchar(48), pk15 varchar(48), pk16 varchar(48),
|
||||
sk01 varchar(48), sk02 varchar(48), sk03 varchar(48), sk04 varchar(48),
|
||||
sk05 varchar(48), sk06 varchar(48), sk07 varchar(48), sk08 varchar(48),
|
||||
sk09 varchar(48), sk10 varchar(48), sk11 varchar(48), sk12 varchar(48),
|
||||
sk13 varchar(48), sk14 varchar(48), sk15 varchar(48), sk16 varchar(48),
|
||||
PRIMARY KEY pk(pk01,pk02,pk03,pk04,pk05,pk06,pk07,pk08,
|
||||
pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16),
|
||||
KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08,
|
||||
sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16))
|
||||
ROW_FORMAT=Compressed KEY_BLOCK_SIZE=4 ENGINE=InnoDB;
|
||||
SET @r = repeat('a', 48);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('b', 48);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('c', 48);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('d', 48);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('e', 48);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
DELETE from t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#-- disable_query_log
|
||||
#-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
|
||||
#SET GLOBAL innodb_change_buffering_debug = 0;
|
||||
#-- enable_query_log
|
||||
|
||||
# The following should fail in non-strict mode too.
|
||||
# (The fix of Bug #50945 only affects REDUNDANT and COMPACT tables.)
|
||||
SET SESSION innodb_strict_mode = off;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
CREATE TABLE t1(
|
||||
c text NOT NULL, d text NOT NULL,
|
||||
PRIMARY KEY (c(767)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(
|
||||
c text NOT NULL, d text NOT NULL,
|
||||
PRIMARY KEY (c(767)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
|
||||
drop table t1;
|
||||
CREATE TABLE t1(
|
||||
c text NOT NULL, d text NOT NULL,
|
||||
PRIMARY KEY (c(767)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
|
||||
drop table t1;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
|
||||
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
|
||||
DROP TABLE t1;
|
468
mysql-test/suite/innodb_zip/t/8k.test
Normal file
468
mysql-test/suite/innodb_zip/t/8k.test
Normal file
@ -0,0 +1,468 @@
|
||||
# Tests for setting innodb-page-size=8k
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_8k.inc
|
||||
SET default_storage_engine=InnoDB;
|
||||
|
||||
--disable_query_log
|
||||
let $MYSQLD_DATADIR = `select @@datadir`;
|
||||
let $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
|
||||
|
||||
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
|
||||
--enable_query_log
|
||||
|
||||
--echo # Test 1) Show the page size from Information Schema
|
||||
--disable_warnings
|
||||
SELECT variable_value FROM information_schema.global_status
|
||||
WHERE LOWER(variable_name) = 'innodb_page_size';
|
||||
--enable_warnings
|
||||
|
||||
--echo # Test 2) The number of buffer pool pages is dependent upon the page size.
|
||||
--disable_warnings
|
||||
--replace_result 3071 {checked_valid} 3072 {checked_valid}
|
||||
SELECT variable_value FROM information_schema.global_status
|
||||
WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
|
||||
--enable_warnings
|
||||
|
||||
--echo # Test 3) Query some information_shema tables that are dependent upon
|
||||
--echo # the page size.
|
||||
# Show the metadata for tables in schema 'mysql'.
|
||||
# Pulled from innodb-system-table-view.test
|
||||
# The IDs of mysql.innodb_table_stats and mysql.innodb_index_stats are
|
||||
# unpredictable. They depend on whether mtr has created the database for
|
||||
# this test from scratch or is using a previously created database where
|
||||
# those tables have been dropped and recreated. Since we cannot force mtr
|
||||
# to use a freshly created database for this test we do not return the
|
||||
# table or index IDs. We can return the space IS of mysql schema tables
|
||||
# since they are created consistently during bootstrap.
|
||||
SELECT t.name table_name, t.n_cols, t.flag table_flags,
|
||||
i.name index_name, i.page_no root_page, i.type,
|
||||
i.n_fields, i.merge_threshold
|
||||
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
|
||||
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
|
||||
WHERE t.table_id = i.table_id
|
||||
AND t.name LIKE 'mysql%'
|
||||
ORDER BY t.name, i.index_id;
|
||||
|
||||
CREATE TABLE t1 (a INT KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=innodb;
|
||||
CREATE TABLE t2 (a INT KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=innodb;
|
||||
CREATE TABLE t3 (a INT KEY, b TEXT) ROW_FORMAT=COMPRESSED ENGINE=innodb;
|
||||
CREATE TABLE t4 (a INT KEY, b TEXT) ROW_FORMAT=DYNAMIC ENGINE=innodb;
|
||||
|
||||
# Show the metadata for tables in schema 'test'.
|
||||
# Do not return the space ID since this tablespace may have existed before
|
||||
# this test runs. The root page number of each index should be consistent
|
||||
# within a file-per-table tablespace.
|
||||
SELECT t.name table_name, t.n_cols, t.flag table_flags,
|
||||
i.name index_name, i.page_no root_page, i.type,
|
||||
i.n_fields, i.merge_threshold
|
||||
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t,
|
||||
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i
|
||||
WHERE t.table_id = i.table_id
|
||||
AND t.name LIKE 'test%'
|
||||
ORDER BY t.name, i.name;
|
||||
--source suite/innodb/include/show_i_s_tablespaces.inc
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
|
||||
--echo # Test 4) The maximum row size is dependent upon the page size.
|
||||
--echo # Redundant: 4027, Compact: 4030.
|
||||
--echo # Compressed: 4030, Dynamic: 4030.
|
||||
--echo # Each row format has its own amount of overhead that
|
||||
--echo # varies depending on number of fields and other overhead.
|
||||
|
||||
SET SESSION innodb_strict_mode = ON;
|
||||
|
||||
# Redundant table; 3955 bytes with 20 CHAR fields
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(155)
|
||||
) ROW_FORMAT=redundant;
|
||||
DROP TABLE t1;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(156)
|
||||
) ROW_FORMAT=redundant;
|
||||
|
||||
# Compact table; 4002 bytes with 20 CHAR fields
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(202)
|
||||
) ROW_FORMAT=compact;
|
||||
DROP TABLE t1;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(203)
|
||||
) ROW_FORMAT=compact;
|
||||
|
||||
# Compressed table; 3905 bytes with 20 CHAR fields
|
||||
# Bug#13391353 Limit is 3903 on 32-Linux only
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(103)
|
||||
) ROW_FORMAT=compressed;
|
||||
DROP TABLE t1;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(106)
|
||||
) ROW_FORMAT=compressed;
|
||||
|
||||
# Dynamic table; 4002 bytes with 20 CHAR fields
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(202)
|
||||
) ROW_FORMAT=dynamic;
|
||||
DROP TABLE t1;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
--error ER_TOO_BIG_ROWSIZE
|
||||
CREATE TABLE t1 (
|
||||
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
|
||||
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
|
||||
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
|
||||
c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(203)
|
||||
) ROW_FORMAT=dynamic;
|
||||
|
||||
#
|
||||
# Test the maximum key length
|
||||
# Moved from innodb-index.test since each page size has its own max key length.
|
||||
# Max Key Length is 1536 for 8k pages.
|
||||
#
|
||||
# InnoDB assumes 3 bytes for each UTF8 character.
|
||||
#
|
||||
CREATE TABLE t1 (a varchar(128) character set utf8,
|
||||
b varchar(128) character set utf8,
|
||||
c varchar(128) character set utf8,
|
||||
d varchar(128) character set utf8,
|
||||
PRIMARY KEY (a,b,c,d))
|
||||
ENGINE=innodb;
|
||||
DROP TABLE t1;
|
||||
--error ER_TOO_LONG_KEY
|
||||
CREATE TABLE t1 (a varchar(128) character set utf8,
|
||||
b varchar(128) character set utf8,
|
||||
c varchar(128) character set utf8,
|
||||
d varchar(129) character set utf8,
|
||||
PRIMARY KEY (a,b,c,d))
|
||||
ENGINE=innodb;
|
||||
CREATE TABLE t1 (a varchar(128) character set utf8,
|
||||
b varchar(128) character set utf8,
|
||||
c varchar(128) character set utf8,
|
||||
d varchar(128) character set utf8,
|
||||
e varchar(128) character set utf8,
|
||||
PRIMARY KEY (a), KEY (b,c,d,e))
|
||||
ENGINE=innodb;
|
||||
DROP TABLE t1;
|
||||
--error ER_TOO_LONG_KEY
|
||||
CREATE TABLE t1 (a varchar(128) character set utf8,
|
||||
b varchar(128) character set utf8,
|
||||
c varchar(128) character set utf8,
|
||||
d varchar(128) character set utf8,
|
||||
e varchar(129) character set utf8,
|
||||
PRIMARY KEY (a), KEY (b,c,d,e))
|
||||
ENGINE=innodb;
|
||||
|
||||
--echo # Test 5) Make sure that KEY_BLOCK_SIZE=8, 4, 2 & 1 are all
|
||||
--echo # accepted and that KEY_BLOCK_SIZE=16 is rejected in
|
||||
--echo # strict mode and converted to 8 in non-strict mode.
|
||||
|
||||
SET SESSION innodb_strict_mode = ON;
|
||||
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
|
||||
SHOW WARNINGS;
|
||||
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
|
||||
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';
|
||||
|
||||
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 KEY_BLOCK_SIZE=1;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
DROP TABLE t1;
|
||||
|
||||
SET SESSION innodb_strict_mode = OFF;
|
||||
|
||||
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
|
||||
SHOW WARNINGS;
|
||||
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 KEY_BLOCK_SIZE=1;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
|
||||
SHOW WARNINGS;
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo # Test 6) Make sure that KEY_BLOCK_SIZE = 8 and 16
|
||||
--echo # are rejected when innodb_file_per_table=OFF
|
||||
# Moved from innodb-zip.test
|
||||
SET SESSION innodb_strict_mode = ON;
|
||||
SET GLOBAL innodb_file_per_table = OFF;
|
||||
SHOW VARIABLES LIKE 'innodb_file_per_table';
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
|
||||
SHOW WARNINGS;
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
|
||||
SHOW WARNINGS;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
SET GLOBAL innodb_file_format = `Antelope`;
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
|
||||
SHOW WARNINGS;
|
||||
--error ER_ILLEGAL_HA
|
||||
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
|
||||
SHOW WARNINGS;
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
|
||||
|
||||
--echo # Test 7) Not included here; 16k only
|
||||
|
||||
|
||||
--echo # Test 8) Test creating a table that could lead to undo log overflow.
|
||||
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
|
||||
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
|
||||
o blob,p blob,q blob,r blob,s blob,t blob,u blob)
|
||||
ENGINE=InnoDB ROW_FORMAT=dynamic;
|
||||
SET @a = repeat('a', 767);
|
||||
SET @b = repeat('b', 767);
|
||||
SET @c = repeat('c', 767);
|
||||
SET @d = repeat('d', 767);
|
||||
SET @e = repeat('e', 767);
|
||||
|
||||
# With no indexes defined, we can update all columns to max key part length.
|
||||
INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a);
|
||||
UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
|
||||
k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b;
|
||||
|
||||
# With this many indexes defined, we can still update all fields.
|
||||
CREATE INDEX t1a ON t1 (a(767));
|
||||
CREATE INDEX t1b ON t1 (b(767));
|
||||
UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
|
||||
k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c;
|
||||
|
||||
# Add one more index and the UNDO record becomes too big to update all columns.
|
||||
# But a single transaction can update the columns in separate statements.
|
||||
# because the UNDO records will be smaller.
|
||||
CREATE INDEX t1c ON t1 (c(767));
|
||||
--error ER_UNDO_RECORD_TOO_BIG
|
||||
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
|
||||
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
|
||||
BEGIN;
|
||||
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
|
||||
UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d,k=@d,l=@d,m=@d,
|
||||
n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
|
||||
COMMIT;
|
||||
|
||||
# More indexes can still be added and a single field can still be updated
|
||||
CREATE INDEX t1d ON t1 (d(767));
|
||||
UPDATE t1 SET d=@e;
|
||||
CREATE INDEX t1e ON t1 (e(767));
|
||||
UPDATE t1 SET e=@e;
|
||||
CREATE INDEX t1f ON t1 (f(767));
|
||||
UPDATE t1 SET f=@e;
|
||||
CREATE INDEX t1g ON t1 (g(767));
|
||||
UPDATE t1 SET g=@e;
|
||||
CREATE INDEX t1h ON t1 (h(767));
|
||||
UPDATE t1 SET h=@e;
|
||||
CREATE INDEX t1i ON t1 (i(767));
|
||||
UPDATE t1 SET i=@e;
|
||||
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
CREATE INDEX t1k ON t1 (j(767));
|
||||
|
||||
# But it does allow a 500 byte index. And with this, we cannot
|
||||
# update the record. This is a problem. It means that the DDL is
|
||||
# allowed to create a table and a record that CANNOT be updated.
|
||||
# See bug#12953735
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
CREATE INDEX t1j ON t1 (j(500));
|
||||
--error ER_UNDO_RECORD_TOO_BIG
|
||||
UPDATE t1 SET j=@e;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #13336585 - INNODB: CHANGE BUFFERING WITH 4K PAGES CAN ASSERT
|
||||
# IF SECONDARY KEY IS NEAR MAX
|
||||
# If the secondary index tuple is close to half the page size,
|
||||
# ibuf_insert_low() could return DB_TOO_BIG_RECORD, which is not expected
|
||||
# in ibuf_insert(). In order to insure this does not happen, WL5756
|
||||
# imposes a maximum key length of 768 for 4k pages and 1536 for 8k pages.
|
||||
# The existing max key Size for 16k pages is 3072.
|
||||
#
|
||||
|
||||
#-- disable_query_log
|
||||
# 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
|
||||
|
||||
# make sure the largest possible key entry can be added to the insert buffer.
|
||||
# Make enough records so that the root page is not a leaf page.
|
||||
SET SESSION innodb_strict_mode = OFF;
|
||||
CREATE TABLE t1(
|
||||
pk01 varchar(96), pk02 varchar(96), pk03 varchar(96), pk04 varchar(96),
|
||||
pk05 varchar(96), pk06 varchar(96), pk07 varchar(96), pk08 varchar(96),
|
||||
pk09 varchar(96), pk10 varchar(96), pk11 varchar(96), pk12 varchar(96),
|
||||
pk13 varchar(96), pk14 varchar(96), pk15 varchar(96), pk16 varchar(96),
|
||||
sk01 varchar(96), sk02 varchar(96), sk03 varchar(96), sk04 varchar(96),
|
||||
sk05 varchar(96), sk06 varchar(96), sk07 varchar(96), sk08 varchar(96),
|
||||
sk09 varchar(96), sk10 varchar(96), sk11 varchar(96), sk12 varchar(96),
|
||||
sk13 varchar(96), sk14 varchar(96), sk15 varchar(96), sk16 varchar(96),
|
||||
PRIMARY KEY pk(pk01,pk02,pk03,pk04,pk05,pk06,pk07,pk08,
|
||||
pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16),
|
||||
KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08,
|
||||
sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16))
|
||||
ROW_FORMAT=Redundant ENGINE=InnoDB;
|
||||
SET @r = repeat('a', 96);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('b', 96);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('c', 96);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('d', 96);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('e', 96);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
DELETE from t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Compressed tables do not compress parent pages. So the whole uncompressed
|
||||
# secondary tuple including the primary key must be able to fit in half the
|
||||
# compressed page size. This record length is enforced at index creation.
|
||||
# So the only way to get an ibuf tuple too big is to make the KEY_BLOCK_SIZE
|
||||
# the same as the page size.
|
||||
CREATE TABLE t1(
|
||||
pk01 varchar(96), pk02 varchar(96), pk03 varchar(96), pk04 varchar(96),
|
||||
pk05 varchar(96), pk06 varchar(96), pk07 varchar(96), pk08 varchar(96),
|
||||
pk09 varchar(96), pk10 varchar(96), pk11 varchar(96), pk12 varchar(96),
|
||||
pk13 varchar(96), pk14 varchar(96), pk15 varchar(96), pk16 varchar(96),
|
||||
sk01 varchar(96), sk02 varchar(96), sk03 varchar(96), sk04 varchar(96),
|
||||
sk05 varchar(96), sk06 varchar(96), sk07 varchar(96), sk08 varchar(96),
|
||||
sk09 varchar(96), sk10 varchar(96), sk11 varchar(96), sk12 varchar(96),
|
||||
sk13 varchar(96), sk14 varchar(96), sk15 varchar(96), sk16 varchar(96),
|
||||
PRIMARY KEY pk(pk01,pk02,pk03,pk04,pk05,pk06,pk07,pk08,
|
||||
pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16),
|
||||
KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08,
|
||||
sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16))
|
||||
ROW_FORMAT=Compressed KEY_BLOCK_SIZE=8 ENGINE=InnoDB;
|
||||
SET @r = repeat('a', 96);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('b', 96);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('c', 96);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('d', 96);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
SET @r = repeat('e', 96);
|
||||
INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
|
||||
@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
|
||||
DELETE from t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#-- disable_query_log
|
||||
#-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
|
||||
#SET GLOBAL innodb_change_buffering_debug = 0;
|
||||
#-- enable_query_log
|
||||
|
||||
# The following should fail in non-strict mode too.
|
||||
# (The fix of Bug #50945 only affects REDUNDANT and COMPACT tables.)
|
||||
SET SESSION innodb_strict_mode = off;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
CREATE TABLE t1(
|
||||
c text NOT NULL, d text NOT NULL,
|
||||
PRIMARY KEY (c(767),d(767)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
|
||||
DROP TABLE t1;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
CREATE TABLE t1(
|
||||
c text NOT NULL, d text NOT NULL,
|
||||
PRIMARY KEY (c(767),d(767)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(
|
||||
c text NOT NULL, d text NOT NULL,
|
||||
PRIMARY KEY (c(767),d(767)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
|
||||
drop table t1;
|
||||
--replace_regex /> [0-9]*/> max_row_size/
|
||||
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
|
||||
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
|
||||
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
|
||||
DROP TABLE t1;
|
1162
mysql-test/suite/innodb_zip/t/bug36169.test
Normal file
1162
mysql-test/suite/innodb_zip/t/bug36169.test
Normal file
File diff suppressed because it is too large
Load Diff
30
mysql-test/suite/innodb_zip/t/bug36172.test
Normal file
30
mysql-test/suite/innodb_zip/t/bug36172.test
Normal file
@ -0,0 +1,30 @@
|
||||
#
|
||||
# Test case for bug 36172
|
||||
#
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_innodb_16k.inc
|
||||
|
||||
SET default_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_per_table=`select @@innodb_file_per_table`;
|
||||
SET GLOBAL innodb_file_per_table=on;
|
||||
|
||||
DROP TABLE IF EXISTS `table0`;
|
||||
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
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;
|
||||
SET sql_mode = default;
|
||||
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_per_table=$file_per_table;
|
105
mysql-test/suite/innodb_zip/t/bug52745.test
Normal file
105
mysql-test/suite/innodb_zip/t/bug52745.test
Normal file
@ -0,0 +1,105 @@
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_innodb_zip.inc
|
||||
|
||||
let $file_per_table=`select @@innodb_file_per_table`;
|
||||
SET GLOBAL innodb_file_per_table=on;
|
||||
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
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(4) 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;
|
||||
SET sql_mode = default;
|
||||
INSERT IGNORE 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_per_table=$file_per_table;
|
22
mysql-test/suite/innodb_zip/t/bug53591.test
Normal file
22
mysql-test/suite/innodb_zip/t/bug53591.test
Normal file
@ -0,0 +1,22 @@
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_innodb_zip.inc
|
||||
|
||||
let $file_per_table=`select @@innodb_file_per_table`;
|
||||
|
||||
SET GLOBAL innodb_file_per_table=on;
|
||||
SET GLOBAL innodb_strict_mode=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_per_table=$file_per_table;
|
||||
SET GLOBAL innodb_strict_mode=DEFAULT;
|
140
mysql-test/suite/innodb_zip/t/bug56680.test
Normal file
140
mysql-test/suite/innodb_zip/t/bug56680.test
Normal file
@ -0,0 +1,140 @@
|
||||
#Want to skip this test from daily Valgrind execution
|
||||
--source include/no_valgrind_without_big.inc
|
||||
#
|
||||
# Bug #56680 InnoDB may return wrong results from a case-insensitive index
|
||||
#
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_innodb_zip.inc
|
||||
|
||||
-- disable_query_log
|
||||
SET @tx_isolation_orig = @@tx_isolation;
|
||||
SET @innodb_file_per_table_orig = @@innodb_file_per_table;
|
||||
# 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_per_table=on;
|
||||
|
||||
CREATE TABLE bug56680(
|
||||
a INT AUTO_INCREMENT PRIMARY KEY,
|
||||
b CHAR(1),
|
||||
c INT,
|
||||
INDEX(b))
|
||||
ENGINE=InnoDB STATS_PERSISTENT=0;
|
||||
|
||||
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 STATS_PERSISTENT=0;
|
||||
|
||||
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;
|
||||
-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
|
||||
SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;
|
1
mysql-test/suite/innodb_zip/t/cmp_drop_table-master.opt
Normal file
1
mysql-test/suite/innodb_zip/t/cmp_drop_table-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--innodb-buffer-pool-size=8M
|
57
mysql-test/suite/innodb_zip/t/cmp_drop_table.test
Normal file
57
mysql-test/suite/innodb_zip/t/cmp_drop_table.test
Normal file
@ -0,0 +1,57 @@
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_innodb_16k.inc
|
||||
|
||||
let $per_table=`select @@innodb_file_per_table`;
|
||||
|
||||
-- let $query_i_s = SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0
|
||||
|
||||
set global innodb_file_per_table=on;
|
||||
|
||||
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 there should still 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 = 500
|
||||
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_per_table=$per_table;
|
118
mysql-test/suite/innodb_zip/t/cmp_per_index.test
Normal file
118
mysql-test/suite/innodb_zip/t/cmp_per_index.test
Normal file
@ -0,0 +1,118 @@
|
||||
#
|
||||
# Test information_schema.innodb_cmp_per_index
|
||||
#
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
# Using innodb_log_compressed=0 leads to a larger number of page
|
||||
# compressions, because page_cur_insert_rec_zip() will reorganize the
|
||||
# page before attempting an insert followed by page compression and
|
||||
# page_zip_compress_write_log_no_data().
|
||||
|
||||
if (`SELECT @@innodb_log_compressed_pages = 0`)
|
||||
{
|
||||
--skip Needs innodb_log_compressed_pages
|
||||
}
|
||||
|
||||
# numbers read in this test depend on the page size
|
||||
-- source include/have_innodb_16k.inc
|
||||
# include/restart_mysqld.inc does not work in embedded mode
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
-- vertical_results
|
||||
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=ON;
|
||||
|
||||
# reset any leftover stats from previous tests
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
SELECT * FROM information_schema.innodb_cmp_per_index_reset;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
# see that the table is empty
|
||||
SELECT * FROM information_schema.innodb_cmp_per_index;
|
||||
|
||||
# create a table that uses compression
|
||||
CREATE TABLE t (
|
||||
a INT,
|
||||
b VARCHAR(512),
|
||||
c VARCHAR(16),
|
||||
PRIMARY KEY (a),
|
||||
INDEX (b(512)),
|
||||
INDEX (c(16))
|
||||
) ENGINE=INNODB KEY_BLOCK_SIZE=2;
|
||||
|
||||
SELECT
|
||||
database_name,
|
||||
table_name,
|
||||
index_name,
|
||||
compress_ops,
|
||||
compress_ops_ok,
|
||||
uncompress_ops
|
||||
FROM information_schema.innodb_cmp_per_index
|
||||
ORDER BY 1, 2, 3;
|
||||
|
||||
# insert some data into it
|
||||
BEGIN;
|
||||
-- disable_query_log
|
||||
let $i=128;
|
||||
while ($i)
|
||||
{
|
||||
-- eval INSERT INTO t VALUES ($i, REPEAT('x', 512), NULL);
|
||||
dec $i;
|
||||
}
|
||||
-- enable_query_log
|
||||
COMMIT;
|
||||
|
||||
ALTER TABLE t DROP INDEX c;
|
||||
|
||||
GRANT USAGE ON *.* TO 'tuser01'@'localhost' IDENTIFIED BY 'cDJvI9s_Uq';
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
-- connect (con1,localhost,tuser01,cDJvI9s_Uq,)
|
||||
-- connection con1
|
||||
|
||||
-- error ER_SPECIFIC_ACCESS_DENIED_ERROR
|
||||
SELECT * FROM information_schema.innodb_cmp_per_index;
|
||||
|
||||
-- connection default
|
||||
-- disconnect con1
|
||||
|
||||
DROP USER 'tuser01'@'localhost';
|
||||
|
||||
SELECT
|
||||
database_name,
|
||||
table_name,
|
||||
index_name,
|
||||
CASE WHEN compress_ops=47 and @@innodb_compression_level IN (4,8,9) THEN 65
|
||||
ELSE compress_ops END as compress_ops,
|
||||
CASE WHEN compress_ops_ok=47 and @@innodb_compression_level IN (4,8,9) THEN 65
|
||||
ELSE compress_ops_ok END as compress_ops_ok,
|
||||
uncompress_ops
|
||||
FROM information_schema.innodb_cmp_per_index
|
||||
ORDER BY 1, 2, 3;
|
||||
|
||||
# restart mysqld and see that uncompress ops also gets increased when
|
||||
# selecting from the table again
|
||||
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=ON;
|
||||
|
||||
SELECT COUNT(*) FROM t;
|
||||
|
||||
SELECT
|
||||
database_name,
|
||||
table_name,
|
||||
index_name,
|
||||
compress_ops,
|
||||
compress_ops_ok,
|
||||
CASE WHEN uncompress_ops=6 and @@innodb_compression_level IN (4,8,9) THEN 9
|
||||
ELSE uncompress_ops END as uncompress_ops
|
||||
FROM information_schema.innodb_cmp_per_index
|
||||
ORDER BY 1, 2, 3;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=default;
|
528
mysql-test/suite/innodb_zip/t/create_options.test
Normal file
528
mysql-test/suite/innodb_zip/t/create_options.test
Normal file
@ -0,0 +1,528 @@
|
||||
# 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
|
||||
# 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 and 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
|
||||
-- source include/have_innodb_zip.inc
|
||||
SET default_storage_engine=InnoDB;
|
||||
|
||||
--disable_query_log
|
||||
# These values can change during the test
|
||||
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_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'
|
||||
--echo # 'FIXED' is sent to InnoDB since it is used by MyISAM.
|
||||
--echo # But it is an invalid mode in InnoDB
|
||||
--error ER_ILLEGAL_HA, 1005
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED;
|
||||
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 t1;
|
||||
--error ER_ILLEGAL_HA,1005
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
|
||||
SHOW WARNINGS;
|
||||
--error ER_ILLEGAL_HA,1005
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
|
||||
SHOW WARNINGS;
|
||||
--error ER_ILLEGAL_HA,1005
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
|
||||
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 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 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 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 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 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 t1;
|
||||
--error ER_ILLEGAL_HA, 1005
|
||||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=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;
|
||||
--error ER_ILLEGAL_HA,1005
|
||||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=4;
|
||||
SHOW WARNINGS;
|
||||
--error ER_ILLEGAL_HA,1005
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
|
||||
SHOW WARNINGS;
|
||||
--error 1005
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
|
||||
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 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 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 1478
|
||||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
|
||||
SET GLOBAL innodb_file_format=Barracuda;
|
||||
DROP TABLE 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 t1;
|
||||
--error ER_ILLEGAL_HA,1005
|
||||
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1;
|
||||
SHOW WARNINGS;
|
||||
--error ER_ILLEGAL_HA,1005
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
|
||||
SHOW WARNINGS;
|
||||
--error 1005
|
||||
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
|
||||
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 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 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 1478
|
||||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
|
||||
ALTER TABLE t1 ROW_FORMAT=COMPACT;
|
||||
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 t1;
|
||||
|
||||
--disable_query_log
|
||||
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
|
||||
|
17
mysql-test/suite/innodb_zip/t/disabled.def
Normal file
17
mysql-test/suite/innodb_zip/t/disabled.def
Normal file
@ -0,0 +1,17 @@
|
||||
##############################################################################
|
||||
#
|
||||
# List the test cases that are to be disabled temporarily.
|
||||
#
|
||||
# Separate the test case name and the comment with ':'.
|
||||
#
|
||||
# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
|
||||
#
|
||||
# Do not use any TAB characters for whitespace.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
restart : Not supported by MariaDB 10.2 2/9/2016 jplindst
|
||||
innochecksum : MDEV-10727 2/9/2016 jplindst
|
||||
innochecksum_2 : MDEV-10727 2/9/2016 jplindst
|
||||
innochecksum_3 : MDEV-10727 2/9/2016 jplindst
|
||||
|
441
mysql-test/suite/innodb_zip/t/index_large_prefix.test
Normal file
441
mysql-test/suite/innodb_zip/t/index_large_prefix.test
Normal file
@ -0,0 +1,441 @@
|
||||
# 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;
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
|
||||
--enable_query_log
|
||||
|
||||
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
|
||||
|
||||
set global innodb_file_per_table=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_TOO_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_LONG_KEY,1118
|
||||
create index idx1 on worklog5743_1(a2(4000));
|
||||
show warnings;
|
||||
set global innodb_large_prefix=1;
|
||||
-- error ER_TOO_LONG_KEY,1118
|
||||
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;
|
||||
# Check index creation behavior without STRICT mode
|
||||
SET sql_mode= '';
|
||||
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;
|
||||
set sql_mode= default;
|
||||
|
||||
# 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;
|
||||
# Check index creation behavior without STRICT mode
|
||||
SET sql_mode='';
|
||||
create index idx1 on worklog5743(a2);
|
||||
create index idx2 on worklog5743(a3);
|
||||
create index idx3 on worklog5743(a4);
|
||||
show warnings;
|
||||
SET sql_mode= default;
|
||||
-- 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)))
|
||||
row_format=compact;
|
||||
|
||||
create table worklog5743(a TEXT)
|
||||
row_format=compact;
|
||||
|
||||
# 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;
|
||||
--disconnect con1
|
||||
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a = repeat("x", 25000) from worklog5743;
|
||||
--disconnect con2
|
||||
|
||||
--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
|
||||
# Check index creation behavior without STRICT mode
|
||||
SET sql_mode='';
|
||||
create index idx1 on worklog5743(a(3073));
|
||||
create index idx2 on worklog5743(a(3072));
|
||||
show create table worklog5743;
|
||||
drop table worklog5743;
|
||||
SET sql_mode= default;
|
||||
|
||||
# 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_per_table=$innodb_file_per_table_orig;
|
400
mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test
Normal file
400
mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test
Normal file
@ -0,0 +1,400 @@
|
||||
# Testcase for worklog #5743: Lift the limit of index key prefixes
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_4k.inc
|
||||
SET default_storage_engine=InnoDB;
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
|
||||
--enable_query_log
|
||||
|
||||
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
|
||||
|
||||
set global innodb_file_per_table=1;
|
||||
|
||||
-- echo ### Test 1 ###
|
||||
# Create a table of DYNAMIC format, with a primary index of 768 bytes in
|
||||
# size
|
||||
create table worklog5743(a TEXT not null, primary key (a(768))) 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
|
||||
SET sql_mode= '';
|
||||
create index idx on worklog5743(a(900));
|
||||
show warnings;
|
||||
SET sql_mode= default;
|
||||
# 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(750));
|
||||
show warnings;
|
||||
|
||||
insert into worklog5743 values(9, repeat("a", 10000));
|
||||
|
||||
begin;
|
||||
|
||||
update worklog5743 set a1 = 1111;
|
||||
|
||||
# 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 = 2222;
|
||||
|
||||
# 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;
|
||||
|
||||
# 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_TOO_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_LONG_KEY
|
||||
create index idx1 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=1;
|
||||
SET sql_mode= '';
|
||||
create index idx1 on worklog5743_2(a2(4000));
|
||||
show warnings;
|
||||
show create table worklog5743_2;
|
||||
create index idx3 on worklog5743_2(a2(769));
|
||||
show warnings;
|
||||
create index idx4 on worklog5743_2(a2(768));
|
||||
show warnings;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx5 on worklog5743_2(a1, a2(765));
|
||||
show warnings;
|
||||
create index idx6 on worklog5743_2(a1, a2(764));
|
||||
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;
|
||||
show create table worklog5743_4;
|
||||
create index idx3 on worklog5743_4(a2(769));
|
||||
show warnings;
|
||||
create index idx4 on worklog5743_4(a2(768));
|
||||
show warnings;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx5 on worklog5743_4(a1, a2(765));
|
||||
show warnings;
|
||||
create index idx6 on worklog5743_4(a1, a2(764));
|
||||
show warnings;
|
||||
SET sql_mode= default;
|
||||
# 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));
|
||||
|
||||
# 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));
|
||||
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;
|
||||
|
||||
begin;
|
||||
|
||||
update worklog5743_1 set a1 = 1000;
|
||||
update worklog5743_2 set a1 = 1000;
|
||||
update worklog5743_4 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;
|
||||
|
||||
# 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;
|
||||
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;
|
||||
|
||||
# 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;
|
||||
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743_1;
|
||||
drop table worklog5743_2;
|
||||
drop table worklog5743_4;
|
||||
|
||||
-- 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.
|
||||
|
||||
# This commented form of the test causes an unlimited page split
|
||||
# on update of the int field - Bug 12636590 - INNODB; UPDATE OF
|
||||
# LARGE RECORD CAUSES UNLIMITED PAGE SPLITS IN 8K PAGE SIZE
|
||||
#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));
|
||||
#
|
||||
|
||||
create table worklog5743(a1 int, a2 varchar(20000)) ROW_FORMAT=DYNAMIC;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx1 on worklog5743(a2);
|
||||
show warnings;
|
||||
drop table worklog5743;
|
||||
|
||||
create table worklog5743(a1 int, a2 varchar(3072)) ROW_FORMAT=DYNAMIC;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx1 on worklog5743(a2);
|
||||
show warnings;
|
||||
drop table worklog5743;
|
||||
|
||||
create table worklog5743(a1 int, a2 varchar(769)) ROW_FORMAT=DYNAMIC;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx1 on worklog5743(a2);
|
||||
show warnings;
|
||||
drop table worklog5743;
|
||||
|
||||
create table worklog5743(a1 int, a2 varchar(768)) ROW_FORMAT=DYNAMIC;
|
||||
create index idx1 on worklog5743(a2);
|
||||
show warnings;
|
||||
insert into worklog5743 values(9, repeat("a", 768));
|
||||
update worklog5743 set a1 = 3333;
|
||||
drop table worklog5743;
|
||||
|
||||
create table worklog5743(a1 int, a2 varchar(765)) ROW_FORMAT=DYNAMIC;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx1 on worklog5743(a1, a2);
|
||||
show warnings;
|
||||
drop table worklog5743;
|
||||
|
||||
create table worklog5743(a1 int, a2 varchar(764)) ROW_FORMAT=DYNAMIC;
|
||||
create index idx1 on worklog5743(a1, a2);
|
||||
show warnings;
|
||||
insert into worklog5743 values(9, repeat("a", 764));
|
||||
|
||||
begin;
|
||||
update worklog5743 set a1 = 4444;
|
||||
|
||||
# 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_TOO_LONG_KEY
|
||||
create table worklog5743(a TEXT not null, primary key (a(1000)));
|
||||
|
||||
create table worklog5743(a TEXT) ROW_FORMAT=COMPACT;
|
||||
|
||||
# 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;
|
||||
--disconnect con1
|
||||
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a = repeat("x", 25000) from worklog5743;
|
||||
--disconnect con2
|
||||
|
||||
--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 if the page size were not 4k.
|
||||
# With this page size, the prefix length is less.
|
||||
SET sql_mode= '';
|
||||
create index idx1 on worklog5743(a(769));
|
||||
show warnings;
|
||||
SET sql_mode= default;
|
||||
create index idx2 on worklog5743(a(768));
|
||||
show warnings;
|
||||
show create table worklog5743;
|
||||
insert into worklog5743 values(repeat("a", 768));
|
||||
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_per_table=$innodb_file_per_table_orig;
|
429
mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test
Normal file
429
mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test
Normal file
@ -0,0 +1,429 @@
|
||||
# Testcase for worklog #5743: Lift the limit of index key prefixes
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_8k.inc
|
||||
SET default_storage_engine=InnoDB;
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
|
||||
--enable_query_log
|
||||
|
||||
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
|
||||
|
||||
set global innodb_file_per_table=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
|
||||
SET sql_mode= '';
|
||||
create index idx on worklog5743(a(2000));
|
||||
show warnings;
|
||||
SET sql_mode= default;
|
||||
|
||||
# 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(1250));
|
||||
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;
|
||||
|
||||
# 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_TOO_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_LONG_KEY
|
||||
create index idx1 on worklog5743_1(a2(4000));
|
||||
show warnings;
|
||||
set global innodb_large_prefix=1;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
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;
|
||||
SET sql_mode= '';
|
||||
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;
|
||||
create index idx3 on worklog5743_4(a2(1537));
|
||||
show warnings;
|
||||
create index idx4 on worklog5743_4(a2(1536));
|
||||
show warnings;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx5 on worklog5743_4(a1, a2(1533));
|
||||
show warnings;
|
||||
create index idx6 on worklog5743_4(a1, a2(1532));
|
||||
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(1533));
|
||||
show warnings;
|
||||
create index idx5 on worklog5743_8(a1, a2(1532));
|
||||
show warnings;
|
||||
SET sql_mode= default;
|
||||
|
||||
# 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));
|
||||
|
||||
# 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));
|
||||
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;
|
||||
|
||||
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;
|
||||
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;
|
||||
|
||||
|
||||
# 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;
|
||||
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;
|
||||
|
||||
# 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;
|
||||
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743_1;
|
||||
drop table worklog5743_2;
|
||||
drop table worklog5743_4;
|
||||
drop table worklog5743_8;
|
||||
|
||||
-- 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.
|
||||
|
||||
# This commented form of the test causes an unlimited page split
|
||||
# on update of the int field - Bug 12636590 - INNODB; UPDATE OF
|
||||
# LARGE RECORD CAUSES UNLIMITED PAGE SPLITS IN 8K PAGE SIZE
|
||||
#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));
|
||||
#
|
||||
|
||||
create table worklog5743(a1 int, a2 varchar(20000)) ROW_FORMAT=DYNAMIC;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx1 on worklog5743(a2);
|
||||
drop table worklog5743;
|
||||
|
||||
create table worklog5743(a1 int, a2 varchar(1537)) ROW_FORMAT=DYNAMIC;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx1 on worklog5743(a2);
|
||||
drop table worklog5743;
|
||||
|
||||
create table worklog5743(a1 int, a2 varchar(1536)) ROW_FORMAT=DYNAMIC;
|
||||
create index idx1 on worklog5743(a2);
|
||||
show warnings;
|
||||
insert into worklog5743 values(9, repeat("a", 1536));
|
||||
update worklog5743 set a1 = 1000;
|
||||
drop table worklog5743;
|
||||
|
||||
create table worklog5743(a1 int, a2 varchar(1533)) ROW_FORMAT=DYNAMIC;
|
||||
-- error ER_TOO_LONG_KEY
|
||||
create index idx1 on worklog5743(a1, a2);
|
||||
show warnings;
|
||||
drop table worklog5743;
|
||||
|
||||
create table worklog5743(a1 int, a2 varchar(1532)) ROW_FORMAT=DYNAMIC;
|
||||
create index idx1 on worklog5743(a1, a2);
|
||||
show warnings;
|
||||
insert into worklog5743 values(9, repeat("a", 1532));
|
||||
update worklog5743 set a1 = 1000;
|
||||
|
||||
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)))
|
||||
row_format=compact;
|
||||
|
||||
create table worklog5743(a TEXT) row_format=compact;
|
||||
|
||||
# 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;
|
||||
--disconnect con1
|
||||
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a = repeat("x", 25000) from worklog5743;
|
||||
--disconnect con2
|
||||
|
||||
--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
|
||||
SET sql_mode= '';
|
||||
create index idx1 on worklog5743(a(3073));
|
||||
create index idx2 on worklog5743(a(3072));
|
||||
SET sql_mode= default;
|
||||
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_per_table=$innodb_file_per_table_orig;
|
240
mysql-test/suite/innodb_zip/t/innochecksum.test
Normal file
240
mysql-test/suite/innodb_zip/t/innochecksum.test
Normal file
@ -0,0 +1,240 @@
|
||||
#************************************************************
|
||||
# WL6045:Improve Innochecksum
|
||||
#************************************************************
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_zip.inc
|
||||
--source include/no_valgrind_without_big.inc
|
||||
# Embedded server does not support crashing.
|
||||
--source include/not_embedded.inc
|
||||
|
||||
# Avoid CrashReporter popup on Mac.
|
||||
--source include/not_crashrep.inc
|
||||
|
||||
--echo # Set the environmental variables
|
||||
let MYSQLD_BASEDIR= `SELECT @@basedir`;
|
||||
let MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
|
||||
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
|
||||
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
|
||||
|
||||
SET GLOBAL innodb_file_per_table=on;
|
||||
|
||||
CREATE TABLE tab1(c1 INT PRIMARY KEY,c2 VARCHAR(20)) ENGINE=InnoDB;
|
||||
CREATE INDEX idx1 ON tab1(c2(10));
|
||||
INSERT INTO tab1 VALUES(1, 'Innochecksum InnoDB1');
|
||||
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
|
||||
insert into t1 values(1,"i");
|
||||
insert into t1 values(2,"am");
|
||||
insert into t1 values(3,"compressed table");
|
||||
|
||||
--echo # Shutdown the Server
|
||||
--source include/shutdown_mysqld.inc
|
||||
--echo # Server Default checksum = innodb
|
||||
|
||||
--echo [1a]: check the innochecksum when file doesn't exists
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM $MYSQLD_DATADIR/test/aa.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error: $MYSQLD_DATADIR/test/aa.ibd cannot be found;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo [1b]: check the innochecksum without --strict-check
|
||||
--exec $INNOCHECKSUM $MYSQLD_DATADIR/test/tab1.ibd
|
||||
|
||||
--echo [2]: check the innochecksum with full form --strict-check=crc32
|
||||
--exec $INNOCHECKSUM --strict-check=crc32 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
|
||||
--echo [3]: check the innochecksum with short form -C crc32
|
||||
--exec $INNOCHECKSUM -C crc32 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
|
||||
--echo [4]: check the innochecksum with --no-check ignores algorithm check, warning is expected
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --no-check $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error: --no-check must be associated with --write option.;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo [5]: check the innochecksum with short form --no-check ignores algorithm check, warning is expected
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM -n $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error: --no-check must be associated with --write option.;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo [6]: check the innochecksum with full form strict-check & no-check , an error is expected
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --strict-check=innodb --no-check $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error: --strict-check option cannot be used together with --no-check option.;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo [7]: check the innochecksum with short form strict-check & no-check , an error is expected
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM -C innodb -n $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error: --strict-check option cannot be used together with --no-check option.;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo [8]: check the innochecksum with short & full form combination
|
||||
--echo # strict-check & no-check, an error is expected
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --strict-check=innodb -n $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error: --strict-check option cannot be used together with --no-check option.;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo [9]: check the innochecksum with full form --strict-check=innodb
|
||||
# Server Default checksum = crc32
|
||||
--exec $INNOCHECKSUM --strict-check=innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
|
||||
--echo [10]: check the innochecksum with full form --strict-check=none
|
||||
--echo # when server Default checksum=crc32
|
||||
--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
|
||||
--echo [11]: check the innochecksum with short form -C innodb
|
||||
--echo # when server Default checksum=crc32
|
||||
--exec $INNOCHECKSUM -C innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
|
||||
--echo [12]: check the innochecksum with short form -C none
|
||||
--echo # when server Default checksum=crc32
|
||||
--exec $INNOCHECKSUM -C none $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
|
||||
--echo [13]: check strict-check with invalid values
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --strict-check=strict_innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error while setting value \'strict_innodb\' to \'strict-check\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM -C strict_innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error while setting value \'strict_innodb\' to \'strict-check\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --strict-check=strict_crc32 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error while setting value \'strict_crc32\' to \'strict-check\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM -C strict_crc32 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error while setting value \'strict_crc32\' to \'strict-check\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --strict-check=strict_none $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error while setting value \'strict_none\' to \'strict-check\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM -C strict_none $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error while setting value \'strict_none\' to \'strict-check\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --strict-check=InnoBD $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error while setting value \'InnoBD\' to \'strict-check\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM -C InnoBD $MYSQLD_DATADIR/test/tab1.ibd 2>$SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error while setting value \'InnoBD\' to \'strict-check\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --strict-check=crc $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error while setting value \'crc\' to \'strict-check\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --strict-check=no $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error while setting value \'no\' to \'strict-check\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo [14a]: when server default checksum=crc32 rewrite new checksum=crc32 with innochecksum
|
||||
--echo # Also check the long form of write option.
|
||||
--exec $INNOCHECKSUM --strict-check=crc32 --write=crc32 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --strict-check=crc32 --write=crc32 $MYSQLD_DATADIR/test/t1.ibd
|
||||
# Rewrite done, verify with --strict-check=crc32
|
||||
--exec $INNOCHECKSUM --strict-check=crc32 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --strict-check=crc32 $MYSQLD_DATADIR/test/t1.ibd
|
||||
|
||||
--echo [14b]: when server default checksum=crc32 rewrite new checksum=innodb with innochecksum
|
||||
--echo # Also check the long form of write option.
|
||||
--exec $INNOCHECKSUM --no-check --write=innodb $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --strict-check=crc32 --write=innodb $MYSQLD_DATADIR/test/t1.ibd
|
||||
# Rewrite done, verify with --strict-check=innodb
|
||||
--exec $INNOCHECKSUM --strict-check=innodb $MYSQLD_DATADIR/test/tab1.ibd
|
||||
|
||||
--echo # start the server with innodb_checksum_algorithm=InnoDB
|
||||
--let restart_options= : --innodb_checksum_algorithm=innodb
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
INSERT INTO tab1 VALUES(2, 'Innochecksum CRC32');
|
||||
SELECT c1,c2 FROM tab1 order by c1,c2;
|
||||
|
||||
--echo # Stop the server
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo [15]: when server default checksum=crc32 rewrite new checksum=none with innochecksum
|
||||
--echo # Also check the short form of write option.
|
||||
--exec $INNOCHECKSUM --no-check -w none $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --no-check -w none $MYSQLD_DATADIR/test/t1.ibd
|
||||
# Rewrite done, verify with --strict-check=none
|
||||
--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/t1.ibd
|
||||
|
||||
--echo # Start the server with checksum algorithm=none
|
||||
--let restart_options= : --innodb_checksum_algorithm=none
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
INSERT INTO tab1 VALUES(3, 'Innochecksum None');
|
||||
SELECT c1,c2 FROM tab1 order by c1,c2;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # Stop the server
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo [16]: rewrite into new checksum=crc32 with innochecksum
|
||||
--exec $INNOCHECKSUM --no-check --write=crc32 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
|
||||
--echo # Restart the DB server with innodb_checksum_algorithm=crc32
|
||||
--let restart_options= : --innodb_checksum_algorithm=crc32 --innodb_file_per_table=on
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
SELECT * FROM tab1;
|
||||
DELETE FROM tab1 where c1=3;
|
||||
SELECT c1,c2 FROM tab1 order by c1,c2;
|
||||
|
||||
--echo # Stop server
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo [17]: rewrite into new checksum=InnoDB
|
||||
--exec $INNOCHECKSUM --no-check --write=InnoDB $MYSQLD_DATADIR/test/tab1.ibd
|
||||
|
||||
--echo # Restart the DB server with innodb_checksum_algorithm=InnoDB
|
||||
--let restart_options= : --innodb_checksum_algorithm=innodb --innodb_file_per_table=on
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
DELETE FROM tab1 where c1=2;
|
||||
SELECT * FROM tab1;
|
||||
|
||||
--echo # Stop server
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo [18]:check Innochecksum with invalid write options
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --no-check --write=strict_crc32 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN=Error while setting value \'strict_crc32\' to \'write\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --no-check --write=strict_innodb $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN=Error while setting value \'strict_innodb\' to \'write\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --no-check --write=crc23 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN=Error while setting value \'crc23\' to \'write\';
|
||||
--source include/search_pattern_in_file.inc
|
||||
--remove_file $SEARCH_FILE
|
||||
|
||||
# Cleanup
|
||||
--echo # Restart the server
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
DROP TABLE tab1;
|
||||
SET GLOBAL innodb_file_per_table=default;
|
114
mysql-test/suite/innodb_zip/t/innochecksum_2.test
Normal file
114
mysql-test/suite/innodb_zip/t/innochecksum_2.test
Normal file
@ -0,0 +1,114 @@
|
||||
#************************************************************
|
||||
# WL6045:Improve Innochecksum
|
||||
#************************************************************
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_zip.inc
|
||||
|
||||
--source include/not_embedded.inc
|
||||
-- source include/big_test.inc
|
||||
|
||||
--disable_query_log
|
||||
# This warning occurs due to small buffer pool size(i.e. 8MB). It doesn't occur
|
||||
# with --mysqld=--innodb_buffer_pool_size=10MB
|
||||
call mtr.add_suppression("\\[Warning\\] InnoDB: Difficult to find free blocks in the buffer pool.*");
|
||||
--enable_query_log
|
||||
let MYSQLD_BASEDIR= `SELECT @@basedir`;
|
||||
let MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
|
||||
|
||||
SET GLOBAL innodb_compression_level=0;
|
||||
SELECT @@innodb_compression_level;
|
||||
|
||||
CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||
INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
|
||||
let $i=10;
|
||||
while ($i > 0) {
|
||||
INSERT INTO t1 SELECT * from t1;
|
||||
dec $i;
|
||||
}
|
||||
|
||||
--echo # stop the server
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
# Page_type_dump for t1
|
||||
--exec $INNOCHECKSUM -v --page-type-dump $MYSQLTEST_VARDIR/tmp/dump.txt $MYSQLD_DATADIR/test/t1.ibd
|
||||
--file_exists $MYSQLTEST_VARDIR/tmp/dump.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/dump.txt
|
||||
|
||||
--echo [1]:# check the both short and long options for "help"
|
||||
--exec $INNOCHECKSUM --help $MYSQLD_DATADIR/test/t1.ibd > $MYSQLTEST_VARDIR/tmp/help_output_long.txt
|
||||
--exec $INNOCHECKSUM -I $MYSQLD_DATADIR/test/t1.ibd > $MYSQLTEST_VARDIR/tmp/help_output_short.txt
|
||||
--diff_files $MYSQLTEST_VARDIR/tmp/help_output_long.txt $MYSQLTEST_VARDIR/tmp/help_output_short.txt
|
||||
|
||||
--echo [2]:# Run the innochecksum when file isn't provided.
|
||||
--echo # It will print the innochecksum usage similar to --help option.
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM > $MYSQLTEST_VARDIR/tmp/usage.txt
|
||||
--diff_files $MYSQLTEST_VARDIR/tmp/help_output_long.txt $MYSQLTEST_VARDIR/tmp/usage.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/usage.txt
|
||||
|
||||
perl;
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Copy;
|
||||
my $dir = $ENV{'MYSQLTEST_VARDIR'};
|
||||
my $file= 'help_output_long.txt';
|
||||
# open file in write mode
|
||||
open IN_FILE,"<", "$dir/tmp/$file" or die $!;
|
||||
open OUT_FILE, ">", "$dir/tmp/tmpfile" or die $!;
|
||||
while(<IN_FILE>) {
|
||||
unless ($_=~ /^debug.*$/ || $_=~ /\-#, \-\-debug.*$/ || $_=~ /http:.*html/) {
|
||||
$_=~ s/^\S*innochecksum.+Ver.+[0-9]*\.[0-9]*\.[0-9]*.+$/innochecksum Ver #.#.#/g;
|
||||
$_=~ s/(Copyright\s\(c\))\s([0-9]*),\s([0-9]*)(.*)/$1 YEAR, YEAR $4/g;
|
||||
$_=~ s/Usage:.*\[-c/Usage: innochecksum [-c/g;
|
||||
print OUT_FILE $_;
|
||||
}
|
||||
}
|
||||
close(IN_FILE);
|
||||
close(OUT_FILE);
|
||||
# move the new content from tmp file to the orginal file.
|
||||
move ("$dir/tmp/tmpfile", "$dir/tmp/$file");
|
||||
EOF
|
||||
|
||||
--cat_file $MYSQLTEST_VARDIR/tmp/help_output_long.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/help_output_long.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/help_output_short.txt
|
||||
|
||||
--echo [3]:# check the both short and long options for "count" and exit
|
||||
--replace_regex /[0-9]+/#/
|
||||
--exec $INNOCHECKSUM --count $MYSQLD_DATADIR/test/t1.ibd
|
||||
--replace_regex /[0-9]+/#/
|
||||
--exec $INNOCHECKSUM -c $MYSQLD_DATADIR/test/t1.ibd
|
||||
|
||||
--echo [4]:# Print the version of innochecksum and exit
|
||||
--replace_regex /.*innochecksum.*Ver.*[0-9]*.[0-9]*.[0-9]*.*/innochecksum Ver #.#.#/
|
||||
--exec $INNOCHECKSUM -V $MYSQLD_DATADIR/test/t1.ibd
|
||||
|
||||
--echo # Restart the DB server
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo [5]:# Check the innochecksum for compressed table t1 with different key_block_size
|
||||
--echo # Test for KEY_BLOCK_SIZE=1
|
||||
--let $size=1
|
||||
--source ../include/innodb-wl6045.inc
|
||||
|
||||
--echo # Test for KEY_BLOCK_SIZE=2
|
||||
--let $size=2
|
||||
--source ../include/innodb-wl6045.inc
|
||||
|
||||
--echo # Test for for KEY_BLOCK_SIZE=4
|
||||
--let $size=4
|
||||
--source ../include/innodb-wl6045.inc
|
||||
|
||||
set innodb_strict_mode=off;
|
||||
--echo # Test for for KEY_BLOCK_SIZE=8
|
||||
--let $size=8
|
||||
--source ../include/innodb-wl6045.inc
|
||||
|
||||
set innodb_strict_mode=off;
|
||||
--echo # Test for KEY_BLOCK_SIZE=16
|
||||
--let $size=16
|
||||
--source ../include/innodb-wl6045.inc
|
||||
--echo # Test[5] completed
|
378
mysql-test/suite/innodb_zip/t/innochecksum_3.test
Normal file
378
mysql-test/suite/innodb_zip/t/innochecksum_3.test
Normal file
@ -0,0 +1,378 @@
|
||||
#************************************************************
|
||||
# WL6045:Improve Innochecksum
|
||||
#************************************************************
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_zip.inc
|
||||
|
||||
# Valgrind would complain about memory leaks when we crash on purpose.
|
||||
--source include/not_valgrind.inc
|
||||
|
||||
# Embedded server does not support crashing.
|
||||
--source include/not_embedded.inc
|
||||
|
||||
# Avoid CrashReporter popup on Mac.
|
||||
--source include/not_crashrep.inc
|
||||
|
||||
--echo # Set the environmental variables
|
||||
let MYSQLD_BASEDIR= `SELECT @@basedir`;
|
||||
let MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
|
||||
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
|
||||
|
||||
SET GLOBAL innodb_file_per_table=on;
|
||||
|
||||
--echo [1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server.
|
||||
|
||||
CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY,
|
||||
linestring_key GEOMETRY NOT NULL,
|
||||
linestring_nokey GEOMETRY NOT NULL)
|
||||
ENGINE=InnoDB ;
|
||||
|
||||
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
|
||||
VALUES (1, ST_GeomFromText('POINT(10 10) '), ST_GeomFromText('POINT(10 10) '));
|
||||
|
||||
CREATE INDEX linestring_index ON tab1(linestring_nokey(5));
|
||||
ALTER TABLE tab1 ADD KEY (linestring_key(5));
|
||||
|
||||
--echo # create a compressed table
|
||||
CREATE TABLE tab2(col_1 CHAR (255) ,
|
||||
col_2 VARCHAR (255), col_3 longtext,
|
||||
col_4 longtext,col_5 longtext,
|
||||
col_6 longtext , col_7 int )
|
||||
engine = innodb row_format=compressed key_block_size=4;
|
||||
|
||||
CREATE INDEX idx1 ON tab2(col_3(10));
|
||||
CREATE INDEX idx2 ON tab2(col_4(10));
|
||||
CREATE INDEX idx3 ON tab2(col_5(10));
|
||||
|
||||
# load the with repeat function
|
||||
SET @col_1 = repeat('a', 5);
|
||||
SET @col_2 = repeat('b', 20);
|
||||
SET @col_3 = repeat('c', 100);
|
||||
SET @col_4 = repeat('d', 100);
|
||||
SET @col_5 = repeat('e', 100);
|
||||
SET @col_6 = repeat('f', 100);
|
||||
|
||||
# insert 5 records
|
||||
let $i = 5;
|
||||
while ($i) {
|
||||
eval INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
|
||||
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,$i);
|
||||
dec $i;
|
||||
}
|
||||
|
||||
--disable_result_log
|
||||
SELECT * FROM tab2 ORDER BY col_7;
|
||||
|
||||
--echo # stop the server
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo [1(a)]: Rewrite into new checksum=InnoDB for all *.ibd file and ibdata1
|
||||
--exec $INNOCHECKSUM --write=InnoDB $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --write=InnoDB $MYSQLD_DATADIR/test/tab2.ibd
|
||||
--exec $INNOCHECKSUM --write=InnoDB $MYSQLD_DATADIR/ibdata1
|
||||
perl;
|
||||
foreach (glob("$ENV{MYSQLD_DATADIR}/*/*.ibd")) {
|
||||
system("$ENV{INNOCHECKSUM} --no-check --write=InnoDB $_")
|
||||
}
|
||||
EOF
|
||||
|
||||
--echo : start the server with innodb_checksum_algorithm=strict_innodb
|
||||
--let restart_options= : --innodb_checksum_algorithm=strict_innodb --default_storage_engine=InnoDB
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
|
||||
VALUES (2, ST_GeomFromText('LINESTRING(10 10,20 20,30 30)'), ST_GeomFromText('LINESTRING(10 10,20 20,30 30)'));
|
||||
|
||||
# load the with repeat function
|
||||
SET @col_1 = repeat('a', 5);
|
||||
SET @col_2 = repeat('b', 20);
|
||||
SET @col_3 = repeat('c', 100);
|
||||
SET @col_4 = repeat('d', 100);
|
||||
SET @col_5 = repeat('e', 100);
|
||||
SET @col_6 = repeat('f', 100);
|
||||
|
||||
# check the table status is GOOD with DML
|
||||
let $i = 6;
|
||||
eval INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
|
||||
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,$i);
|
||||
|
||||
-- disable_result_log
|
||||
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
|
||||
FROM tab1 ORDER BY pk;
|
||||
|
||||
-- disable_result_log
|
||||
SELECT * FROM tab2 ORDER BY col_7;
|
||||
|
||||
--echo # stop the server
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo [1(b)]: Rewrite into new checksum=crc32 for all *.ibd file and ibdata1
|
||||
--exec $INNOCHECKSUM --write=CRC32 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --write=CRC32 $MYSQLD_DATADIR/test/tab2.ibd
|
||||
--exec $INNOCHECKSUM --write=CRC32 $MYSQLD_DATADIR/ibdata1
|
||||
perl;
|
||||
foreach (glob("$ENV{MYSQLD_DATADIR}/*/*.ibd")) {
|
||||
system("$ENV{INNOCHECKSUM} --no-check --write=crc32 $_")
|
||||
}
|
||||
EOF
|
||||
|
||||
--echo # start the server with innodb_checksum_algorithm=strict_crc32
|
||||
--let restart_options= : --innodb_checksum_algorithm=strict_crc32 --default_storage_engine=InnoDB
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
# check the table status is GOOD with DML
|
||||
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
|
||||
VALUES (3, ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 40,10 10))'),
|
||||
ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 40,10 10))'));
|
||||
|
||||
# load the with repeat function
|
||||
SET @col_1 = repeat('g', 5);
|
||||
SET @col_2 = repeat('h', 20);
|
||||
SET @col_3 = repeat('i', 100);
|
||||
SET @col_4 = repeat('j', 100);
|
||||
SET @col_5 = repeat('k', 100);
|
||||
SET @col_6 = repeat('l', 100);
|
||||
|
||||
# check the table status is GOOD with DML
|
||||
let $i = 7;
|
||||
eval INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
|
||||
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,$i);
|
||||
|
||||
# check the records from table
|
||||
-- disable_result_log
|
||||
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
|
||||
FROM tab1 ORDER BY pk;
|
||||
|
||||
-- disable_result_log
|
||||
SELECT * FROM tab2 ORDER BY col_7;
|
||||
|
||||
--echo # stop the server
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo [1(c)]: Rewrite into new checksum=none for all *.ibd file and ibdata1
|
||||
--exec $INNOCHECKSUM --write=none $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --write=none $MYSQLD_DATADIR/test/tab2.ibd
|
||||
--exec $INNOCHECKSUM --write=none $MYSQLD_DATADIR/ibdata1
|
||||
perl;
|
||||
foreach (glob("$ENV{MYSQLD_DATADIR}/undo*")) {
|
||||
system("$ENV{INNOCHECKSUM} --no-check --write=NONE $_")
|
||||
}
|
||||
foreach (glob("$ENV{MYSQLD_DATADIR}/*/*.ibd")) {
|
||||
system("$ENV{INNOCHECKSUM} --no-check --write=NONE $_")
|
||||
}
|
||||
EOF
|
||||
|
||||
let $restart_parameters = restart: --innodb_checksum_algorithm=strict_none --default_storage_engine=InnoDB;
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
# check the table status is GOOD with DML
|
||||
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
|
||||
VALUES (4, ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) '), ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) '));
|
||||
|
||||
# load the with repeat function
|
||||
SET @col_1 = repeat('m', 5);
|
||||
SET @col_2 = repeat('n', 20);
|
||||
SET @col_3 = repeat('o', 100);
|
||||
SET @col_4 = repeat('p', 100);
|
||||
SET @col_5 = repeat('q', 100);
|
||||
SET @col_6 = repeat('r', 100);
|
||||
|
||||
# check the table status is GOOD with DML
|
||||
let $i = 8;
|
||||
eval INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
|
||||
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,$i);
|
||||
|
||||
# check the records from table
|
||||
-- disable_result_log
|
||||
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
|
||||
FROM tab1 ORDER BY pk;
|
||||
|
||||
--disable_result_log
|
||||
SELECT * FROM tab2 ORDER BY col_7;
|
||||
--enable_result_log
|
||||
|
||||
--echo # stop the server
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo [2]: Check the page type summary with shortform for tab1.ibd
|
||||
--replace_regex /File.*.ibd/File::tab1.ibd/ /[0-9]+/#/
|
||||
--exec $INNOCHECKSUM -S $MYSQLD_DATADIR/test/tab1.ibd 2>$MYSQLTEST_VARDIR/tmp/page_summary_short.txt
|
||||
|
||||
--echo [3]: Check the page type summary with longform for tab1.ibd
|
||||
--replace_regex /File.*.ibd/File::tab1.ibd/ /[0-9]+/#/
|
||||
--exec $INNOCHECKSUM --page-type-summary $MYSQLD_DATADIR/test/tab1.ibd 2>$MYSQLTEST_VARDIR/tmp/page_summary_long.txt
|
||||
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/page_summary_short.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/page_summary_long.txt
|
||||
--echo [4]: Page type dump for with longform for tab1.ibd
|
||||
--exec $INNOCHECKSUM --page-type-dump $MYSQLTEST_VARDIR/tmp/dump.txt $MYSQLD_DATADIR/test/tab1.ibd
|
||||
|
||||
perl;
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Copy;
|
||||
my $dir = $ENV{'MYSQLTEST_VARDIR'};
|
||||
opendir(DIR, $dir) or die $!;
|
||||
my $file= 'dump.txt';
|
||||
# open file in write mode
|
||||
open IN_FILE,"<", "$dir/tmp/$file" or die $!;
|
||||
open OUT_FILE, ">", "$dir/tmp/tmpfile" or die $!;
|
||||
while(<IN_FILE>)
|
||||
{
|
||||
# Replace the intergers to # and complete file patht to file name only.
|
||||
$_=~ s/Filename.+/Filename::tab1.ibd/g;
|
||||
$_=~ s/\d+/#/g;
|
||||
print OUT_FILE $_;
|
||||
}
|
||||
close(IN_FILE);
|
||||
close(OUT_FILE);
|
||||
# move the new content from tmp file to the orginal file.
|
||||
move ("$dir/tmp/tmpfile", "$dir/tmp/$file");
|
||||
closedir(DIR);
|
||||
EOF
|
||||
|
||||
--echo # Print the contents stored in dump.txt
|
||||
cat_file $MYSQLTEST_VARDIR/tmp/dump.txt;
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/dump.txt
|
||||
|
||||
# Page type dump for ibdata1
|
||||
--exec $INNOCHECKSUM -v --page-type-dump $MYSQLTEST_VARDIR/tmp/dump.txt $MYSQLD_DATADIR/ibdata1
|
||||
--file_exists $MYSQLTEST_VARDIR/tmp/dump.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/dump.txt
|
||||
|
||||
--echo [5]: Page type dump for with shortform for tab1.ibd
|
||||
--exec $INNOCHECKSUM -D $MYSQLTEST_VARDIR/tmp/dump.txt $MYSQLD_DATADIR/test/tab1.ibd
|
||||
|
||||
perl;
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Copy;
|
||||
my $dir = $ENV{'MYSQLTEST_VARDIR'};
|
||||
opendir(DIR, $dir) or die $!;
|
||||
my $file= 'dump.txt';
|
||||
# open file in write mode
|
||||
open IN_FILE,"<", "$dir/tmp/$file" or die $!;
|
||||
open OUT_FILE, ">", "$dir/tmp/tmpfile" or die $!;
|
||||
while(<IN_FILE>)
|
||||
{
|
||||
# Replace teh intergers to # and complete file patht to file name only.
|
||||
$_=~ s/Filename.+/Filename::tab1.ibd/g;
|
||||
$_=~ s/\d+/#/g;
|
||||
print OUT_FILE $_;
|
||||
}
|
||||
close(IN_FILE);
|
||||
close(OUT_FILE);
|
||||
# move the new content from tmp file to the orginal file.
|
||||
move ("$dir/tmp/tmpfile", "$dir/tmp/$file");
|
||||
closedir(DIR);
|
||||
EOF
|
||||
|
||||
# Print the contents stored in dump.txt
|
||||
cat_file $MYSQLTEST_VARDIR/tmp/dump.txt;
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/dump.txt
|
||||
|
||||
--echo [6]: check the valid lower bound values for option
|
||||
--echo # allow-mismatches,page,start-page,end-page
|
||||
--exec $INNOCHECKSUM --allow-mismatches=0 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM -a 0 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --page=0 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM -p 0 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --start-page=0 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM -s 0 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --end-page=0 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM -e 0 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
|
||||
--echo [7]: check the negative values for option
|
||||
--echo # allow-mismatches,page,start-page,end-page.
|
||||
--echo # They will reset to zero for negative values.
|
||||
--echo # check the invalid lower bound values
|
||||
--exec $INNOCHECKSUM --allow-mismatches=-1 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM -a -1 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --page=-1 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM -p -1 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --start-page=-1 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM -s -1 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --end-page=-1 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM -e -1 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
|
||||
--echo [8]: check the valid upper bound values for
|
||||
--echo # both short and long options "allow-mismatches" and "end-page"
|
||||
|
||||
--exec $INNOCHECKSUM --allow-mismatches=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM -a 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM --end-page=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
--exec $INNOCHECKSUM -e 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd
|
||||
|
||||
--echo [9]: check the both short and long options "page" and "start-page" when
|
||||
--echo # seek value is larger than file size.
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --page=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM -p 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --start-page=18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM -s 18446744073709551615 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Error: Unable to seek to necessary offset: Invalid argument;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo [34]: check the invalid upper bound values for options, allow-mismatches, end-page, start-page and page.
|
||||
--echo # innochecksum will fail with error code: 1
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --allow-mismatches=18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM -a 18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --end-page=18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM -e 18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --page=18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM -p 18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM --start-page=18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM -s 18446744073709551616 $MYSQLD_DATADIR/test/tab1.ibd 2> $SEARCH_FILE
|
||||
let SEARCH_PATTERN= Incorrect unsigned integer value: '18446744073709551616';
|
||||
--source include/search_pattern_in_file.inc
|
||||
--remove_file $SEARCH_FILE
|
||||
|
||||
# Cleanup
|
||||
--echo # Restart the server
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
DROP TABLE tab1;
|
||||
DROP TABLE tab2;
|
||||
SET GLOBAL innodb_file_per_table=default;
|
1
mysql-test/suite/innodb_zip/t/innodb_bug36169.opt
Normal file
1
mysql-test/suite/innodb_zip/t/innodb_bug36169.opt
Normal file
@ -0,0 +1 @@
|
||||
--innodb_large_prefix=ON
|
@ -4,6 +4,8 @@
|
||||
# http://bugs.mysql.com/36169
|
||||
#
|
||||
|
||||
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size .* for a record on index leaf page.");
|
||||
|
||||
let $file_format=`select @@innodb_file_format`;
|
||||
let $file_per_table=`select @@innodb_file_per_table`;
|
||||
SET GLOBAL innodb_file_format='Barracuda';
|
||||
|
@ -5,7 +5,7 @@ let $file_per_table=`select @@innodb_file_per_table`;
|
||||
|
||||
SET GLOBAL innodb_file_format='Barracuda';
|
||||
SET GLOBAL innodb_file_per_table=on;
|
||||
|
||||
SET GLOBAL innodb_strict_mode=on;
|
||||
set old_alter_table=0;
|
||||
|
||||
CREATE TABLE bug53591(a text charset utf8 not null)
|
||||
@ -20,3 +20,4 @@ DROP TABLE bug53591;
|
||||
|
||||
EVAL SET GLOBAL innodb_file_format=$file_format;
|
||||
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
|
||||
SET GLOBAL innodb_strict_mode=DEFAULT;
|
||||
|
@ -4,6 +4,8 @@
|
||||
--source include/have_innodb_16k.inc
|
||||
SET default_storage_engine=InnoDB;
|
||||
|
||||
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
|
||||
|
||||
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`;
|
||||
@ -11,6 +13,7 @@ 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;
|
||||
set global innodb_strict_mode=1;
|
||||
|
||||
-- echo ### Test 1 ###
|
||||
# Create a table of DYNAMIC format, with a primary index of 1000 bytes in
|
||||
@ -365,9 +368,9 @@ 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 not null, primary key (a(1000))) row_format=COMPACT;
|
||||
|
||||
create table worklog5743(a TEXT);
|
||||
create table worklog5743(a TEXT) row_format=COMPACT;
|
||||
|
||||
# Excercise the column length check in ha_innobase::add_index()
|
||||
-- error ER_INDEX_COLUMN_TOO_LONG
|
||||
@ -428,6 +431,7 @@ 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;
|
||||
SET GLOBAL innodb_strict_mode = DEFAULT;
|
||||
--connection con1
|
||||
--disconnect con1
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
File diff suppressed because it is too large
Load Diff
3
mysql-test/suite/innodb_zip/t/large_blob-master.opt
Normal file
3
mysql-test/suite/innodb_zip/t/large_blob-master.opt
Normal file
@ -0,0 +1,3 @@
|
||||
--max_allowed_packet=200M
|
||||
--innodb_buffer_pool_size=10M
|
||||
--innodb_log_buffer_size=10M
|
122
mysql-test/suite/innodb_zip/t/large_blob.test
Normal file
122
mysql-test/suite/innodb_zip/t/large_blob.test
Normal file
@ -0,0 +1,122 @@
|
||||
--echo #
|
||||
--echo # This tests the use of large blobs in InnoDB.
|
||||
--echo #
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_nodebug.inc
|
||||
--source include/big_test.inc
|
||||
|
||||
--disable_query_log
|
||||
# These values can change during the test
|
||||
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
|
||||
|
||||
# Create a 20MB blob that does not compress easily.
|
||||
# 1000 Random characters is enough to keep compression low.
|
||||
set @alphabet="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
set @r=abs(rand()*52) + 1;
|
||||
set @blob=substr(@alphabet,@r,1);
|
||||
let $1=1000;
|
||||
while ($1 > 1)
|
||||
{
|
||||
set @r=abs(rand()*52) + 1;
|
||||
set @letter=substr(@alphabet,@r,1);
|
||||
set @blob=concat(@blob,@letter);
|
||||
dec $1;
|
||||
}
|
||||
# The loop above is extremely slow compared to repeat().
|
||||
set @longblob=repeat(@blob,200000);
|
||||
--enable_query_log
|
||||
|
||||
call mtr.add_suppression("InnoDB: Warning: a long semaphore wait");
|
||||
|
||||
SET GLOBAL innodb_file_per_table = OFF;
|
||||
|
||||
--echo #
|
||||
--echo # System tablespace, Row Format = Redundant
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
c1 INT DEFAULT NULL,
|
||||
c2 LONGBLOB NOT NULL,
|
||||
KEY k2 (c2(250), c1)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT;
|
||||
INSERT INTO t1 VALUES (1, '');
|
||||
UPDATE t1 SET c2=@longblob;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # System tablespace, Row Format = Compact
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
c1 INT DEFAULT NULL,
|
||||
c2 LONGBLOB NOT NULL,
|
||||
KEY k2 (c2(250), c1)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
|
||||
INSERT INTO t1 VALUES (1, '');
|
||||
UPDATE t1 SET c2=@longblob;
|
||||
DROP TABLE t1;
|
||||
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
|
||||
--echo #
|
||||
--echo # Separate tablespace, Row Format = Redundant
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
c1 INT DEFAULT NULL,
|
||||
c2 LONGBLOB NOT NULL,
|
||||
KEY k2 (c2(250), c1)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT;
|
||||
INSERT INTO t1 VALUES (1, '');
|
||||
UPDATE t1 SET c2=@longblob;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Separate tablespace, Row Format = Compact
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
c1 INT DEFAULT NULL,
|
||||
c2 LONGBLOB NOT NULL,
|
||||
KEY k2 (c2(250), c1)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
|
||||
INSERT INTO t1 VALUES (1, '');
|
||||
UPDATE t1 SET c2=@longblob;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Separate tablespace, Row Format = Compressed, Key Block Size = 2k
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
c1 INT DEFAULT NULL,
|
||||
c2 LONGBLOB NOT NULL,
|
||||
KEY k2 (c2(250), c1)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2;
|
||||
INSERT INTO t1 VALUES (1, '');
|
||||
UPDATE t1 SET c2=@longblob;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Separate tablespace, Row Format = Compressed, Key Block Size = 1k
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
c1 INT DEFAULT NULL,
|
||||
c2 LONGBLOB NOT NULL,
|
||||
KEY k2 (c2(250), c1)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1;
|
||||
INSERT INTO t1 VALUES (1, '');
|
||||
UPDATE t1 SET c2=@longblob;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Separate tablespace, Row Format = Dynamic
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
c1 INT DEFAULT NULL,
|
||||
c2 LONGBLOB NOT NULL,
|
||||
KEY k2 (c2(250), c1)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
|
||||
INSERT INTO t1 VALUES (1, '');
|
||||
UPDATE t1 SET c2=@longblob;
|
||||
DROP TABLE t1;
|
||||
|
||||
--disable_query_log
|
||||
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
|
||||
--enable_query_log
|
602
mysql-test/suite/innodb_zip/t/restart.test
Normal file
602
mysql-test/suite/innodb_zip/t/restart.test
Normal file
@ -0,0 +1,602 @@
|
||||
#
|
||||
# These test make sure that tables are visible after rebooting
|
||||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_zip.inc
|
||||
--source include/have_partition.inc
|
||||
--source include/not_embedded.inc
|
||||
SET default_storage_engine=InnoDB;
|
||||
LET $MYSQLD_DATADIR = `select @@datadir`;
|
||||
LET $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
|
||||
|
||||
--disable_query_log
|
||||
# This error is expected in the error log for this test.
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: Error number 17 means 'File exists'");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number (17|80) in a file operation.");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot create file .*t55_restart.isl");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: The link file: .* already exists.");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot open datafile for read-only:");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 2 in a file operation.");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: The error means the system cannot find the path specified.");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.");
|
||||
--enable_query_log
|
||||
|
||||
--echo #
|
||||
--echo # A series of tests to make sure tables are opened after restart.
|
||||
--echo # Bug#13357607 Compressed file-per-table tablespaces fail to open
|
||||
--echo #
|
||||
# This bug was introduced without a regression test failing since
|
||||
# there were no tests showing that tablespaces could be created and
|
||||
# then read after reboot.
|
||||
#
|
||||
|
||||
--disable_query_log
|
||||
let $MYSQL_DATA_DIR= `select @@datadir`;
|
||||
let $data_directory = DATA DIRECTORY='$MYSQL_TMP_DIR/alt_dir';
|
||||
|
||||
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
|
||||
--enable_query_log
|
||||
|
||||
set global innodb_file_per_table=on;
|
||||
|
||||
--echo #
|
||||
--echo # Create and insert records into a REDUNDANT row formatted table.
|
||||
--echo #
|
||||
CREATE TABLE t1_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
||||
ROW_FORMAT=REDUNDANT ENGINE=InnoDB;
|
||||
INSERT INTO t1_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
||||
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
|
||||
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
|
||||
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
|
||||
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
|
||||
SHOW CREATE TABLE t1_restart;
|
||||
SELECT count(*) FROM t1_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Create and insert records into a COMPACT row formatted table.
|
||||
--echo #
|
||||
CREATE TABLE t2_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
||||
ROW_FORMAT=COMPACT ENGINE=InnoDB;
|
||||
INSERT INTO t2_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
||||
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
SHOW CREATE TABLE t2_restart;
|
||||
SELECT count(*) FROM t2_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Create and insert records into a COMPRESSED row formatted table.
|
||||
--echo #
|
||||
CREATE TABLE t3_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
||||
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 ENGINE=InnoDB;
|
||||
INSERT INTO t3_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
||||
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
|
||||
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
|
||||
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
|
||||
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
|
||||
SHOW CREATE TABLE t3_restart;
|
||||
SELECT count(*) FROM t3_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Create and insert records into a DYNAMIC row formatted table.
|
||||
--echo #
|
||||
CREATE TABLE t4_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
||||
ROW_FORMAT=DYNAMIC ENGINE=InnoDB;
|
||||
INSERT INTO t4_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
||||
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
||||
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
||||
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
||||
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
||||
SHOW CREATE TABLE t4_restart;
|
||||
SELECT count(*) FROM t4_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Create and insert records into a table that uses a remote DATA DIRECTORY.
|
||||
--echo #
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
eval CREATE TABLE t5_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
||||
ROW_FORMAT=DYNAMIC ENGINE=InnoDB $data_directory;
|
||||
INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
||||
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
||||
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
||||
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
||||
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t5_restart;
|
||||
SELECT count(*) FROM t5_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Create and insert records into a partitioned table that uses
|
||||
--echo # a remote DATA DIRECTORY for each partition.
|
||||
--echo #
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
eval CREATE TABLE t6_restart(
|
||||
c1 INT AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
||||
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 ENGINE=InnoDB
|
||||
PARTITION BY HASH(c1) (
|
||||
PARTITION p0 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir',
|
||||
PARTITION p1 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir',
|
||||
PARTITION p2 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir');
|
||||
INSERT INTO t6_restart VALUES (0, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
||||
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
|
||||
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
|
||||
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
|
||||
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t6_restart;
|
||||
SELECT count(*) FROM t6_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Create and insert records into a subpartitioned table that uses
|
||||
--echo # a remote DATA DIRECTORY for each subpartition.
|
||||
--echo #
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
eval CREATE TABLE t7_restart(
|
||||
c1 INT AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
||||
ROW_FORMAT=DYNAMIC ENGINE=InnoDB
|
||||
PARTITION BY RANGE(c1) SUBPARTITION BY HASH(c1) (
|
||||
PARTITION p0 VALUES LESS THAN (10) (
|
||||
SUBPARTITION s0 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir',
|
||||
SUBPARTITION s1 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir'),
|
||||
PARTITION p1 VALUES LESS THAN MAXVALUE (
|
||||
SUBPARTITION s2 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir',
|
||||
SUBPARTITION s3 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir'));
|
||||
INSERT INTO t7_restart VALUES (0, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
||||
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
|
||||
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
|
||||
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
|
||||
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t7_restart;
|
||||
SELECT count(*) FROM t7_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Create and insert records into a table that uses a general tablespace.
|
||||
--echo #
|
||||
CREATE TABLESPACE s1_restart ADD DATAFILE 's1_restart.ibd';
|
||||
CREATE TABLE t8_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
||||
ROW_FORMAT=COMPACT ENGINE=InnoDB TABLESPACE=s1_restart;
|
||||
INSERT INTO t8_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
||||
INSERT INTO t8_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
INSERT INTO t8_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
INSERT INTO t8_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
INSERT INTO t8_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
SHOW CREATE TABLE t8_restart;
|
||||
SELECT count(*) FROM t8_restart;
|
||||
CREATE TABLE t9_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
||||
ROW_FORMAT=DYNAMIC ENGINE=InnoDB TABLESPACE=s1_restart;
|
||||
INSERT INTO t9_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
||||
INSERT INTO t9_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
INSERT INTO t9_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
INSERT INTO t9_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
INSERT INTO t9_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
SHOW CREATE TABLE t9_restart;
|
||||
SELECT count(*) FROM t9_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Show these tables in information_schema.
|
||||
--echo #
|
||||
--source suite/innodb/include/show_i_s_tables.inc
|
||||
--source suite/innodb/include/show_i_s_tablespaces.inc
|
||||
|
||||
--echo #
|
||||
--echo # Shutdown the server and list the tablespace OS files
|
||||
--echo #
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo ---- MYSQL_DATA_DIR/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_DATA_DIR/test
|
||||
--echo ---- MYSQL_TMP_DIR/alt_dir
|
||||
--list_files $MYSQL_TMP_DIR/alt_dir
|
||||
--echo ---- MYSQL_TMP_DIR/alt_dir/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_TMP_DIR/alt_dir/test
|
||||
|
||||
--echo #
|
||||
--echo # Start the server and show that tables are still visible and accessible.
|
||||
--echo #
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
SHOW VARIABLES LIKE 'innodb_file_per_table';
|
||||
SHOW CREATE TABLE t1_restart;
|
||||
SHOW CREATE TABLE t2_restart;
|
||||
SHOW CREATE TABLE t3_restart;
|
||||
SHOW CREATE TABLE t4_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t5_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t6_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t7_restart;
|
||||
SHOW CREATE TABLE t8_restart;
|
||||
SHOW CREATE TABLE t9_restart;
|
||||
|
||||
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
|
||||
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
||||
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
|
||||
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
||||
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
||||
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
|
||||
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
|
||||
INSERT INTO t8_restart (SELECT 0, c2, c3, c4, c5 FROM t8_restart);
|
||||
INSERT INTO t9_restart (SELECT 0, c2, c3, c4, c5 FROM t9_restart);
|
||||
|
||||
SELECT count(*) FROM t1_restart;
|
||||
SELECT count(*) FROM t2_restart;
|
||||
SELECT count(*) FROM t3_restart;
|
||||
SELECT count(*) FROM t4_restart;
|
||||
SELECT count(*) FROM t5_restart;
|
||||
SELECT count(*) FROM t6_restart;
|
||||
SELECT count(*) FROM t7_restart;
|
||||
SELECT count(*) FROM t8_restart;
|
||||
SELECT count(*) FROM t9_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Show these tables in information_schema.
|
||||
--echo #
|
||||
--source suite/innodb/include/show_i_s_tables.inc
|
||||
--source suite/innodb/include/show_i_s_tablespaces.inc
|
||||
|
||||
DROP TABLE t1_restart;
|
||||
DROP TABLE t2_restart;
|
||||
DROP TABLE t3_restart;
|
||||
# Tablespace for t4_restart will be moved later from default directory to a new directory
|
||||
# and an ISL file will be created not using InnoDB.
|
||||
# Table t5_restart will be expanded.
|
||||
# Tables t6_restart and t7_restart will be truncated.
|
||||
DROP TABLE t8_restart;
|
||||
DROP TABLE t9_restart;
|
||||
DROP TABLESPACE s1_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Truncate the remote tablespaces.
|
||||
--echo #
|
||||
TRUNCATE TABLE t5_restart;
|
||||
ALTER TABLE t6_restart TRUNCATE PARTITION p2;
|
||||
ALTER TABLE t7_restart TRUNCATE PARTITION p1;
|
||||
|
||||
--source suite/innodb/include/show_i_s_tablespaces.inc
|
||||
|
||||
INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
||||
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
||||
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
||||
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
||||
|
||||
SELECT count(*) FROM t5_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t5_restart;
|
||||
|
||||
SELECT count(*) FROM t6_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t6_restart;
|
||||
|
||||
SELECT count(*) FROM t7_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t7_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Shutdown the server and make a backup of a tablespace
|
||||
--echo #
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd $MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd.bak
|
||||
--copy_file $MYSQL_DATA_DIR/test/t5_restart.isl $MYSQL_DATA_DIR/test/t5_restart.isl.bak
|
||||
--copy_file $MYSQL_DATA_DIR/test/t5_restart.frm $MYSQL_DATA_DIR/test/t5_restart.frm.bak
|
||||
|
||||
--echo ---- MYSQL_DATA_DIR/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_DATA_DIR/test
|
||||
--echo ---- MYSQL_TMP_DIR/alt_dir/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_TMP_DIR/alt_dir/test
|
||||
|
||||
--echo #
|
||||
--echo # Start the server and show the tablespaces.
|
||||
--echo #
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
SHOW VARIABLES LIKE 'innodb_file_per_table';
|
||||
|
||||
--source suite/innodb/include/show_i_s_tablespaces.inc
|
||||
|
||||
SELECT count(*) FROM t5_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t5_restart;
|
||||
|
||||
SELECT count(*) FROM t6_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t6_restart;
|
||||
|
||||
SELECT count(*) FROM t7_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t7_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Try to rename a tablespace to a file that already exists
|
||||
--echo #
|
||||
|
||||
--copy_file $MYSQL_DATA_DIR/test/t5_restart.frm.bak $MYSQL_DATA_DIR/test/t55_restart.frm
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
RENAME TABLE t5_restart TO t55_restart;
|
||||
--remove_file $MYSQL_DATA_DIR/test/t55_restart.frm
|
||||
--remove_file $MYSQL_DATA_DIR/test/t5_restart.frm.bak
|
||||
|
||||
--copy_file $MYSQL_DATA_DIR/test/t5_restart.isl.bak $MYSQL_DATA_DIR/test/t55_restart.isl
|
||||
--error ER_ERROR_ON_RENAME
|
||||
RENAME TABLE t5_restart TO t55_restart;
|
||||
--remove_file $MYSQL_DATA_DIR/test/t55_restart.isl
|
||||
--remove_file $MYSQL_DATA_DIR/test/t5_restart.isl.bak
|
||||
|
||||
#--copy_file $MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd.bak $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd
|
||||
# This RENAME TABLE works of Linux but gets ER_ERROR_ON_RENAME on Windows
|
||||
#--error ER_ERROR_ON_RENAME
|
||||
#RENAME TABLE t5_restart TO t55_restart;
|
||||
#--remove_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd.bak
|
||||
|
||||
--echo ---- MYSQL_DATA_DIR/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_DATA_DIR/test
|
||||
--echo ---- MYSQL_TMP_DIR/alt_dir/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_TMP_DIR/alt_dir/test
|
||||
|
||||
--echo #
|
||||
--echo # Rename file table and tablespace
|
||||
--echo #
|
||||
|
||||
RENAME TABLE t5_restart TO t55_restart;
|
||||
RENAME TABLE t6_restart TO t66_restart;
|
||||
RENAME TABLE t7_restart TO t77_restart;
|
||||
|
||||
--source suite/innodb/include/show_i_s_tablespaces.inc
|
||||
|
||||
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
|
||||
SELECT count(*) FROM t55_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t55_restart;
|
||||
|
||||
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
|
||||
SELECT count(*) FROM t66_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t66_restart;
|
||||
|
||||
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
|
||||
SELECT count(*) FROM t77_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t77_restart;
|
||||
|
||||
--echo ---- MYSQL_DATA_DIR/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_DATA_DIR/test
|
||||
--echo ---- MYSQL_TMP_DIR/alt_dir/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_TMP_DIR/alt_dir/test
|
||||
|
||||
--echo #
|
||||
--echo # Restart the server
|
||||
--echo #
|
||||
--source include/restart_mysqld.inc
|
||||
SHOW VARIABLES LIKE 'innodb_file_per_table';
|
||||
|
||||
--source suite/innodb/include/show_i_s_tablespaces.inc
|
||||
|
||||
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
|
||||
SELECT count(*) FROM t55_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t55_restart;
|
||||
|
||||
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
|
||||
SELECT count(*) FROM t66_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t66_restart;
|
||||
|
||||
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
|
||||
SELECT count(*) FROM t77_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t77_restart;
|
||||
|
||||
--echo #
|
||||
--echo # Shutdown the server
|
||||
--echo #
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo #
|
||||
--echo # Move the remote tablespaces to a new location and change the ISL files
|
||||
--echo #
|
||||
--mkdir $MYSQL_TMP_DIR/new_dir
|
||||
--mkdir $MYSQL_TMP_DIR/new_dir/test
|
||||
--echo ---- MYSQL_DATA_DIR/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_DATA_DIR/test
|
||||
--echo ---- MYSQL_TMP_DIR/alt_dir/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_TMP_DIR/alt_dir/test
|
||||
--echo ---- MYSQL_TMP_DIR/new_dir/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_TMP_DIR/new_dir/test
|
||||
|
||||
--echo # Moving tablespace 't4_restart' from MYSQL_DATA_DIR to MYSQL_TMP_DIR/new_dir
|
||||
--copy_file $MYSQL_DATA_DIR/test/t4_restart.ibd $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd
|
||||
--remove_file $MYSQL_DATA_DIR/test/t4_restart.ibd
|
||||
--exec echo $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd > $MYSQL_DATA_DIR/test/t4_restart.isl
|
||||
|
||||
--echo # Moving tablespace 't55_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
|
||||
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd
|
||||
--remove_file $MYSQL_DATA_DIR/test/t55_restart.isl
|
||||
--exec echo $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd > $MYSQL_DATA_DIR/test/t55_restart.isl
|
||||
|
||||
--echo # Moving tablespace 't66_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
|
||||
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p0.ibd $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd
|
||||
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p1.ibd $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd
|
||||
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p2.ibd $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p0.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p1.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p2.ibd
|
||||
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl
|
||||
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl
|
||||
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl
|
||||
--exec echo $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd > $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl
|
||||
--exec echo $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd > $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl
|
||||
--exec echo $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd > $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl
|
||||
|
||||
--echo # Moving tablespace 't77_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
|
||||
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s0.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd
|
||||
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s1.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd
|
||||
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p1#SP#s2.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd
|
||||
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p1#SP#s3.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s0.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s1.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p1#SP#s2.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p1#SP#s3.ibd
|
||||
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.isl
|
||||
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl
|
||||
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl
|
||||
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl
|
||||
--exec echo $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd > $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.isl
|
||||
--exec echo $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd > $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl
|
||||
--exec echo $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd > $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl
|
||||
--exec echo $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd > $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl
|
||||
|
||||
--echo ---- MYSQL_DATA_DIR/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_DATA_DIR/test
|
||||
--echo ---- MYSQL_TMP_DIR/alt_dir/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_TMP_DIR/alt_dir/test
|
||||
--echo ---- MYSQL_TMP_DIR/new_dir/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_TMP_DIR/new_dir/test
|
||||
|
||||
--echo #
|
||||
--echo # Start the server and check tablespaces.
|
||||
--echo #
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
--source suite/innodb/include/show_i_s_tablespaces.inc
|
||||
|
||||
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
||||
SELECT count(*) FROM t4_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t4_restart;
|
||||
|
||||
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
|
||||
SELECT count(*) FROM t55_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t55_restart;
|
||||
|
||||
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
|
||||
SELECT count(*) FROM t66_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t66_restart;
|
||||
|
||||
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
|
||||
SELECT count(*) FROM t77_restart;
|
||||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||
SHOW CREATE TABLE t77_restart;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Shutdown the server
|
||||
--echo #
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo #
|
||||
--echo # Move the remote tablespaces back to the default datadir and delete the ISL file.
|
||||
--echo #
|
||||
|
||||
--echo ---- MYSQL_DATA_DIR/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_DATA_DIR/test
|
||||
--echo ---- MYSQL_TMP_DIR/new_dir/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_TMP_DIR/new_dir/test
|
||||
|
||||
--echo # Moving 't4_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
|
||||
--copy_file $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd $MYSQL_DATA_DIR/test/t4_restart.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd
|
||||
--remove_file $MYSQL_DATA_DIR/test/t4_restart.isl
|
||||
|
||||
--echo # Moving 't55_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
|
||||
--copy_file $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd $MYSQL_DATA_DIR/test/t55_restart.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd
|
||||
--remove_file $MYSQL_DATA_DIR/test/t55_restart.isl
|
||||
|
||||
--echo # Moving 't66_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
|
||||
--copy_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p0.ibd
|
||||
--copy_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p1.ibd
|
||||
--copy_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p2.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd
|
||||
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl
|
||||
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl
|
||||
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl
|
||||
|
||||
--echo # Moving 't77_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
|
||||
--copy_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.ibd
|
||||
--copy_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.ibd
|
||||
--copy_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.ibd
|
||||
--copy_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd
|
||||
--remove_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd
|
||||
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.isl
|
||||
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl
|
||||
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl
|
||||
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl
|
||||
|
||||
--echo ---- MYSQL_DATA_DIR/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_DATA_DIR/test
|
||||
--echo ---- MYSQL_TMP_DIR/new_dir/test
|
||||
--replace_result #P# #p# #SP# #sp#
|
||||
--list_files $MYSQL_TMP_DIR/new_dir/test
|
||||
|
||||
--echo #
|
||||
--echo # Start the server and check tablespaces.
|
||||
--echo #
|
||||
-- source include/start_mysqld.inc
|
||||
|
||||
--source suite/innodb/include/show_i_s_tablespaces.inc
|
||||
|
||||
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
||||
SELECT count(*) FROM t4_restart;
|
||||
SHOW CREATE TABLE t4_restart;
|
||||
|
||||
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
|
||||
SELECT count(*) FROM t55_restart;
|
||||
SHOW CREATE TABLE t55_restart;
|
||||
|
||||
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
|
||||
SELECT count(*) FROM t66_restart;
|
||||
SHOW CREATE TABLE t66_restart;
|
||||
|
||||
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
|
||||
SELECT count(*) FROM t77_restart;
|
||||
SHOW CREATE TABLE t77_restart;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup
|
||||
--echo #
|
||||
|
||||
DROP TABLE t4_restart;
|
||||
DROP TABLE t55_restart;
|
||||
DROP TABLE t66_restart;
|
||||
DROP TABLE t77_restart;
|
||||
|
||||
--rmdir $MYSQL_TMP_DIR/alt_dir/test
|
||||
--rmdir $MYSQL_TMP_DIR/alt_dir
|
||||
--rmdir $MYSQL_TMP_DIR/new_dir/test
|
||||
--rmdir $MYSQL_TMP_DIR/new_dir
|
||||
|
||||
-- disable_query_log
|
||||
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
|
||||
-- enable_query_log
|
||||
|
135
mysql-test/suite/innodb_zip/t/wl6344_compress_level.test
Normal file
135
mysql-test/suite/innodb_zip/t/wl6344_compress_level.test
Normal file
@ -0,0 +1,135 @@
|
||||
#*******************************************************************
|
||||
# This testcase is to test the funcitionality of wl#6344
|
||||
# When the innodb_compression_level=0 create a table with page size
|
||||
# 1K and load data
|
||||
# When the innodb_compression_level=9 create a table with page size
|
||||
# 1K and load data
|
||||
# compare the size of the both tables.
|
||||
# The size of the table when compression level=0 should be
|
||||
# greater than the
|
||||
# the size of the table when compression level=9
|
||||
#*******************************************************************
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_zip.inc
|
||||
|
||||
USE test;
|
||||
DROP TABLE IF EXISTS tab5;
|
||||
DROP TABLE IF EXISTS tab6;
|
||||
|
||||
--echo #set the other madatory flags before test starts
|
||||
SET GLOBAL Innodb_file_per_table=on;
|
||||
let $innodb_compression_level = `SELECT @@global.innodb_compression_level`;
|
||||
|
||||
--echo #set the compression level=0 (No compress)
|
||||
SET global innodb_compression_level=0;
|
||||
|
||||
-- echo #check the compression level and the compressed_pages is default
|
||||
SELECT @@innodb_compression_level;
|
||||
SELECT @@Innodb_file_per_table;
|
||||
|
||||
-- echo #create table with 1K block size
|
||||
CREATE TABLE tab5 (col_1 CHAR (255) ,
|
||||
col_2 VARCHAR (255), col_3 longtext,
|
||||
col_4 longtext,col_5 longtext,
|
||||
col_6 longtext , col_7 longtext ,
|
||||
col_8 longtext ,col_9 longtext ,
|
||||
col_10 longtext ,col_11 int auto_increment primary key)
|
||||
ENGINE = innodb ROW_FORMAT=compressed key_block_size=1;
|
||||
|
||||
-- echo #create indexes
|
||||
CREATE INDEX idx1 ON tab5(col_4(10));
|
||||
CREATE INDEX idx2 ON tab5(col_5(10));
|
||||
CREATE INDEX idx3 ON tab5(col_6(10));
|
||||
CREATE INDEX idx4 ON tab5(col_7(10));
|
||||
CREATE INDEX idx5 ON tab5(col_8(10));
|
||||
CREATE INDEX idx6 ON tab5(col_11);
|
||||
|
||||
--echo #load the with repeat function
|
||||
SET @col_1 = repeat('a', 100);
|
||||
SET @col_2 = repeat('b', 100);
|
||||
SET @col_3 = repeat('c', 100);
|
||||
SET @col_4 = repeat('d', 100);
|
||||
SET @col_5 = repeat('e', 100);
|
||||
SET @col_6 = repeat('f', 100);
|
||||
SET @col_7 = repeat('g', 100);
|
||||
SET @col_8 = repeat('h', 100);
|
||||
SET @col_9 = repeat('i', 100);
|
||||
SET @col_10 = repeat('j', 100);
|
||||
|
||||
--echo #insert 10 records
|
||||
let $i = 10;
|
||||
while ($i) {
|
||||
|
||||
eval INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
|
||||
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
|
||||
dec $i;
|
||||
|
||||
}
|
||||
|
||||
--echo #set the compression level=9 (High compress)
|
||||
SET global innodb_compression_level=9;
|
||||
|
||||
-- echo #create table with 1K block size
|
||||
CREATE TABLE tab6 (col_1 CHAR (255) ,
|
||||
col_2 VARCHAR (255), col_3 longtext,
|
||||
col_4 longtext,col_5 longtext,
|
||||
col_6 longtext , col_7 longtext ,
|
||||
col_8 longtext ,col_9 longtext ,
|
||||
col_10 longtext ,col_11 int auto_increment primary key)
|
||||
ENGINE = innodb ROW_FORMAT=compressed key_block_size=1;
|
||||
|
||||
-- echo #create indexes
|
||||
CREATE INDEX idx1 ON tab6(col_4(10));
|
||||
CREATE INDEX idx2 ON tab6(col_5(10));
|
||||
CREATE INDEX idx3 ON tab6(col_6(10));
|
||||
CREATE INDEX idx4 ON tab6(col_7(10));
|
||||
CREATE INDEX idx5 ON tab6(col_8(10));
|
||||
CREATE INDEX idx6 ON tab6(col_11);
|
||||
|
||||
--echo #load the with repeat function
|
||||
SET @col_1 = repeat('a', 100);
|
||||
SET @col_2 = repeat('b', 100);
|
||||
SET @col_3 = repeat('c', 100);
|
||||
SET @col_4 = repeat('d', 100);
|
||||
SET @col_5 = repeat('e', 100);
|
||||
SET @col_6 = repeat('f', 100);
|
||||
SET @col_7 = repeat('g', 100);
|
||||
SET @col_8 = repeat('h', 100);
|
||||
SET @col_9 = repeat('i', 100);
|
||||
SET @col_10 = repeat('j', 100);
|
||||
|
||||
--echo #insert 10 records
|
||||
let $i = 10;
|
||||
while ($i) {
|
||||
|
||||
eval INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
|
||||
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
|
||||
dec $i;
|
||||
}
|
||||
|
||||
-- echo #diff the sizes of the No compressed table and high compressed table
|
||||
SET @size=(SELECT
|
||||
(SELECT (SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024)
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_name='tab5' AND ENGINE='InnoDB' AND table_schema='test')
|
||||
-
|
||||
(SELECT SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_name='tab6' AND ENGINE='InnoDB' AND table_schema='test')
|
||||
FROM DUAL);
|
||||
|
||||
--echo #check the size of the table, it should not be Negative value
|
||||
--echo #The results of this query Test pass = 1 and fail=0
|
||||
SELECT @size >= 0;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup
|
||||
--echo #
|
||||
DROP TABLE tab5;
|
||||
DROP TABLE tab6;
|
||||
|
||||
--echo #reset back the compression_level to default.
|
||||
--disable_query_log
|
||||
eval SET GLOBAL innodb_compression_level=$innodb_compression_level;
|
||||
--enable_query_log
|
1337
mysql-test/suite/innodb_zip/t/wl6347_comp_indx_stat.test
Normal file
1337
mysql-test/suite/innodb_zip/t/wl6347_comp_indx_stat.test
Normal file
File diff suppressed because it is too large
Load Diff
60
mysql-test/suite/innodb_zip/t/wl6470_1.test
Normal file
60
mysql-test/suite/innodb_zip/t/wl6470_1.test
Normal file
@ -0,0 +1,60 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_zip.inc
|
||||
--source include/big_test.inc
|
||||
|
||||
####################################################################
|
||||
# TC to test temp-table DML optimization changes for correctness #
|
||||
# Sceanrio covered: #
|
||||
# 1. bulk-insert with rollback + commit: this will ensure btree #
|
||||
# node split with rollback and commit. #
|
||||
####################################################################
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
#
|
||||
# 1. bulk-insert with rollback + commit: this will ensure btree #
|
||||
# node split with rollback and commit. #
|
||||
#
|
||||
create temporary table t1
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc), index sec_index(c1)
|
||||
) engine = innodb;
|
||||
create temporary table t2
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc), index sec_index(c1)
|
||||
) engine = innodb;
|
||||
--source suite/innodb_zip/include/innodb_dml_ops.inc
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
#
|
||||
--disable_warnings
|
||||
create temporary table t1
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc), index sec_index(c1)
|
||||
) engine = innodb key_block_size = 4;
|
||||
set innodb_strict_mode=off;
|
||||
create temporary table t2
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc), index sec_index(c1)
|
||||
) engine = innodb key_block_size = 8;
|
||||
set innodb_strict_mode=default;
|
||||
--enable_warnings
|
||||
--source suite/innodb_zip/include/innodb_dml_ops.inc
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
#
|
||||
let $file_per_table = `select @@innodb_file_per_table`;
|
||||
set global innodb_file_per_table = 0;
|
||||
create temporary table t1
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc), index sec_index(c1)
|
||||
) engine = innodb;
|
||||
create temporary table t2
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc), index sec_index(c1)
|
||||
) engine = innodb;
|
||||
--source suite/innodb_zip/include/innodb_dml_ops.inc
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
eval set global innodb_file_per_table = $file_per_table;
|
||||
#
|
||||
|
468
mysql-test/suite/innodb_zip/t/wl6470_2.test
Normal file
468
mysql-test/suite/innodb_zip/t/wl6470_2.test
Normal file
@ -0,0 +1,468 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_zip.inc
|
||||
--source include/no_valgrind_without_big.inc
|
||||
|
||||
####################################################################
|
||||
# TC to test temp-table DML optimization changes for correctness #
|
||||
# Sceanrio covered in single testcase : #
|
||||
# - Tables with row format(redundant,compressed,dynamic,compact #
|
||||
# - Table with primary,composite,prefix,secondary index #
|
||||
# - Insert/delete/update with transactioons #
|
||||
# - Transaction with commit,rollback,savepoint statements #
|
||||
# - Concurrency by execution of two clients creating tables with #
|
||||
# same names #
|
||||
# - Inserting data using #
|
||||
# - Insert into .. , Load data infile..,insert ignore #
|
||||
# - Insert into .. on duplicate update #
|
||||
# - Check basic delete and upadte [ignore] #
|
||||
# - Check constraints like duplicate key,default value #
|
||||
# - Alter add column , add primary key #
|
||||
# - with prepare and execute statement #
|
||||
####################################################################
|
||||
|
||||
# run for page size >= 8k
|
||||
--disable_warnings
|
||||
if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value >= 8192`)
|
||||
{
|
||||
--skip Test requires InnoDB with page size >= 8k.
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
|
||||
# Save initial values of server variable
|
||||
--disable_query_log
|
||||
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
|
||||
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
--enable_query_log
|
||||
|
||||
# Create procedure to perform
|
||||
# 1. Create temp table with row types , index , sufficent data types
|
||||
# 2. Perform DML with transaction
|
||||
delimiter |;
|
||||
create procedure populate_tables()
|
||||
begin
|
||||
declare n int default 20;
|
||||
declare inner_loop int default 100;
|
||||
set global innodb_file_per_table=on;
|
||||
drop table if exists t1,t2,t3,t4;
|
||||
|
||||
create temporary table t1(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(6000) not null,
|
||||
c5 blob(6000) not null,
|
||||
c6 varchar(2000) not null,
|
||||
c7 varchar(2000) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb row_format=redundant;
|
||||
|
||||
create temporary table t2(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(6000) not null,
|
||||
c5 blob(6000) not null,
|
||||
c6 varchar(2000) not null,
|
||||
c7 varchar(2000) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb row_format=compact;
|
||||
|
||||
create temporary table t3(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(6000) not null,
|
||||
c5 blob(6000) not null,
|
||||
c6 varchar(2000) not null,
|
||||
c7 varchar(2000) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb row_format=compressed key_block_size=4;
|
||||
|
||||
create temporary table t4(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(6000) not null,
|
||||
c5 blob(6000) not null,
|
||||
c6 varchar(2000) not null,
|
||||
c7 varchar(2000) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb row_format=dynamic;
|
||||
|
||||
create temporary table t5(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(6000) not null,
|
||||
c5 blob(6000) not null,
|
||||
c6 varchar(2000) not null,
|
||||
c7 varchar(2000) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb;
|
||||
|
||||
create temporary table t6 ( a int ) engine = innodb;
|
||||
insert into t6 values (50),(100),(150),(190);
|
||||
|
||||
while (n > 0) do
|
||||
start transaction;
|
||||
insert into t1 values(n,n,repeat(concat(' tc3_',n),30),
|
||||
repeat(concat(' tc4_',n),800),repeat(concat(' tc_',n),800),
|
||||
repeat(concat(' tc6_',n),800),repeat(concat(' tc7_',n),800),
|
||||
now(),(100.55+n));
|
||||
insert into t2 values(n,n,repeat(concat(' tc3_',n),30),
|
||||
repeat(concat(' tc4_',n),800),repeat(concat(' tc_',n),800),
|
||||
repeat(concat(' tc6_',n),800),repeat(concat(' tc7_',n),800),
|
||||
now(),(100.55+n));
|
||||
insert into t3 values(n,n,repeat(concat(' tc3_',n),30),
|
||||
repeat(concat(' tc4_',n),800),repeat(concat(' tc_',n),800),
|
||||
repeat(concat(' tc6_',n),800),repeat(concat(' tc7_',n),800),
|
||||
now(),(100.55+n));
|
||||
insert into t4 values(n,n,repeat(concat(' tc3_',n),30),
|
||||
repeat(concat(' tc4_',n),800),repeat(concat(' tc_',n),800),
|
||||
repeat(concat(' tc6_',n),800),repeat(concat(' tc7_',n),800),
|
||||
now(),(100.55+n));
|
||||
insert into t5 values(n,n,repeat(concat(' tc3_',n),30),
|
||||
repeat(concat(' tc4_',n),800),repeat(concat(' tc_',n),800),
|
||||
repeat(concat(' tc6_',n),800),repeat(concat(' tc7_',n),800),
|
||||
now(),(100.55+n));
|
||||
|
||||
if (n > 10) then
|
||||
commit;
|
||||
else
|
||||
delete from t1 where c1 > 10 ;
|
||||
delete from t2 where c1 > 10 ;
|
||||
delete from t3 where c1 > 10 ;
|
||||
delete from t4 where c1 > 10 ;
|
||||
delete from t5 where c1 > 10 ;
|
||||
|
||||
rollback;
|
||||
start transaction;
|
||||
update t1 set c1 = c1 + 1000 where c1 > 10;
|
||||
update t2 set c1 = c1 + 1000 where c1 > 10;
|
||||
update t3 set c1 = c1 + 1000 where c1 > 10;
|
||||
update t4 set c1 = c1 + 1000 where c1 > 10;
|
||||
update t5 set c1 = c1 + 1000 where c1 > 10;
|
||||
rollback;
|
||||
end if;
|
||||
|
||||
start transaction;
|
||||
insert into t1 values(n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t2 values(n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t3 values(n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t4 values(n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t5 values(n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
|
||||
delete from t1 where c1 between 100 and 110;
|
||||
delete from t2 where c1 between 100 and 110;
|
||||
delete from t3 where c1 between 100 and 110;
|
||||
delete from t4 where c1 between 100 and 110;
|
||||
delete from t5 where c1 between 100 and 110;
|
||||
|
||||
update t1 set c1 = c1+1 where c1>110;
|
||||
update t2 set c1 = c1+1 where c1>110;
|
||||
update t3 set c1 = c1+1 where c1>110;
|
||||
update t4 set c1 = c1+1 where c1>110;
|
||||
update t5 set c1 = c1+1 where c1>110;
|
||||
|
||||
savepoint a;
|
||||
|
||||
insert into t1 values(300+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t2 values(300+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t3 values(300+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t4 values(300+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t5 values(300+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
savepoint b;
|
||||
|
||||
insert into t1 values(400+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t2 values(400+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t3 values(400+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t4 values(400+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t5 values(400+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
savepoint c;
|
||||
rollback to b;
|
||||
rollback to a;
|
||||
commit;
|
||||
commit;
|
||||
rollback;
|
||||
set n = n - 1;
|
||||
end while;
|
||||
end|
|
||||
delimiter ;|
|
||||
|
||||
# Create two client for concurrent execution
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
--echo #---client 1 : dml operation ---"
|
||||
connection con1;
|
||||
-- disable_query_log
|
||||
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
|
||||
-- enable_query_log
|
||||
-- disable_query_log
|
||||
# call procedure
|
||||
--send call populate_tables();
|
||||
-- enable_query_log
|
||||
|
||||
--echo #---client 2 : dml operation ---"
|
||||
connection con2;
|
||||
-- disable_query_log
|
||||
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
|
||||
-- enable_query_log
|
||||
-- disable_query_log
|
||||
# call procedure
|
||||
--send call populate_tables();
|
||||
-- enable_query_log
|
||||
|
||||
# check data of client connection 1
|
||||
--echo # In connection 1
|
||||
connection con1;
|
||||
--reap
|
||||
# 20 rows exepceted in 5 tables
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
select c1 from t1;
|
||||
select c1 from t2;
|
||||
select c1 from t3;
|
||||
select c1 from t4;
|
||||
select c1 from t5;
|
||||
# check data of client connection 2
|
||||
--echo # In connection 2
|
||||
connection con2;
|
||||
--reap
|
||||
# 20 rows exepceted in 5 tables
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
select c1 from t1;
|
||||
select c1 from t2;
|
||||
select c1 from t3;
|
||||
select c1 from t4;
|
||||
select c1 from t5;
|
||||
|
||||
--echo # In connection 1
|
||||
connection con1;
|
||||
|
||||
set autocommit = 0;
|
||||
# Check duplicate key constraint + insert ignore
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t1 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
insert ignore into t1 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t2 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
insert ignore into t2 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t3 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
insert ignore into t3 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t4 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
insert ignore into t4 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t5 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
insert ignore into t5 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
|
||||
# check rollback due to duplicate value in second record of insert
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t1 values (1,1,'a','a','a','a','a',now(),100.55),
|
||||
(20,1,'a','a','a','a','a',now(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t2 values (1,1,'a','a','a','a','a',now(),100.55),
|
||||
(20,1,'a','a','a','a','a',now(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t3 values (1,1,'a','a','a','a','a',now(),100.55),
|
||||
(20,1,'a','a','a','a','a',now(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t4 values (1,1,'a','a','a','a','a',now(),100.55),
|
||||
(20,1,'a','a','a','a','a',now(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t5 values (1,1,'a','a','a','a','a',now(),100.55),
|
||||
(20,1,'a','a','a','a','a',now(),100.55);
|
||||
|
||||
set autocommit = 1;
|
||||
|
||||
select c1,c2 from t1 where c1 in (20,1);
|
||||
select c1,c2 from t2 where c1 in (20,1);
|
||||
select c1,c2 from t3 where c1 in (20,1);
|
||||
select c1,c2 from t4 where c1 in (20,1);
|
||||
select c1,c2 from t5 where c1 in (20,1);
|
||||
|
||||
#replace statement
|
||||
replace into t1 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
replace into t2 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
replace into t3 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
replace into t4 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
replace into t5 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
# verify row is replaced from (20,20) to (20,1)
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9 from t1 where c1 = 20;
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9 from t2 where c1 = 20;
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9 from t3 where c1 = 20;
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9 from t4 where c1 = 20;
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9 from t5 where c1 = 20;
|
||||
|
||||
# Update ignore. statement is gonored as 20 value exits
|
||||
update ignore t1 set c1 = 20 where c1 = 140 ;
|
||||
update ignore t2 set c1 = 20 where c1 = 140 ;
|
||||
update ignore t3 set c1 = 20 where c1 = 140 ;
|
||||
update ignore t4 set c1 = 20 where c1 = 140 ;
|
||||
update ignore t5 set c1 = 20 where c1 = 140 ;
|
||||
# see record 140 is present as last update ignored
|
||||
select count(*) from t1 where c1 = 140;
|
||||
select count(*) from t2 where c1 = 140;
|
||||
select count(*) from t3 where c1 = 140;
|
||||
select count(*) from t4 where c1 = 140;
|
||||
select count(*) from t5 where c1 = 140;
|
||||
|
||||
# Load data infile
|
||||
--echo "running select * into outfile <file> from t1 ;
|
||||
--disable_query_log
|
||||
eval select * into outfile "$MYSQLTEST_VARDIR/tmp/t1.outfile" from t1;
|
||||
--enable_query_log
|
||||
# Create table as select
|
||||
create temporary table temp_1 engine = innodb as select * from t1 where 1=2;
|
||||
select count(*) from temp_1;
|
||||
--echo "running load data infile <file> into temp_1 ;
|
||||
--disable_query_log
|
||||
eval load data infile '$MYSQLTEST_VARDIR/tmp/t1.outfile' into table temp_1;
|
||||
--enable_query_log
|
||||
select count(*) from temp_1;
|
||||
|
||||
# Alter table to add column and primary key
|
||||
alter table temp_1 add column c10 int default 99 ,
|
||||
add column c11 varchar(100) default 'test';
|
||||
alter table temp_1 add primary key (c1);
|
||||
insert into temp_1 (c1,c2,c3,c4,c5,c6,c7,c8,c9) values (-1,-1,'a','a','a','a','a',now(),100.55);
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9,c10,c11 from temp_1 where c1 < 0;
|
||||
select count(*) from temp_1 where c10 = 99 and c11 like 'test';
|
||||
# insert on duplicate key update
|
||||
insert into temp_1 (c1,c2,c3,c4,c5,c6,c7,c8,c9) values (-1,-1,'a','a','a','a','a',now(),100.55)
|
||||
on duplicate key update c1=-2,c2=-2;
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9,c10,c11 from temp_1 where c1 < 0;
|
||||
|
||||
#cleanup
|
||||
drop table t1 ,t2 ,t3,t4,t5,t6,temp_1;
|
||||
disconnect con1;
|
||||
|
||||
connection con2;
|
||||
drop table t1 ,t2 ,t3,t4,t5,t6;
|
||||
disconnect con2;
|
||||
|
||||
connection default;
|
||||
drop procedure populate_tables;
|
||||
|
||||
|
||||
# case 2 - with prepare and execute
|
||||
let $prep_loop= 5;
|
||||
create temporary table prep_1(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(6000) not null,
|
||||
c5 blob(6000) not null,
|
||||
c6 varchar(2000) not null,
|
||||
c7 varchar(2000) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb;
|
||||
PREPARE stm FROM "insert into prep_1 values(?,?,repeat(concat(' tc3_',?),30),repeat(concat(' tc4_',?),800),repeat(concat(' tc_',?),800),repeat(concat(' tc6_',?),245),repeat(concat(' tc7_',?),245),now(),(100.55+?))";
|
||||
set @var = 5;
|
||||
set @var_static = 5;
|
||||
while ($prep_loop>0)
|
||||
{
|
||||
eval EXECUTE stm USING @var,@var,@var,@var,@var,@var,@var,@var;
|
||||
eval EXECUTE stm USING @var_static,@var_static,@var_static,@var_static,@var_static,@var_static,@var_static,@var_static;
|
||||
dec $prep_loop;
|
||||
set @var = @var - 1;
|
||||
}
|
||||
select c1,left(c3,15) from prep_1 order by c1 ;
|
||||
select count(*) from prep_1;
|
||||
|
||||
PREPARE stm_1 FROM "UPDATE prep_1 SET c1 = c1 + 1";
|
||||
EXECUTE stm_1;
|
||||
EXECUTE stm_1;
|
||||
select c1,left(c3,15) from prep_1 order by c1 ;
|
||||
select count(*) from prep_1;
|
||||
|
||||
PREPARE stm_2 FROM "DELETE FROM prep_1 ORDER BY c1 LIMIT 1";
|
||||
EXECUTE stm_2;
|
||||
EXECUTE stm_2;
|
||||
select c1,left(c3,15) from prep_1 order by c1 ;
|
||||
select count(*) from prep_1;
|
||||
|
||||
drop prepare stm;
|
||||
drop prepare stm_1;
|
||||
drop prepare stm_2;
|
||||
drop table prep_1;
|
||||
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/t1.outfile
|
||||
|
||||
-- disable_query_log
|
||||
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
|
||||
SET sql_mode = default;
|
||||
-- enable_query_log
|
||||
|
451
mysql-test/suite/innodb_zip/t/wl6501_1.test
Normal file
451
mysql-test/suite/innodb_zip/t/wl6501_1.test
Normal file
@ -0,0 +1,451 @@
|
||||
|
||||
####################################################################
|
||||
# TC to check truncate table statement atomicity for single #
|
||||
# tablespace #
|
||||
# Sceanrio covered: #
|
||||
# 1. Debug points added for worklog #
|
||||
# 2. Table with differnt row types #
|
||||
# 3. Transactional statement. #
|
||||
####################################################################
|
||||
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/big_test.inc
|
||||
--source include/have_innodb_16k.inc
|
||||
|
||||
# Valgrind would result in a "long semaphore wait" inside InnoDB
|
||||
--source include/not_valgrind.inc
|
||||
# Embedded server does not support crashing
|
||||
--source include/not_embedded.inc
|
||||
# Avoid CrashReporter popup on Mac
|
||||
--source include/not_crashrep.inc
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
--disable_query_log
|
||||
let $MYSQL_DATA_DIR= `select @@datadir`;
|
||||
let $data_directory = data directory='$MYSQL_TMP_DIR/alt_dir';
|
||||
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
|
||||
|
||||
call mtr.add_suppression("InnoDB.*table did not exist in the InnoDB data dictionary.*");
|
||||
call mtr.add_suppression("InnoDB: A page in the doublewrite buffer is not within space bounds.*");
|
||||
call mtr.add_suppression("InnoDB: Cannot create file.*");
|
||||
call mtr.add_suppression("InnoDB: Error number 17 means 'File exists'.*");
|
||||
call mtr.add_suppression("InnoDB: A page in the doublewrite buffer is not within space bounds");
|
||||
call mtr.add_suppression("InnoDB: Error: table .* does not exist in the InnoDB internal");
|
||||
--enable_query_log
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
set global innodb_file_per_table=on;
|
||||
--echo # Verify that 'TRUNCATE TABLE' statement works fine and the size
|
||||
--echo # of .ibd file is equal to the initial size after truncation.
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
drop table if exists t1,t2,t3,t4,t6;
|
||||
let $cnt = 6;
|
||||
while ($cnt) {
|
||||
|
||||
# table with basic data type + primary ,secondary,composite,prefix index
|
||||
create table t1(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(500) not null,
|
||||
c5 blob(500) not null,
|
||||
c6 varchar(500) not null,
|
||||
c7 varchar(500) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(5,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb row_format=redundant;
|
||||
|
||||
|
||||
create table t2(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(500) not null,
|
||||
c5 blob(500) not null,
|
||||
c6 varchar(500) not null,
|
||||
c7 varchar(500) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(5,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb row_format=compact;
|
||||
|
||||
|
||||
# with row type , key block size = 4K
|
||||
create table t3(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(500) not null,
|
||||
c5 blob(500) not null,
|
||||
c6 varchar(500) not null,
|
||||
c7 varchar(500) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(5,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb row_format=compressed key_block_size=4;
|
||||
|
||||
|
||||
create table t4(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(500) not null,
|
||||
c5 blob(500) not null,
|
||||
c6 varchar(500) not null,
|
||||
c7 varchar(500) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(5,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb row_format=dynamic;
|
||||
|
||||
|
||||
create temporary table t5(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(500) not null,
|
||||
c5 blob(500) not null,
|
||||
c6 varchar(500) not null,
|
||||
c7 varchar(500) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(5,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb;
|
||||
|
||||
create table t6 ( a int ) engine = innodb;
|
||||
insert into t6 values (50),(100),(150);
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
let $n=5;
|
||||
|
||||
# load created tables.
|
||||
while ($n)
|
||||
{
|
||||
start transaction;
|
||||
|
||||
eval insert ignore into t1 values(
|
||||
$n, $n,
|
||||
repeat(concat(' tc3_',$n), 42),
|
||||
repeat(concat(' tc4_',$n), 300),
|
||||
repeat(concat(' tc5_',$n), 300),
|
||||
repeat(concat(' tc6_',$n), 300),
|
||||
repeat(concat(' tc7_',$n), 300),
|
||||
now(), (100.55+$n));
|
||||
|
||||
eval insert ignore into t2 values(
|
||||
$n, $n,
|
||||
repeat(concat(' tc3_',$n), 42),
|
||||
repeat(concat(' tc4_',$n), 300),
|
||||
repeat(concat(' tc5_',$n), 300),
|
||||
repeat(concat(' tc6_',$n), 300),
|
||||
repeat(concat(' tc7_',$n), 300),
|
||||
now(), (100.55+$n));
|
||||
|
||||
eval insert ignore into t3 values(
|
||||
$n, $n,
|
||||
repeat(concat(' tc3_',$n), 42),
|
||||
repeat(concat(' tc4_',$n), 300),
|
||||
repeat(concat(' tc5_',$n), 300),
|
||||
repeat(concat(' tc6_',$n), 300),
|
||||
repeat(concat(' tc7_',$n), 300),
|
||||
now(), (100.55+$n));
|
||||
|
||||
eval insert ignore into t4 values(
|
||||
$n, $n,
|
||||
repeat(concat(' tc3_',$n), 42),
|
||||
repeat(concat(' tc4_',$n), 300),
|
||||
repeat(concat(' tc5_',$n), 300),
|
||||
repeat(concat(' tc6_',$n), 300),
|
||||
repeat(concat(' tc7_',$n), 300),
|
||||
now(), (100.55+$n));
|
||||
|
||||
eval insert ignore into t5 values(
|
||||
$n, $n,
|
||||
repeat(concat(' tc3_',$n), 42),
|
||||
repeat(concat(' tc4_',$n), 300),
|
||||
repeat(concat(' tc5_',$n), 300),
|
||||
repeat(concat(' tc6_',$n), 300),
|
||||
repeat(concat(' tc7_',$n), 300),
|
||||
now(), (100.55+$n));
|
||||
|
||||
if ($n <= 3)
|
||||
{
|
||||
commit;
|
||||
}
|
||||
|
||||
if ($n > 3)
|
||||
{
|
||||
rollback;
|
||||
}
|
||||
|
||||
dec $n;
|
||||
}
|
||||
|
||||
# validate loading of the tables.
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
select count(*) from t6;
|
||||
|
||||
# set the debug crash point and exercise them.
|
||||
if ($cnt == 6)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_during_drop_index_temp_table";
|
||||
--echo "---debug ib_trunc_crash_during_drop_index_temp_table point---"
|
||||
}
|
||||
if ($cnt == 5)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_drop_reinit_done_create_to_start";
|
||||
--echo "---debug ib_trunc_crash_drop_reinit_done_create_to_start---"
|
||||
}
|
||||
|
||||
if ($cnt >= 5) {
|
||||
--echo # Write file to make mysql-test-run.pl expect crash and restart
|
||||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--echo # Run the crashing query
|
||||
--error 2013
|
||||
truncate table t5;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--enable_reconnect
|
||||
--echo # Restart the MySQL server
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--source include/wait_until_connected_again.inc
|
||||
--disable_reconnect
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
select count(*) from t5;
|
||||
select count(*) from t6;
|
||||
}
|
||||
|
||||
# set the debug crash point and exercise them.
|
||||
if ($cnt == 6)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
|
||||
--echo "---debug ib_trunc_crash_on_drop_of_sec_index point---"
|
||||
}
|
||||
if ($cnt == 5)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
|
||||
--echo "---debug ib_trunc_crash_on_create_of_sec_index---"
|
||||
}
|
||||
if ($cnt == 4)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_before_log_removal";
|
||||
--echo "---debug ib_trunc_crash_before_log_removal point---"
|
||||
}
|
||||
if ($cnt == 3)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_after_truncate_done";
|
||||
--echo "---debug ib_trunc_crash_after_truncate_done point---"
|
||||
}
|
||||
if ($cnt == 2)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_after_truncate_done";
|
||||
--echo "---debug ib_trunc_crash_after_truncate_done point---"
|
||||
}
|
||||
if ($cnt == 1)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
|
||||
--echo "---debug ib_trunc_crash_after_redo_log_write_complete point---"
|
||||
}
|
||||
|
||||
--echo # Write file to make mysql-test-run.pl expect crash and restart
|
||||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--echo # Run the crashing query
|
||||
--error 2013
|
||||
truncate table t1;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--enable_reconnect
|
||||
--echo # Restart the MySQL server
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--source include/wait_until_connected_again.inc
|
||||
--disable_reconnect
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
select count(*) from t5;
|
||||
select count(*) from t6;
|
||||
|
||||
if ($cnt == 6)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
|
||||
--echo "---debug ib_trunc_crash_on_drop_of_sec_index point---"
|
||||
}
|
||||
if ($cnt == 5)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
|
||||
--echo "---debug ib_trunc_crash_on_create_of_sec_index---"
|
||||
}
|
||||
if ($cnt == 4)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_before_log_removal";
|
||||
--echo "---debug ib_trunc_crash_before_log_removal point---"
|
||||
}
|
||||
if ($cnt == 3)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_after_truncate_done";
|
||||
--echo "---debug ib_trunc_crash_after_truncate_done point---"
|
||||
}
|
||||
if ($cnt == 2)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_after_truncate_done";
|
||||
--echo "---debug ib_trunc_crash_after_truncate_done point---"
|
||||
}
|
||||
if ($cnt == 1)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
|
||||
--echo "---debug ib_trunc_crash_after_redo_log_write_complete point---"
|
||||
}
|
||||
|
||||
|
||||
--echo # Write file to make mysql-test-run.pl expect crash and restart
|
||||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--echo # Run the crashing query
|
||||
--error 2013
|
||||
truncate table t2;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--enable_reconnect
|
||||
--echo # Restart the MySQL server
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--source include/wait_until_connected_again.inc
|
||||
--disable_reconnect
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
select count(*) from t5;
|
||||
select count(*) from t6;
|
||||
|
||||
if ($cnt == 6)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
|
||||
--echo "---debug ib_trunc_crash_on_drop_of_sec_index point---"
|
||||
}
|
||||
if ($cnt == 5)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
|
||||
--echo "---debug ib_trunc_crash_on_create_of_sec_index---"
|
||||
}
|
||||
if ($cnt == 4)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_before_log_removal";
|
||||
--echo "---debug ib_trunc_crash_before_log_removal point---"
|
||||
}
|
||||
if ($cnt == 3)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_after_truncate_done";
|
||||
--echo "---debug ib_trunc_crash_after_truncate_done point---"
|
||||
}
|
||||
if ($cnt == 2)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_after_truncate_done";
|
||||
--echo "---debug ib_trunc_crash_after_truncate_done point---"
|
||||
}
|
||||
if ($cnt == 1)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
|
||||
--echo "---debug ib_trunc_crash_after_redo_log_write_complete point---"
|
||||
}
|
||||
|
||||
|
||||
--echo # Write file to make mysql-test-run.pl expect crash and restart
|
||||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--echo # Run the crashing query
|
||||
--error 2013
|
||||
truncate table t3;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--enable_reconnect
|
||||
--echo # Restart the MySQL server
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--source include/wait_until_connected_again.inc
|
||||
--disable_reconnect
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
select count(*) from t5;
|
||||
select count(*) from t6;
|
||||
|
||||
|
||||
if ($cnt == 6)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_on_drop_of_sec_index";
|
||||
--echo "---debug ib_trunc_crash_on_drop_of_sec_index point---"
|
||||
}
|
||||
if ($cnt == 5)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_on_create_of_sec_index";
|
||||
--echo "---debug ib_trunc_crash_on_create_of_sec_index---"
|
||||
}
|
||||
if ($cnt == 4)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_before_log_removal";
|
||||
--echo "---debug ib_trunc_crash_before_log_removal point---"
|
||||
}
|
||||
if ($cnt == 3)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_after_truncate_done";
|
||||
--echo "---debug ib_trunc_crash_after_truncate_done point---"
|
||||
}
|
||||
if ($cnt == 2)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_after_truncate_done";
|
||||
--echo "---debug ib_trunc_crash_after_truncate_done point---"
|
||||
}
|
||||
if ($cnt == 1)
|
||||
{
|
||||
set session debug="+d,ib_trunc_crash_after_redo_log_write_complete";
|
||||
--echo "---debug ib_trunc_crash_after_redo_log_write_complete point---"
|
||||
}
|
||||
|
||||
--echo # Write file to make mysql-test-run.pl expect crash and restart
|
||||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--echo # Run the crashing query
|
||||
--error 2013
|
||||
truncate table t4;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--enable_reconnect
|
||||
--echo # Restart the MySQL server
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--source include/wait_until_connected_again.inc
|
||||
--disable_reconnect
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
select count(*) from t5;
|
||||
select count(*) from t6;
|
||||
|
||||
drop table t1, t2, t3, t4, t6;
|
||||
|
||||
dec $cnt;
|
||||
|
||||
--disable_query_log
|
||||
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
|
||||
--enable_query_log
|
||||
}
|
||||
|
||||
|
||||
|
26
mysql-test/suite/innodb_zip/t/wl6501_crash_3.test
Normal file
26
mysql-test/suite/innodb_zip/t/wl6501_crash_3.test
Normal file
@ -0,0 +1,26 @@
|
||||
#
|
||||
# WL#6501: make truncate table atomic
|
||||
#
|
||||
|
||||
# TC tries to hit crash point during truncate of
|
||||
# compressed non-temp table residing in single tablespace
|
||||
# with page-size=16k
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_16k.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/big_test.inc
|
||||
|
||||
# Valgrind would complain about memory leaks when we crash on purpose.
|
||||
--source include/not_valgrind.inc
|
||||
# Embedded server does not support crashing
|
||||
--source include/not_embedded.inc
|
||||
# Avoid CrashReporter popup on Mac
|
||||
--source include/not_crashrep.inc
|
||||
|
||||
let $wl6501_file_per_table = 1;
|
||||
let $wl6501_row_fmt = compressed;
|
||||
let $wl6501_kbs = 16;
|
||||
let $wl6501_file_format = 'Barracuda';
|
||||
--source suite/innodb/include/innodb_wl6501_crash.inc
|
||||
|
29
mysql-test/suite/innodb_zip/t/wl6501_crash_4.test
Normal file
29
mysql-test/suite/innodb_zip/t/wl6501_crash_4.test
Normal file
@ -0,0 +1,29 @@
|
||||
#
|
||||
# WL#6501: make truncate table atomic
|
||||
#
|
||||
|
||||
# TC tries to hit crash point during truncate of
|
||||
# compressed non-temp table residing in single tablespace.
|
||||
# with page-size=4k
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_4k.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/big_test.inc
|
||||
|
||||
# Valgrind would complain about memory leaks when we crash on purpose.
|
||||
--source include/not_valgrind.inc
|
||||
# Embedded server does not support crashing
|
||||
--source include/not_embedded.inc
|
||||
# Avoid CrashReporter popup on Mac
|
||||
--source include/not_crashrep.inc
|
||||
|
||||
let $wl6501_file_per_table = 1;
|
||||
let $wl6501_row_fmt = compressed;
|
||||
let $wl6501_kbs = 4;
|
||||
let $wl6501_file_format = 'Barracuda';
|
||||
--source suite/innodb/include/innodb_wl6501_crash.inc
|
||||
|
||||
let $wl6501_temp = temporary;
|
||||
--source suite/innodb/include/innodb_wl6501_crash_temp.inc
|
||||
|
26
mysql-test/suite/innodb_zip/t/wl6501_crash_5.test
Normal file
26
mysql-test/suite/innodb_zip/t/wl6501_crash_5.test
Normal file
@ -0,0 +1,26 @@
|
||||
#
|
||||
# WL#6501: make truncate table atomic
|
||||
#
|
||||
|
||||
# TC tries to hit crash point during truncate of
|
||||
# compressed non-temp table residing in single tablespace.
|
||||
# with page-size=8k
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_8k.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/big_test.inc
|
||||
|
||||
# Valgrind would complain about memory leaks when we crash on purpose.
|
||||
--source include/not_valgrind.inc
|
||||
# Embedded server does not support crashing
|
||||
--source include/not_embedded.inc
|
||||
# Avoid CrashReporter popup on Mac
|
||||
--source include/not_crashrep.inc
|
||||
|
||||
let $wl6501_file_per_table = 1;
|
||||
let $wl6501_row_fmt = compressed;
|
||||
let $wl6501_kbs = 8;
|
||||
let $wl6501_file_format = 'Barracuda';
|
||||
--source suite/innodb/include/innodb_wl6501_crash.inc
|
||||
|
41
mysql-test/suite/innodb_zip/t/wl6501_scale_1.test
Normal file
41
mysql-test/suite/innodb_zip/t/wl6501_scale_1.test
Normal file
@ -0,0 +1,41 @@
|
||||
#
|
||||
# WL#6501: make truncate table atomic
|
||||
#
|
||||
|
||||
# load table with some significiant amount of data
|
||||
# and then try truncate
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/big_test.inc
|
||||
--source include/have_innodb_16k.inc
|
||||
|
||||
# Valgrind would complain about memory leaks when we crash on purpose.
|
||||
--source include/not_valgrind.inc
|
||||
# Embedded server does not support crashing
|
||||
--source include/not_embedded.inc
|
||||
# Avoid CrashReporter popup on Mac
|
||||
--source include/not_crashrep.inc
|
||||
|
||||
|
||||
# Single-Tablespace/Non-Compressed
|
||||
let $wl6501_file_per_table = 1;
|
||||
let $wl6501_row_fmt = compact;
|
||||
let $wl6501_kbs = 16;
|
||||
let $wl6501_file_format = 'Antelope';
|
||||
--source suite/innodb_zip/include/innodb_wl6501_scale.inc
|
||||
|
||||
# Single-Tablespace/Compressed
|
||||
let $wl6501_file_per_table = 1;
|
||||
let $wl6501_row_fmt = compressed;
|
||||
let $wl6501_kbs = 16;
|
||||
let $wl6501_file_format = 'Barracuda';
|
||||
--source suite/innodb_zip/include/innodb_wl6501_scale.inc
|
||||
|
||||
# System-Tablespace/Non-Compressed
|
||||
let $wl6501_file_per_table = 0;
|
||||
let $wl6501_row_fmt = compact;
|
||||
let $wl6501_kbs = 16;
|
||||
let $wl6501_file_format = 'Antelope';
|
||||
--source suite/innodb_zip/include/innodb_wl6501_scale.inc
|
||||
|
423
mysql-test/suite/innodb_zip/t/wl6560.test
Normal file
423
mysql-test/suite/innodb_zip/t/wl6560.test
Normal file
@ -0,0 +1,423 @@
|
||||
#
|
||||
# WL#6560: InnoDB: separate tablespace for innodb-temp-tables.
|
||||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_zip.inc
|
||||
# Embedded server does not restart of server
|
||||
--source include/not_embedded.inc
|
||||
-- source include/big_test.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("Tablespace innodb_temporary ran out of space. Please add another file or use 'autoextend' for the last file in setting innodb_temp_data_file_path.");
|
||||
call mtr.add_suppression("The table 't1' is full");
|
||||
--enable_query_log
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Will test following scenarios:
|
||||
# 1. creation of shared temp-tablespace.
|
||||
# 2. ddl + dml operation involving temp-tablespace.
|
||||
# insert/delete/update/select
|
||||
# create/drop/alter/truncate/import-discard (though blocked).
|
||||
# 3. ddl + dml operation on compressed table.
|
||||
# (table doesn't reside in shared temp-tablespace).
|
||||
# 4. Test bulk-loading that result in auto-extension of temp-tablespace.
|
||||
# 5. re-creation of temp-tablespace on re-start.
|
||||
# also to ensure non-existence of existing temp-table.
|
||||
# 6. restart server in innodb-read-only mode. this will also
|
||||
# block creation of temp-tables.
|
||||
# 7. try starting server with shared and temp-tablespace filename same.
|
||||
# 8. try re-starting server with param so that temp-tablespace can't be
|
||||
# expanded and insert enough data to make it full.
|
||||
# 9. tests for different row format types and key block sizes for
|
||||
# compressed tables.
|
||||
# 10. try restarting server with raw device specified for temp-tablespace.
|
||||
# 11. try restarting server with temp-tablespace less than min. threshold
|
||||
# 12. no file specified for temp-tablespace.
|
||||
################################################################################
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# create test-bed
|
||||
#
|
||||
let $per_table = `select @@innodb_file_per_table`;
|
||||
|
||||
set global innodb_file_per_table = off;
|
||||
let $MYSQL_TMP_DIR = `select @@tmpdir`;
|
||||
let $MYSQL_DATA_DIR = `select @@datadir`;
|
||||
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/my_restart.err;
|
||||
let $args = --loose-console --core-file > $SEARCH_FILE 2>&1;
|
||||
let crash = --loose-console > $SEARCH_FILE 2>&1 --innodb-force-recovery-crash;
|
||||
let readonly = $args --innodb_read_only;
|
||||
let nameconflicts = $args --innodb_data_file_path="ibdata1:12M:autoextend:max:134217728" --innodb_temp_data_file_path="ibdata1:12M:autoextend";
|
||||
let rawdevice1 = $args --innodb_temp_data_file_path="/dev/hdd1:3Gnewraw;/dev/hdd2:2Gnewraw";
|
||||
let rawdevice2 = $args --innodb_temp_data_file_path="/dev/hdd1:3Graw;/dev/hdd2:2Graw";
|
||||
let sizeoftempfile1 = $args --innodb_temp_data_file_path="ibtmp1:2M:autoextend";
|
||||
let sizeoftempfile2 = $args --innodb_data_file_path="ibdata1:2M:autoextend";
|
||||
let notemptablespacefile = $args --innodb_temp_data_file_path="";
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# 1. creation of shared temp-tablespace.
|
||||
#
|
||||
--echo # files in MYSQL_DATA_DIR
|
||||
--list_files $MYSQL_DATA_DIR/ ibtmp*
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# 2. ddl + dml operation involving temp-tablespace.
|
||||
# insert/delete/update/select
|
||||
# create/drop/alter/truncate/import-discard (though blocked).
|
||||
#
|
||||
select @@global.innodb_file_per_table;
|
||||
create temporary table t1 (i int, f float, c char(100)) engine=innodb;
|
||||
#
|
||||
--source suite/innodb_zip/include/innodb_temp_table_dml.inc
|
||||
#
|
||||
# alter table
|
||||
--error ER_CANNOT_DISCARD_TEMPORARY_TABLE
|
||||
alter table t1 discard tablespace;
|
||||
--error ER_CANNOT_DISCARD_TEMPORARY_TABLE
|
||||
alter table t1 import tablespace;
|
||||
#
|
||||
# drop table
|
||||
drop table t1;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# 3. ddl + dml operation on compressed table.
|
||||
# (table doesn't reside in shared temp-tablespace).
|
||||
#
|
||||
--echo #files in MYSQL_TMP_DIR
|
||||
--list_files $MYSQL_TMP_DIR/ *.ibd
|
||||
set global innodb_file_per_table = 1;
|
||||
select @@global.innodb_file_per_table;
|
||||
create temporary table t1
|
||||
(i int, f float, c char(100)) engine = innodb key_block_size = 4;
|
||||
show create table t1;
|
||||
--echo #files in MYSQL_TMP_DIR
|
||||
--replace_regex /#sql[0-9a-f_]*/#sql<temporary>/
|
||||
--list_files $MYSQL_TMP_DIR/ *.ibd
|
||||
#
|
||||
--source suite/innodb_zip/include/innodb_temp_table_dml.inc
|
||||
#
|
||||
# alter table
|
||||
--error ER_CANNOT_DISCARD_TEMPORARY_TABLE
|
||||
alter table t1 discard tablespace;
|
||||
#
|
||||
# drop table
|
||||
drop table t1;
|
||||
set global innodb_file_per_table = off;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# 4. Test bulk-loading that result in auto-extension of temp-tablespace.
|
||||
#
|
||||
create temporary table t1
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc)) engine = innodb;
|
||||
delimiter |;
|
||||
CREATE PROCEDURE populate_t1()
|
||||
BEGIN
|
||||
DECLARE i INT DEFAULT 1;
|
||||
while (i <= 20000) DO
|
||||
insert into t1 values (i, 'a', 'b');
|
||||
SET i = i + 1;
|
||||
END WHILE;
|
||||
END|
|
||||
delimiter ;|
|
||||
set autocommit=0;
|
||||
select count(*) from t1;
|
||||
call populate_t1();
|
||||
select count(*) from t1;
|
||||
select * from t1 limit 10;
|
||||
set autocommit=1;
|
||||
truncate table t1;
|
||||
select count(*) from t1;
|
||||
#
|
||||
drop procedure populate_t1;
|
||||
drop table t1;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# 5. re-creation of temp-tablespace on re-start.
|
||||
# also to ensure non-existence of existing temp-table.
|
||||
#
|
||||
create temporary table t1 (keyc int, c1 char(100), c2 char(100)) engine = innodb;
|
||||
insert into t1 values (1, 'c', 'b');
|
||||
select * from t1;
|
||||
#
|
||||
--source include/restart_mysqld.inc
|
||||
#
|
||||
--echo # files in MYSQL_DATA_DIR
|
||||
--list_files $MYSQL_DATA_DIR/ ibtmp*
|
||||
use test;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
select * from t1;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# 6. restart server in innodb-read-only mode. this will also
|
||||
# block creation of temp-tables.
|
||||
#
|
||||
#
|
||||
--echo "testing temp-table creation in --innodb_read_only mode"
|
||||
let $restart_parameters = restart: --innodb-read-only;
|
||||
--source include/restart_mysqld.inc
|
||||
#
|
||||
use test;
|
||||
show tables;
|
||||
--error ER_INNODB_READ_ONLY
|
||||
create temporary table t1 (keyc int, c1 char(100), c2 char(100)) engine = innodb;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# 7. try starting server with shared and temp-tablespace filename same.
|
||||
#
|
||||
--source include/shutdown_mysqld.inc
|
||||
--echo "testing system and temp tablespace name conflict"
|
||||
--error 1
|
||||
--exec $MYSQLD_CMD $nameconflicts
|
||||
let SEARCH_PATTERN = innodb_temporary and innodb_system file names seem to be the same;
|
||||
--source ./include/search_pattern_in_file.inc
|
||||
--remove_file $SEARCH_FILE
|
||||
--echo "restarting server in normal mode"
|
||||
--enable_reconnect
|
||||
let $restart_parameters = restart;
|
||||
--source include/start_mysqld.inc
|
||||
#
|
||||
show tables;
|
||||
create temporary table t1 (keyc int, c1 char(100), c2 char(100)) engine = innodb;
|
||||
drop table t1;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# 8. try re-starting server with param so that temp-tablespace can't be expanded
|
||||
# and insert enough data to make it full.
|
||||
#
|
||||
--echo # test condition of full-temp-tablespace
|
||||
let $restart_parameters = restart: --innodb_temp_data_file_path=ibtmp1:12M;
|
||||
--source include/restart_mysqld.inc
|
||||
#
|
||||
create temporary table t1
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc)) engine = innodb;
|
||||
delimiter |;
|
||||
CREATE PROCEDURE populate_t1()
|
||||
BEGIN
|
||||
DECLARE i INT DEFAULT 1;
|
||||
while (i <= 20000) DO
|
||||
insert into t1 values (i, 'a', 'b');
|
||||
SET i = i + 1;
|
||||
END WHILE;
|
||||
END|
|
||||
delimiter ;|
|
||||
set autocommit=0;
|
||||
select count(*) from t1;
|
||||
--error ER_RECORD_FILE_FULL
|
||||
call populate_t1();
|
||||
#
|
||||
drop procedure populate_t1;
|
||||
drop table t1;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# 9. tests for different row format types and key block sizes for
|
||||
# compressed tables.
|
||||
#
|
||||
set innodb_strict_mode = off;
|
||||
--disable_warnings
|
||||
set global innodb_file_per_table = 0;
|
||||
set global innodb_file_format = 'Antelope';
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = compressed;
|
||||
--replace_regex /[0-9]+/NUMBER/
|
||||
show warnings;
|
||||
drop table t;
|
||||
#
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = compressed key_block_size = 8;
|
||||
--replace_regex /[0-9]+/NUMBER/
|
||||
show warnings;
|
||||
#
|
||||
drop table t;
|
||||
set global innodb_file_per_table = 1;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = compressed key_block_size = 8;
|
||||
--replace_regex /[0-9]+/NUMBER/
|
||||
show warnings;
|
||||
drop table t;
|
||||
#
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = dynamic;
|
||||
--replace_regex /[0-9]+/NUMBER/
|
||||
show warnings;
|
||||
--echo #files in MYSQL_TMP_DIR
|
||||
--replace_regex /#sql[0-9a-f_]*/#sql<temporary>/
|
||||
--list_files $MYSQL_TMP_DIR/ *.ibd
|
||||
drop table t;
|
||||
#
|
||||
set innodb_strict_mode = on;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = dynamic;
|
||||
--replace_regex /[0-9]+/NUMBER/
|
||||
drop table t;
|
||||
#
|
||||
set global innodb_file_format = 'Barracuda';
|
||||
set innodb_strict_mode = off;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = compressed key_block_size = 8;
|
||||
--replace_regex /[0-9]+/NUMBER/
|
||||
# explicitly disabling it else it will generate warning of ignoring
|
||||
# key_block_size when suite is run with innodb-page-size=4k
|
||||
#show warnings;
|
||||
set innodb_strict_mode = default;
|
||||
--echo #files in MYSQL_TMP_DIR
|
||||
--replace_regex /#sql[0-9a-f_]*/#sql<temporary>/
|
||||
--list_files $MYSQL_TMP_DIR/ *.ibd
|
||||
#
|
||||
drop table t;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = compressed;
|
||||
--replace_regex /[0-9]+/NUMBER/
|
||||
show warnings;
|
||||
--echo #files in MYSQL_TMP_DIR
|
||||
--replace_regex /#sql[0-9a-f_]*/#sql<temporary>/
|
||||
--list_files $MYSQL_TMP_DIR/ *.ibd
|
||||
drop table t;
|
||||
#
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = dynamic;
|
||||
--replace_regex /[0-9]+/NUMBER/
|
||||
show warnings;
|
||||
--echo #files in MYSQL_TMP_DIR
|
||||
--replace_regex /#sql[0-9a-f_]*/#sql<temporary>/
|
||||
--list_files $MYSQL_TMP_DIR/ *.ibd
|
||||
drop table t;
|
||||
#
|
||||
set innodb_strict_mode = on;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = dynamic;
|
||||
--replace_regex /[0-9]+/NUMBER/
|
||||
show warnings;
|
||||
drop table t;
|
||||
set innodb_strict_mode = off;
|
||||
#
|
||||
--echo #files in MYSQL_TMP_DIR
|
||||
--replace_regex /#sql[0-9a-f_]*/#sql<temporary>/
|
||||
--list_files $MYSQL_TMP_DIR/ *.ibd
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = dynamic key_block_size = 4;
|
||||
--replace_regex /[0-9]+/NUMBER/
|
||||
show warnings;
|
||||
--echo #files in MYSQL_TMP_DIR
|
||||
--replace_regex /#sql[0-9a-f_]*/#sql<temporary>/
|
||||
--list_files $MYSQL_TMP_DIR/ *.ibd
|
||||
drop table t;
|
||||
#
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = compact;
|
||||
--replace_regex /[0-9]+/NUMBER/
|
||||
show warnings;
|
||||
--echo #files in MYSQL_TMP_DIR
|
||||
--replace_regex /#sql[0-9a-f_]*/#sql<temporary>/
|
||||
--list_files $MYSQL_TMP_DIR/ *.ibd
|
||||
drop table t;
|
||||
#
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb key_block_size = 4;
|
||||
--replace_regex /[0-9]+/NUMBER/
|
||||
show warnings;
|
||||
--echo #files in MYSQL_TMP_DIR
|
||||
--replace_regex /#sql[0-9a-f_]*/#sql<temporary>/
|
||||
--list_files $MYSQL_TMP_DIR/ *.ibd
|
||||
drop table t;
|
||||
#
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# 10. try restarting server with raw device specified for temp-tablespace.
|
||||
#
|
||||
--source include/shutdown_mysqld.inc
|
||||
--echo "testing temp tablespace non-support for raw device"
|
||||
--error 1
|
||||
--exec $MYSQLD_CMD $rawdevice1
|
||||
let SEARCH_PATTERN = support raw device;
|
||||
--source include/search_pattern_in_file.inc
|
||||
--remove_file $SEARCH_FILE
|
||||
--echo "testing temp tablespace non-support for raw device"
|
||||
--error 1
|
||||
--exec $MYSQLD_CMD $rawdevice2
|
||||
let SEARCH_PATTERN = support raw device;
|
||||
--source include/search_pattern_in_file.inc
|
||||
--remove_file $SEARCH_FILE
|
||||
|
||||
let $restart_parameters = restart;
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
show tables;
|
||||
create temporary table t1 (
|
||||
keyc int, c1 char(100), c2 char(100)
|
||||
) engine = innodb;
|
||||
drop table t1;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# 11. try restarting server with temp-tablespace less than min. threshold
|
||||
#
|
||||
--source include/shutdown_mysqld.inc
|
||||
--echo "try starting server with temp-tablespace size < min. threshold"
|
||||
--error 1
|
||||
--exec $MYSQLD_CMD $sizeoftempfile1
|
||||
let SEARCH_PATTERN = Tablespace size must be at least;
|
||||
--source ./include/search_pattern_in_file.inc
|
||||
--remove_file $SEARCH_FILE
|
||||
--echo "try starting server with sys-tablespace size < min. threshold"
|
||||
--error 1
|
||||
--exec $MYSQLD_CMD $sizeoftempfile2
|
||||
let SEARCH_PATTERN = Tablespace size must be at least;
|
||||
--source ./include/search_pattern_in_file.inc
|
||||
--remove_file $SEARCH_FILE
|
||||
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
show tables;
|
||||
create temporary table t1 (
|
||||
keyc int, c1 char(100), c2 char(100)
|
||||
) engine = innodb;
|
||||
drop table t1;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# 12. no file specified for temp-tablespace.
|
||||
#
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--echo "try starting server with no file specified for temp-tablespace"
|
||||
--error 1
|
||||
--exec $MYSQLD_CMD $notemptablespacefile
|
||||
let SEARCH_PATTERN = init function returned error;
|
||||
--source ./include/search_pattern_in_file.inc
|
||||
--remove_file $SEARCH_FILE
|
||||
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
show tables;
|
||||
create temporary table t1 (
|
||||
keyc int, c1 char(100), c2 char(100)
|
||||
) engine = innodb;
|
||||
drop table t1;
|
650
mysql-test/suite/innodb_zip/t/wl6915_1.test
Normal file
650
mysql-test/suite/innodb_zip/t/wl6915_1.test
Normal file
@ -0,0 +1,650 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_zip.inc
|
||||
--source include/have_no_undo_tablespaces.inc
|
||||
--source include/big_test.inc
|
||||
|
||||
# Embedded server does not support restarting
|
||||
--source include/not_embedded.inc
|
||||
# Avoid CrashReporter popup on Mac
|
||||
--source include/not_crashrep.inc
|
||||
|
||||
####################################################################
|
||||
# TC to test temp-table undolog changes correctness #
|
||||
# Sceanrio covered in single testcase : #
|
||||
# - Tables with row format(redundant,compressed,dynamic,compact #
|
||||
# - Table with primary,composite,prefix,secondary INDEX #
|
||||
# - Insert/delete/update with transactioons #
|
||||
# - Transaction with COMMIT,rollback,savepoint statements #
|
||||
# - Transaction having temporary table and normal table #
|
||||
# - Concurrency by execution of two clients creating tables with #
|
||||
# same names #
|
||||
# - Inserting data using #
|
||||
# - Insert into .. , Load data infile..,insert ignore #
|
||||
# - Insert into .. on duplicate update #
|
||||
# - Check basic delete and upadte [ignore] #
|
||||
# - Check constraints like duplicate key,default value #
|
||||
# - Alter ADD COLUMN , ADD PRIMARY KEY #
|
||||
# - Flush Tables, logs command #
|
||||
# - Vary innodb_undo_tablespaces=0,innodb_undo_logs #
|
||||
# innodb_log_files_in_group #
|
||||
# - Verify rseg message from server log #
|
||||
####################################################################
|
||||
|
||||
# run for page size >= 8k
|
||||
--disable_warnings
|
||||
if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value >= 8192`)
|
||||
{
|
||||
--skip Test requires InnoDB with page size >= 8k.
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
call mtr.ADD_suppression(".*Resizing redo log.*");
|
||||
call mtr.ADD_suppression(".*Starting to delete and rewrite log files.*");
|
||||
call mtr.ADD_suppression(".*New log files created.*");
|
||||
# Save initial VALUES of server variable
|
||||
--disable_query_log
|
||||
let $innodb_file_per_table_orig=`SELECT @@innodb_file_per_table`;
|
||||
--enable_query_log
|
||||
|
||||
SELECT @@global.innodb_undo_tablespaces;
|
||||
|
||||
# Create procedure to perform
|
||||
# 1. Create temp table with row types , INDEX , sufficent data types
|
||||
# 2. Perform DML with transaction
|
||||
delimiter |;
|
||||
CREATE PROCEDURE populate_tables(IN id VARCHAR(10))
|
||||
begin
|
||||
declare n int default 20;
|
||||
set global innodb_file_per_table=on;
|
||||
DROP TABLE IF EXISTS t1,t2,t3,t4;
|
||||
|
||||
CREATE TEMPORARY TABLE t1_temp(c1 int NOT NULL,
|
||||
c2 int NOT NULL,
|
||||
c3 char(255) NOT NULL,
|
||||
c4 text(600) NOT NULL,
|
||||
c5 blob(600) NOT NULL,
|
||||
c6 varchar(600) NOT NULL,
|
||||
c7 varchar(600) NOT NULL,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
PRIMARY KEY (c1),
|
||||
INDEX (c3,c4(50),c5(50)),
|
||||
INDEX (c2))
|
||||
ENGINE=InnoDB ROW_FORMAT=redundant;
|
||||
|
||||
set @s = concat("CREATE TABLE t1",id," ( c1 int NOT NULL, c2 int NOT NULL, c3 char(255) NOT NULL, c4 text(600) NOT NULL, c5 blob(600) NOT NULL, c6 varchar(600) NOT NULL, c7 varchar(600) NOT NULL, c8 datetime, c9 decimal(6,3), PRIMARY KEY (c1), INDEX (c3,c4(50),c5(50)), INDEX (c2)) ENGINE=InnoDB ROW_FORMAT=redundant;");
|
||||
PREPARE createTable FROM @s;
|
||||
EXECUTE createTable;
|
||||
DEALLOCATE PREPARE createTable;
|
||||
|
||||
|
||||
CREATE TEMPORARY TABLE t2_temp(c1 int NOT NULL,
|
||||
c2 int NOT NULL,
|
||||
c3 char(255) NOT NULL,
|
||||
c4 text(600) NOT NULL,
|
||||
c5 blob(600) NOT NULL,
|
||||
c6 varchar(600) NOT NULL,
|
||||
c7 varchar(600) NOT NULL,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
PRIMARY KEY (c1),
|
||||
INDEX (c3,c4(50),c5(50)),
|
||||
INDEX (c2))
|
||||
ENGINE=InnoDB ROW_FORMAT=compact;
|
||||
|
||||
set @s = concat("CREATE TABLE t2",id," (c1 int NOT NULL, c2 int NOT NULL, c3 char(255) NOT NULL, c4 text(600) NOT NULL, c5 blob(600) NOT NULL, c6 varchar(600) NOT NULL, c7 varchar(600) NOT NULL, c8 datetime, c9 decimal(6,3), PRIMARY KEY (c1), INDEX (c3,c4(50),c5(50)), INDEX (c2)) ENGINE=InnoDB ROW_FORMAT=compact;");
|
||||
PREPARE createTable FROM @s;
|
||||
EXECUTE createTable;
|
||||
DEALLOCATE PREPARE createTable;
|
||||
|
||||
CREATE TEMPORARY TABLE t3_temp(c1 int NOT NULL,
|
||||
c2 int NOT NULL,
|
||||
c3 char(255) NOT NULL,
|
||||
c4 text(600) NOT NULL,
|
||||
c5 blob(600) NOT NULL,
|
||||
c6 varchar(600) NOT NULL,
|
||||
c7 varchar(600) NOT NULL,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
PRIMARY KEY (c1),
|
||||
INDEX (c3,c4(50),c5(50)),
|
||||
INDEX (c2))
|
||||
ENGINE=InnoDB ROW_FORMAT=compressed key_block_size=4;
|
||||
|
||||
set @s = concat("CREATE TABLE t3",id," (c1 int NOT NULL, c2 int NOT NULL, c3 char(255) NOT NULL, c4 text(600) NOT NULL, c5 blob(600) NOT NULL, c6 varchar(600) NOT NULL, c7 varchar(600) NOT NULL, c8 datetime, c9 decimal(6,3), PRIMARY KEY (c1), INDEX (c3,c4(50),c5(50)), INDEX (c2)) ENGINE=InnoDB ROW_FORMAT=compressed key_block_size=4;");
|
||||
PREPARE createTable FROM @s;
|
||||
EXECUTE createTable;
|
||||
DEALLOCATE PREPARE createTable;
|
||||
|
||||
CREATE TEMPORARY TABLE t4_temp(c1 int NOT NULL,
|
||||
c2 int NOT NULL,
|
||||
c3 char(255) NOT NULL,
|
||||
c4 text(600) NOT NULL,
|
||||
c5 blob(600) NOT NULL,
|
||||
c6 varchar(600) NOT NULL,
|
||||
c7 varchar(600) NOT NULL,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
PRIMARY KEY (c1),
|
||||
INDEX (c3,c4(50),c5(50)),
|
||||
INDEX (c2))
|
||||
ENGINE=InnoDB ROW_FORMAT=dynamic;
|
||||
|
||||
set @s = concat("CREATE TABLE t4",id," (c1 int NOT NULL, c2 int NOT NULL, c3 char(255) NOT NULL, c4 text(600) NOT NULL, c5 blob(600) NOT NULL, c6 varchar(600) NOT NULL, c7 varchar(600) NOT NULL, c8 datetime, c9 decimal(6,3), PRIMARY KEY (c1), INDEX (c3,c4(50),c5(50)), INDEX (c2)) ENGINE=InnoDB ROW_FORMAT=dynamic;");
|
||||
PREPARE createTable FROM @s;
|
||||
EXECUTE createTable;
|
||||
DEALLOCATE PREPARE createTable;
|
||||
|
||||
while (n > 0) do
|
||||
START TRANSACTION;
|
||||
set @s = concat("INSERT INTO t1",id," VALUES(",n,",",n,",REPEAT(concat(' tc3_',",n,"),30), REPEAT(concat(' tc4_',",n,"),70),REPEAT(concat(' tc_',",n,"),70), REPEAT(concat(' tc6_',",n,"),70),REPEAT(concat(' tc7_',",n,"),70), NOW(),(100.55+",n,"));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t1_temp VALUES(n,n,REPEAT(concat(' tc3_',n),30),
|
||||
REPEAT(concat(' tc4_',n),70),REPEAT(concat(' tc_',n),70),
|
||||
REPEAT(concat(' tc6_',n),70),REPEAT(concat(' tc7_',n),70),
|
||||
NOW(),(100.55+n));
|
||||
|
||||
set @s = concat("INSERT INTO t2",id," VALUES(",n,",",n,",REPEAT(concat(' tc3_',",n,"),30), REPEAT(concat(' tc4_',",n,"),70),REPEAT(concat(' tc_',",n,"),70), REPEAT(concat(' tc6_',",n,"),70),REPEAT(concat(' tc7_',",n,"),70), NOW(),(100.55+",n,"));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
|
||||
INSERT INTO t2_temp VALUES(n,n,REPEAT(concat(' tc3_',n),30),
|
||||
REPEAT(concat(' tc4_',n),70),REPEAT(concat(' tc_',n),70),
|
||||
REPEAT(concat(' tc6_',n),70),REPEAT(concat(' tc7_',n),70),
|
||||
NOW(),(100.55+n));
|
||||
|
||||
savepoint a;
|
||||
|
||||
set @s = concat("INSERT INTO t3",id," VALUES(",n,",",n,",REPEAT(concat(' tc3_',",n,"),30), REPEAT(concat(' tc4_',",n,"),70),REPEAT(concat(' tc_',",n,"),70), REPEAT(concat(' tc6_',",n,"),70),REPEAT(concat(' tc7_',",n,"),70), NOW(),(100.55+",n,"));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
|
||||
INSERT INTO t3_temp VALUES(n,n,REPEAT(concat(' tc3_',n),30),
|
||||
REPEAT(concat(' tc4_',n),70),REPEAT(concat(' tc_',n),70),
|
||||
REPEAT(concat(' tc6_',n),70),REPEAT(concat(' tc7_',n),70),
|
||||
NOW(),(100.55+n));
|
||||
|
||||
savepoint b;
|
||||
|
||||
set @s = concat("INSERT INTO t4",id," VALUES(",n,",",n,",REPEAT(concat(' tc3_',",n,"),30), REPEAT(concat(' tc4_',",n,"),70),REPEAT(concat(' tc_',",n,"),70), REPEAT(concat(' tc6_',",n,"),70),REPEAT(concat(' tc7_',",n,"),70), NOW(),(100.55+",n,"));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
|
||||
INSERT INTO t4_temp VALUES(n,n,REPEAT(concat(' tc3_',n),30),
|
||||
REPEAT(concat(' tc4_',n),70),REPEAT(concat(' tc_',n),70),
|
||||
REPEAT(concat(' tc6_',n),70),REPEAT(concat(' tc7_',n),70),
|
||||
NOW(),(100.55+n));
|
||||
|
||||
|
||||
if (n > 10) then
|
||||
if (n > 10 and n <=12) then
|
||||
ROLLBACK TO SAVEPOINT a;
|
||||
COMMIT;
|
||||
end if;
|
||||
if (n > 12 and n < 15) then
|
||||
ROLLBACK TO SAVEPOINT b;
|
||||
COMMIT;
|
||||
end if;
|
||||
if (n > 15) then
|
||||
COMMIT;
|
||||
end if;
|
||||
|
||||
else
|
||||
if (n > 5) then
|
||||
START TRANSACTION;
|
||||
DELETE FROM t1_temp WHERE c1 > 10 ;
|
||||
DELETE FROM t2_temp WHERE c1 > 10 ;
|
||||
DELETE FROM t3_temp WHERE c1 > 10 ;
|
||||
DELETE FROM t4_temp WHERE c1 > 10 ;
|
||||
|
||||
rollback;
|
||||
START TRANSACTION;
|
||||
update t1_temp set c1 = c1 + 1000 WHERE c1 > 10;
|
||||
update t2_temp set c1 = c1 + 1000 WHERE c1 > 10;
|
||||
update t3_temp set c1 = c1 + 1000 WHERE c1 > 10;
|
||||
update t4_temp set c1 = c1 + 1000 WHERE c1 > 10;
|
||||
rollback;
|
||||
end if;
|
||||
end if;
|
||||
|
||||
if (n < 5) then
|
||||
rollback;
|
||||
end if;
|
||||
|
||||
FLUSH logs;
|
||||
ALTER TABLE t1_temp DROP PRIMARY KEY;
|
||||
ALTER TABLE t1_temp ADD PRIMARY KEY (c1,c3(10),c4(10));
|
||||
ALTER TABLE t2_temp DROP PRIMARY KEY;
|
||||
ALTER TABLE t2_temp ADD PRIMARY KEY (c1,c3(10),c4(10));
|
||||
ALTER TABLE t3_temp DROP PRIMARY KEY;
|
||||
ALTER TABLE t3_temp ADD PRIMARY KEY (c1,c3(10),c4(10));
|
||||
ALTER TABLE t4_temp DROP PRIMARY KEY;
|
||||
ALTER TABLE t4_temp ADD PRIMARY KEY (c1,c3(10),c4(10));
|
||||
FLUSH tables;
|
||||
|
||||
START TRANSACTION;
|
||||
set @s = concat("INSERT INTO t1",id," VALUES(",n,"+100,",n,"+100,REPEAT(concat(' tc3_',",n,"+100),30), REPEAT(concat(' tc4_',",n,"+100),70),REPEAT(concat(' tc_',",n,"+100),70), REPEAT(concat(' tc6_',",n,"+100),60),REPEAT(concat(' tc7_',",n,"+100),60), NOW(),(100.55+",n,"+100));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t1_temp VALUES(n+100,n+100,REPEAT(concat(' tc3_',n+100),30),
|
||||
REPEAT(concat(' tc4_',n+100),70),REPEAT(concat(' tc_',n+100),70),
|
||||
REPEAT(concat(' tc6_',n+100),60),REPEAT(concat(' tc7_',n+100),60),
|
||||
NOW(),(100.55+n+100));
|
||||
set @s = concat("INSERT INTO t2",id," VALUES(",n,"+100,",n,"+100,REPEAT(concat(' tc3_',",n,"+100),30), REPEAT(concat(' tc4_',",n,"+100),70),REPEAT(concat(' tc_',",n,"+100),70), REPEAT(concat(' tc6_',",n,"+100),60),REPEAT(concat(' tc7_',",n,"+100),60), NOW(),(100.55+",n,"+100));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t2_temp VALUES(n+100,n+100,REPEAT(concat(' tc3_',n+100),30),
|
||||
REPEAT(concat(' tc4_',n+100),70),REPEAT(concat(' tc_',n+100),70),
|
||||
REPEAT(concat(' tc6_',n+100),60),REPEAT(concat(' tc7_',n+100),60),
|
||||
NOW(),(100.55+n+100));
|
||||
set @s = concat("INSERT INTO t3",id," VALUES(",n,"+100,",n,"+100,REPEAT(concat(' tc3_',",n,"+100),30), REPEAT(concat(' tc4_',",n,"+100),70),REPEAT(concat(' tc_',",n,"+100),70), REPEAT(concat(' tc6_',",n,"+100),60),REPEAT(concat(' tc7_',",n,"+100),60), NOW(),(100.55+",n,"+100));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t3_temp VALUES(n+100,n+100,REPEAT(concat(' tc3_',n+100),30),
|
||||
REPEAT(concat(' tc4_',n+100),70),REPEAT(concat(' tc_',n+100),70),
|
||||
REPEAT(concat(' tc6_',n+100),60),REPEAT(concat(' tc7_',n+100),60),
|
||||
NOW(),(100.55+n+100));
|
||||
set @s = concat("INSERT INTO t4",id," VALUES(",n,"+100,",n,"+100,REPEAT(concat(' tc3_',",n,"+100),30), REPEAT(concat(' tc4_',",n,"+100),70),REPEAT(concat(' tc_',",n,"+100),70), REPEAT(concat(' tc6_',",n,"+100),60),REPEAT(concat(' tc7_',",n,"+100),60), NOW(),(100.55+",n,"+100));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t4_temp VALUES(n+100,n+100,REPEAT(concat(' tc3_',n+100),30),
|
||||
REPEAT(concat(' tc4_',n+100),70),REPEAT(concat(' tc_',n+100),70),
|
||||
REPEAT(concat(' tc6_',n+100),60),REPEAT(concat(' tc7_',n+100),60),
|
||||
NOW(),(100.55+n+100));
|
||||
|
||||
|
||||
DELETE FROM t1_temp WHERE c1 between 100 and 110;
|
||||
DELETE FROM t2_temp WHERE c1 between 100 and 110;
|
||||
DELETE FROM t3_temp WHERE c1 between 100 and 110;
|
||||
DELETE FROM t4_temp WHERE c1 between 100 and 110;
|
||||
|
||||
update t1_temp set c1 = c1+1 WHERE c1>110;
|
||||
update t2_temp set c1 = c1+1 WHERE c1>110;
|
||||
update t3_temp set c1 = c1+1 WHERE c1>110;
|
||||
update t4_temp set c1 = c1+1 WHERE c1>110;
|
||||
|
||||
savepoint a;
|
||||
|
||||
set @s = concat("INSERT INTO t1",id," VALUES(300+",n,"+100,",n,"+100,REPEAT(concat(' tc3_',",n,"+100),30), REPEAT(concat(' tc4_',",n,"+100),70),REPEAT(concat(' tc_',",n,"+100),70), REPEAT(concat(' tc6_',",n,"+100),60),REPEAT(concat(' tc7_',",n,"+100),60), NOW(),(100.55+",n,"+100));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t1_temp VALUES(300+n+100,n+100,REPEAT(concat(' tc3_',n+100),30),
|
||||
REPEAT(concat(' tc4_',n+100),70),REPEAT(concat(' tc_',n+100),70),
|
||||
REPEAT(concat(' tc6_',n+100),60),REPEAT(concat(' tc7_',n+100),60),
|
||||
NOW(),(100.55+n+100));
|
||||
set @s = concat("INSERT INTO t2",id," VALUES(300+",n,"+100,",n,"+100,REPEAT(concat(' tc3_',",n,"+100),30), REPEAT(concat(' tc4_',",n,"+100),70),REPEAT(concat(' tc_',",n,"+100),70), REPEAT(concat(' tc6_',",n,"+100),60),REPEAT(concat(' tc7_',",n,"+100),60), NOW(),(100.55+",n,"+100));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t2_temp VALUES(300+n+100,n+100,REPEAT(concat(' tc3_',n+100),30),
|
||||
REPEAT(concat(' tc4_',n+100),70),REPEAT(concat(' tc_',n+100),70),
|
||||
REPEAT(concat(' tc6_',n+100),60),REPEAT(concat(' tc7_',n+100),60),
|
||||
NOW(),(100.55+n+100));
|
||||
set @s = concat("INSERT INTO t3",id," VALUES(300+",n,"+100,",n,"+100,REPEAT(concat(' tc3_',",n,"+100),30), REPEAT(concat(' tc4_',",n,"+100),70),REPEAT(concat(' tc_',",n,"+100),70), REPEAT(concat(' tc6_',",n,"+100),60),REPEAT(concat(' tc7_',",n,"+100),60), NOW(),(100.55+",n,"+100));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t3_temp VALUES(300+n+100,n+100,REPEAT(concat(' tc3_',n+100),30),
|
||||
REPEAT(concat(' tc4_',n+100),70),REPEAT(concat(' tc_',n+100),70),
|
||||
REPEAT(concat(' tc6_',n+100),60),REPEAT(concat(' tc7_',n+100),60),
|
||||
NOW(),(100.55+n+100));
|
||||
set @s = concat("INSERT INTO t4",id," VALUES(300+",n,"+100,",n,"+100,REPEAT(concat(' tc3_',",n,"+100),30), REPEAT(concat(' tc4_',",n,"+100),70),REPEAT(concat(' tc_',",n,"+100),70), REPEAT(concat(' tc6_',",n,"+100),60),REPEAT(concat(' tc7_',",n,"+100),60), NOW(),(100.55+",n,"+100));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t4_temp VALUES(300+n+100,n+100,REPEAT(concat(' tc3_',n+100),30),
|
||||
REPEAT(concat(' tc4_',n+100),70),REPEAT(concat(' tc_',n+100),70),
|
||||
REPEAT(concat(' tc6_',n+100),60),REPEAT(concat(' tc7_',n+100),60),
|
||||
NOW(),(100.55+n+100));
|
||||
savepoint b;
|
||||
|
||||
set @s = concat("INSERT INTO t1",id," VALUES(400+",n,"+100,",n,"+100,REPEAT(concat(' tc3_',",n,"+100),30), REPEAT(concat(' tc4_',",n,"+100),70),REPEAT(concat(' tc_',",n,"+100),70), REPEAT(concat(' tc6_',",n,"+100),60),REPEAT(concat(' tc7_',",n,"+100),60), NOW(),(100.55+",n,"+100));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t1_temp VALUES(400+n+100,n+100,REPEAT(concat(' tc3_',n+100),30),
|
||||
REPEAT(concat(' tc4_',n+100),70),REPEAT(concat(' tc_',n+100),70),
|
||||
REPEAT(concat(' tc6_',n+100),60),REPEAT(concat(' tc7_',n+100),60),
|
||||
NOW(),(100.55+n+100));
|
||||
set @s = concat("INSERT INTO t2",id," VALUES(400+",n,"+100,",n,"+100,REPEAT(concat(' tc3_',",n,"+100),30), REPEAT(concat(' tc4_',",n,"+100),70),REPEAT(concat(' tc_',",n,"+100),70), REPEAT(concat(' tc6_',",n,"+100),60),REPEAT(concat(' tc7_',",n,"+100),60), NOW(),(100.55+",n,"+100));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t2_temp VALUES(400+n+100,n+100,REPEAT(concat(' tc3_',n+100),30),
|
||||
REPEAT(concat(' tc4_',n+100),70),REPEAT(concat(' tc_',n+100),70),
|
||||
REPEAT(concat(' tc6_',n+100),60),REPEAT(concat(' tc7_',n+100),60),
|
||||
NOW(),(100.55+n+100));
|
||||
set @s = concat("INSERT INTO t3",id," VALUES(400+",n,"+100,",n,"+100,REPEAT(concat(' tc3_',",n,"+100),30), REPEAT(concat(' tc4_',",n,"+100),70),REPEAT(concat(' tc_',",n,"+100),70), REPEAT(concat(' tc6_',",n,"+100),60),REPEAT(concat(' tc7_',",n,"+100),60), NOW(),(100.55+",n,"+100));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t3_temp VALUES(400+n+100,n+100,REPEAT(concat(' tc3_',n+100),30),
|
||||
REPEAT(concat(' tc4_',n+100),70),REPEAT(concat(' tc_',n+100),70),
|
||||
REPEAT(concat(' tc6_',n+100),60),REPEAT(concat(' tc7_',n+100),60),
|
||||
NOW(),(100.55+n+100));
|
||||
set @s = concat("INSERT INTO t4",id," VALUES(400+",n,"+100,",n,"+100,REPEAT(concat(' tc3_',",n,"+100),30), REPEAT(concat(' tc4_',",n,"+100),70),REPEAT(concat(' tc_',",n,"+100),70), REPEAT(concat(' tc6_',",n,"+100),60),REPEAT(concat(' tc7_',",n,"+100),60), NOW(),(100.55+",n,"+100));");
|
||||
PREPARE insertIntoTable FROM @s;
|
||||
EXECUTE insertIntoTable;
|
||||
DEALLOCATE PREPARE insertIntoTable;
|
||||
INSERT INTO t4_temp VALUES(400+n+100,n+100,REPEAT(concat(' tc3_',n+100),30),
|
||||
REPEAT(concat(' tc4_',n+100),70),REPEAT(concat(' tc_',n+100),70),
|
||||
REPEAT(concat(' tc6_',n+100),60),REPEAT(concat(' tc7_',n+100),60),
|
||||
NOW(),(100.55+n+100));
|
||||
savepoint c;
|
||||
rollback to b;
|
||||
rollback to a;
|
||||
COMMIT;
|
||||
COMMIT;
|
||||
rollback;
|
||||
set n = n - 1;
|
||||
end while;
|
||||
end|
|
||||
delimiter ;|
|
||||
|
||||
# Create two client for concurrent execution
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
--echo #---client 1 : dml operation ---"
|
||||
connection con1;
|
||||
-- disable_query_log
|
||||
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
|
||||
|
||||
-- enable_query_log
|
||||
-- disable_query_log
|
||||
# call procedure
|
||||
--send call populate_tables('_1');
|
||||
-- enable_query_log
|
||||
|
||||
--echo #---client 2 : dml operation ---"
|
||||
connection con2;
|
||||
-- disable_query_log
|
||||
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
|
||||
-- enable_query_log
|
||||
-- disable_query_log
|
||||
# call procedure
|
||||
--send call populate_tables('_2');
|
||||
|
||||
-- enable_query_log
|
||||
|
||||
# check data of client connection 1
|
||||
--echo # In connection 1
|
||||
connection con1;
|
||||
--reap
|
||||
# 20 rows exepceted in 5 tables
|
||||
SELECT count(*) FROM t1_1;
|
||||
SELECT count(*) FROM t2_1;
|
||||
SELECT count(*) FROM t3_1;
|
||||
SELECT count(*) FROM t4_1;
|
||||
SELECT c1 FROM t1_1;
|
||||
SELECT c1 FROM t2_1;
|
||||
SELECT c1 FROM t3_1;
|
||||
SELECT c1 FROM t4_1;
|
||||
SELECT count(*) FROM t1_temp;
|
||||
SELECT count(*) FROM t2_temp;
|
||||
SELECT count(*) FROM t3_temp;
|
||||
SELECT count(*) FROM t4_temp;
|
||||
SELECT c1 FROM t1_temp;
|
||||
SELECT c1 FROM t2_temp;
|
||||
SELECT c1 FROM t3_temp;
|
||||
SELECT c1 FROM t4_temp;
|
||||
# check data of client connection 2
|
||||
--echo # In connection 2
|
||||
connection con2;
|
||||
--reap
|
||||
# 20 rows exepceted in 5 tables
|
||||
SELECT count(*) FROM t1_2;
|
||||
SELECT count(*) FROM t2_2;
|
||||
SELECT count(*) FROM t3_2;
|
||||
SELECT count(*) FROM t4_2;
|
||||
SELECT c1 FROM t1_2;
|
||||
SELECT c1 FROM t2_2;
|
||||
SELECT c1 FROM t3_2;
|
||||
SELECT c1 FROM t4_2;
|
||||
SELECT count(*) FROM t1_temp;
|
||||
SELECT count(*) FROM t2_temp;
|
||||
SELECT count(*) FROM t3_temp;
|
||||
SELECT count(*) FROM t4_temp;
|
||||
SELECT c1 FROM t1_temp;
|
||||
SELECT c1 FROM t2_temp;
|
||||
SELECT c1 FROM t3_temp;
|
||||
SELECT c1 FROM t4_temp;
|
||||
|
||||
--echo # In connection 1
|
||||
connection con1;
|
||||
|
||||
set AUTOCOMMIT = 0;
|
||||
ALTER TABLE t1_temp DROP PRIMARY KEY;
|
||||
ALTER TABLE t1_temp ADD PRIMARY KEY (c1);
|
||||
ALTER TABLE t2_temp DROP PRIMARY KEY;
|
||||
ALTER TABLE t2_temp ADD PRIMARY KEY (c1);
|
||||
ALTER TABLE t3_temp DROP PRIMARY KEY;
|
||||
ALTER TABLE t3_temp ADD PRIMARY KEY (c1);
|
||||
ALTER TABLE t4_temp DROP PRIMARY KEY;
|
||||
ALTER TABLE t4_temp ADD PRIMARY KEY (c1);
|
||||
# Check duplicate key constraint + insert ignore
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t1_temp VALUES (20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
insert ignore into t1_temp VALUES (20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t2_temp VALUES (20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
insert ignore into t2_temp VALUES (20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t3_temp VALUES (20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
insert ignore into t3_temp VALUES (20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t4_temp VALUES (20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
insert ignore into t4_temp VALUES (20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
|
||||
# check rollback due to duplicate value in second record of insert
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t1_temp VALUES (1,1,'a','a','a','a','a',NOW(),100.55),
|
||||
(20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t2_temp VALUES (1,1,'a','a','a','a','a',NOW(),100.55),
|
||||
(20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t3_temp VALUES (1,1,'a','a','a','a','a',NOW(),100.55),
|
||||
(20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
--error ER_DUP_ENTRY
|
||||
INSERT INTO t4_temp VALUES (1,1,'a','a','a','a','a',NOW(),100.55),
|
||||
(20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
|
||||
set AUTOCOMMIT = 1;
|
||||
|
||||
SELECT c1,c2 FROM t1_temp WHERE c1 in (20,1);
|
||||
SELECT c1,c2 FROM t2_temp WHERE c1 in (20,1);
|
||||
SELECT c1,c2 FROM t3_temp WHERE c1 in (20,1);
|
||||
SELECT c1,c2 FROM t4_temp WHERE c1 in (20,1);
|
||||
|
||||
#replace statement
|
||||
REPLACE INTO t1_temp VALUES (20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
REPLACE INTO t2_temp VALUES (20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
REPLACE INTO t3_temp VALUES (20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
REPLACE INTO t4_temp VALUES (20,1,'a','a','a','a','a',NOW(),100.55);
|
||||
# verify row is replaced FROM (20,20) to (20,1)
|
||||
SELECT c1,c2,c3,c4,c5,c6,c7,c9 FROM t1_temp WHERE c1 = 20;
|
||||
SELECT c1,c2,c3,c4,c5,c6,c7,c9 FROM t2_temp WHERE c1 = 20;
|
||||
SELECT c1,c2,c3,c4,c5,c6,c7,c9 FROM t3_temp WHERE c1 = 20;
|
||||
SELECT c1,c2,c3,c4,c5,c6,c7,c9 FROM t4_temp WHERE c1 = 20;
|
||||
|
||||
# Update ignore. statement is gonored as 20 value exits
|
||||
update ignore t1_temp set c1 = 20 WHERE c1 = 140 ;
|
||||
update ignore t2_temp set c1 = 20 WHERE c1 = 140 ;
|
||||
update ignore t3_temp set c1 = 20 WHERE c1 = 140 ;
|
||||
update ignore t4_temp set c1 = 20 WHERE c1 = 140 ;
|
||||
# see record 140 is present as last update ignored
|
||||
SELECT count(*) FROM t1_temp WHERE c1 = 140;
|
||||
SELECT count(*) FROM t2_temp WHERE c1 = 140;
|
||||
SELECT count(*) FROM t3_temp WHERE c1 = 140;
|
||||
SELECT count(*) FROM t4_temp WHERE c1 = 140;
|
||||
|
||||
# Alter table to ADD COLUMN and PRIMARY KEY
|
||||
ALTER TABLE t1_temp ADD COLUMN c10 int default 99 ,
|
||||
ADD COLUMN c11 varchar(100) default 'test';
|
||||
ALTER TABLE t1_temp DROP PRIMARY KEY;
|
||||
ALTER TABLE t1_temp ADD PRIMARY KEY (c1);
|
||||
INSERT INTO t1_temp (c1,c2,c3,c4,c5,c6,c7,c8,c9) VALUES (-1,-1,'a','a','a','a','a',NOW(),100.55);
|
||||
SELECT c1,c2,c3,c4,c5,c6,c7,c9,c10,c11 FROM t1_temp WHERE c1 < 0;
|
||||
SELECT count(*) FROM t1_temp WHERE c10 = 99 and c11 like 'test';
|
||||
# insert on duplicate key update
|
||||
INSERT INTO t1_temp (c1,c2,c3,c4,c5,c6,c7,c8,c9) VALUES (-1,-1,'a','a','a','a','a',NOW(),100.55)
|
||||
ON DUPLICATE KEY UPDATE c1=-2,c2=-2;
|
||||
SELECT c1,c2,c3,c4,c5,c6,c7,c9,c10,c11 FROM t1_temp WHERE c1 < 0;
|
||||
|
||||
#
|
||||
|
||||
#cleanup
|
||||
DROP TABLE t1_1 ,t2_1 ,t3_1,t4_1;
|
||||
disconnect con1;
|
||||
|
||||
connection con2;
|
||||
DROP TABLE t1_2 ,t2_2 ,t3_2,t4_2;
|
||||
disconnect con2;
|
||||
|
||||
|
||||
connection default;
|
||||
#
|
||||
## trying with VALUES innodb_undo_tablespaces, innodb_undo_logs ,innodb_log_files_in_group
|
||||
##
|
||||
let $restart_parameters = restart: --innodb_undo_tablespaces=0 --innodb_rollback_segments=20 --innodb_undo_logs=20 --innodb_log_files_in_group=4;
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
# Create two client for concurrent execution
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
#
|
||||
#
|
||||
connection con1;
|
||||
--send call populate_tables('_1');
|
||||
connection con2;
|
||||
--send call populate_tables('_2');
|
||||
--echo "#connection 1 - verify tables"
|
||||
connection con1;
|
||||
--reap
|
||||
SELECT count(*) FROM t1_1;
|
||||
SELECT count(*) FROM t2_1;
|
||||
SELECT count(*) FROM t3_1;
|
||||
SELECT count(*) FROM t4_1;
|
||||
SELECT c1 FROM t1_1;
|
||||
SELECT c1 FROM t2_1;
|
||||
SELECT c1 FROM t3_1;
|
||||
SELECT c1 FROM t4_1;
|
||||
SELECT count(*) FROM t1_temp;
|
||||
SELECT count(*) FROM t2_temp;
|
||||
SELECT count(*) FROM t3_temp;
|
||||
SELECT count(*) FROM t4_temp;
|
||||
SELECT c1 FROM t1_temp;
|
||||
SELECT c1 FROM t2_temp;
|
||||
SELECT c1 FROM t3_temp;
|
||||
SELECT c1 FROM t4_temp;
|
||||
DROP TABLE t1_1 ,t2_1 ,t3_1,t4_1;
|
||||
disconnect con1;
|
||||
--echo "#connection 2 - verify tables"
|
||||
connection con2;
|
||||
--reap
|
||||
SELECT count(*) FROM t1_2;
|
||||
SELECT count(*) FROM t2_2;
|
||||
SELECT count(*) FROM t3_2;
|
||||
SELECT count(*) FROM t4_2;
|
||||
SELECT c1 FROM t1_2;
|
||||
SELECT c1 FROM t2_2;
|
||||
SELECT c1 FROM t3_2;
|
||||
SELECT c1 FROM t4_2;
|
||||
SELECT count(*) FROM t1_temp;
|
||||
SELECT count(*) FROM t2_temp;
|
||||
SELECT count(*) FROM t3_temp;
|
||||
SELECT count(*) FROM t4_temp;
|
||||
SELECT c1 FROM t1_temp;
|
||||
SELECT c1 FROM t2_temp;
|
||||
SELECT c1 FROM t3_temp;
|
||||
SELECT c1 FROM t4_temp;
|
||||
DROP TABLE t1_2 ,t2_2 ,t3_2,t4_2;
|
||||
disconnect con2;
|
||||
|
||||
connection default;
|
||||
# innodb_undo_logs > non redo rsegment
|
||||
let $restart_parameters = restart: --innodb_undo_tablespaces=0 --innodb_rollback_segments=30 --innodb_undo_logs=20 --innodb_log_files_in_group=4;
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
connection con1;
|
||||
--send call populate_tables('_1');
|
||||
connection con2;
|
||||
--send call populate_tables('_2');
|
||||
--echo "#connection 1 - verify tables"
|
||||
connection con1;
|
||||
--reap
|
||||
SELECT count(*) FROM t1_1;
|
||||
SELECT count(*) FROM t2_1;
|
||||
SELECT count(*) FROM t3_1;
|
||||
SELECT count(*) FROM t4_1;
|
||||
SELECT c1 FROM t1_1;
|
||||
SELECT c1 FROM t2_1;
|
||||
SELECT c1 FROM t3_1;
|
||||
SELECT c1 FROM t4_1;
|
||||
SELECT count(*) FROM t1_temp;
|
||||
SELECT count(*) FROM t2_temp;
|
||||
SELECT count(*) FROM t3_temp;
|
||||
SELECT count(*) FROM t4_temp;
|
||||
SELECT c1 FROM t1_temp;
|
||||
SELECT c1 FROM t2_temp;
|
||||
SELECT c1 FROM t3_temp;
|
||||
SELECT c1 FROM t4_temp;
|
||||
DROP TABLE t1_1 ,t2_1 ,t3_1,t4_1;
|
||||
disconnect con1;
|
||||
--echo "#connection 2 - verify tables"
|
||||
connection con2;
|
||||
--reap
|
||||
SELECT count(*) FROM t1_2;
|
||||
SELECT count(*) FROM t2_2;
|
||||
SELECT count(*) FROM t3_2;
|
||||
SELECT count(*) FROM t4_2;
|
||||
SELECT c1 FROM t1_2;
|
||||
SELECT c1 FROM t2_2;
|
||||
SELECT c1 FROM t3_2;
|
||||
SELECT c1 FROM t4_2;
|
||||
SELECT count(*) FROM t1_temp;
|
||||
SELECT count(*) FROM t2_temp;
|
||||
SELECT count(*) FROM t3_temp;
|
||||
SELECT count(*) FROM t4_temp;
|
||||
SELECT c1 FROM t1_temp;
|
||||
SELECT c1 FROM t2_temp;
|
||||
SELECT c1 FROM t3_temp;
|
||||
SELECT c1 FROM t4_temp;
|
||||
DROP TABLE t1_2 ,t2_2 ,t3_2,t4_2;
|
||||
disconnect con2;
|
||||
|
||||
#
|
||||
|
||||
connection default;
|
||||
DROP PROCEDURE populate_tables;
|
||||
|
||||
# check message in log
|
||||
let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err;
|
||||
let SEARCH_FILE= $error_log;
|
||||
# We get depending on the platform either "./ibdata1" or ".\ibdata1".
|
||||
let SEARCH_PATTERN=redo rollback segment.*found.*redo rollback segment.*active
|
||||
--source include/search_pattern_in_file.inc
|
||||
let SEARCH_PATTERN=non-redo rollback.*active
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
|
||||
SHOW TABLES;
|
||||
|
||||
-- disable_query_log
|
||||
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
|
||||
-- enable_query_log
|
||||
|
Reference in New Issue
Block a user