From 3045b60f0fa953b779eaf8bd4e83a8dd807c2107 Mon Sep 17 00:00:00 2001 From: Alexey Yurchenko Date: Sat, 20 Aug 2016 13:42:11 +0200 Subject: GAL-401: MTR test for the fix. --- mysql-test/suite/galera/r/GAL-401.result | 21 ++++++++++++++ mysql-test/suite/galera/t/GAL-401.test | 48 ++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 mysql-test/suite/galera/r/GAL-401.result create mode 100644 mysql-test/suite/galera/t/GAL-401.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/GAL-401.result b/mysql-test/suite/galera/r/GAL-401.result new file mode 100644 index 00000000000..e1da2b4cf1a --- /dev/null +++ b/mysql-test/suite/galera/r/GAL-401.result @@ -0,0 +1,21 @@ +SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; +SET @@global.wsrep_desync = 1; +SET SESSION wsrep_dirty_reads=1; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1'; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0'; +SET wsrep_dirty_reads=0; +SHOW STATUS LIKE 'wsrep_desync_count'; +Variable_name Value +wsrep_desync_count 0 +SET @@global.wsrep_desync = 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` char(1) DEFAULT NULL, + PRIMARY KEY (`f1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; +CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored."); +SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false'; diff --git a/mysql-test/suite/galera/t/GAL-401.test b/mysql-test/suite/galera/t/GAL-401.test new file mode 100644 index 00000000000..1f7b493717f --- /dev/null +++ b/mysql-test/suite/galera/t/GAL-401.test @@ -0,0 +1,48 @@ +# This tests proper desync counter cleanup when DONOR/DESYNC state is cleared. + +--source include/galera_cluster.inc +--source include/have_innodb.inc + +# Make node 1 tolerate split-brain +SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; + +# Desync and disconnect node 2 from the PC: +--connection node_2 +SET @@global.wsrep_desync = 1; +SET SESSION wsrep_dirty_reads=1; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1'; +--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc + +# Wait until node 2 disappears from the PC: +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc + +# Modify app state to force node 2 into PRIMARY upon reconnection. +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); + +# Reconnect node 2 to the PC: +--connection node_2 +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0'; +SET wsrep_dirty_reads=0; +--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +# Must return 0: +SHOW STATUS LIKE 'wsrep_desync_count'; + +# Resync node_2, should pass: +SET @@global.wsrep_desync = 0; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored."); + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false'; -- cgit v1.2.1 From 86ec6c221a16733cc0d8280b52fc79f48e842b8f Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Sun, 12 Mar 2017 13:56:29 +0530 Subject: MW-267: followup to the original pull request, removed unnecessary cast. Signed-off-by: Sachin Setiya --- .../suite/galera/galera_2nodes_as_master_slave.cnf | 83 ++++++++ .../galera_2nodes_as_master_with_repl_filter.cnf | 87 +++++++++ mysql-test/suite/galera/r/ev51914.result | 162 ++++++++++++++++ mysql-test/suite/galera/r/galera_admin.result | 43 +++++ .../suite/galera/r/galera_desync_overlapped.result | 45 +++++ .../r/galera_restart_on_unknown_option.result | 40 ++++ .../suite/galera/r/galera_toi_ddl_fk_update.result | 23 +++ .../suite/galera/r/galera_toi_ddl_online.result | 27 +++ .../suite/galera/r/galera_toi_drop_database.result | 22 +++ .../suite/galera/r/galera_toi_truncate.result | 17 ++ .../r/galera_wsrep_provider_options_syntax.result | 5 + mysql-test/suite/galera/r/lp1376747-2.result | 19 ++ mysql-test/suite/galera/r/lp1376747-3.result | 21 ++ mysql-test/suite/galera/r/lp1376747-4.result | 36 ++++ mysql-test/suite/galera/r/lp1376747.result | 19 ++ mysql-test/suite/galera/r/pxc-421.result | 35 ++++ mysql-test/suite/galera/t/ev51914.test | 214 +++++++++++++++++++++ mysql-test/suite/galera/t/galera_admin.test | 86 +++++++++ .../suite/galera/t/galera_desync_overlapped.test | 59 ++++++ mysql-test/suite/galera/t/galera_flush_local.opt | 2 +- .../galera/t/galera_restart_on_unknown_option.test | 150 +++++++++++++++ .../suite/galera/t/galera_toi_ddl_fk_update.test | 49 +++++ .../suite/galera/t/galera_toi_ddl_online.test | 53 +++++ .../suite/galera/t/galera_toi_drop_database.test | 54 ++++++ mysql-test/suite/galera/t/galera_toi_truncate.test | 77 ++++++++ .../t/galera_wsrep_provider_options_syntax.test | 20 ++ mysql-test/suite/galera/t/lp1376747-2.test | 22 +++ mysql-test/suite/galera/t/lp1376747-3.test | 28 +++ mysql-test/suite/galera/t/lp1376747-4.test | 53 +++++ mysql-test/suite/galera/t/lp1376747.test | 24 +++ mysql-test/suite/galera/t/pxc-421.test | 60 ++++++ 31 files changed, 1634 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf create mode 100644 mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf create mode 100644 mysql-test/suite/galera/r/ev51914.result create mode 100644 mysql-test/suite/galera/r/galera_admin.result create mode 100644 mysql-test/suite/galera/r/galera_desync_overlapped.result create mode 100644 mysql-test/suite/galera/r/galera_restart_on_unknown_option.result create mode 100644 mysql-test/suite/galera/r/galera_toi_ddl_fk_update.result create mode 100644 mysql-test/suite/galera/r/galera_toi_ddl_online.result create mode 100644 mysql-test/suite/galera/r/galera_toi_drop_database.result create mode 100644 mysql-test/suite/galera/r/galera_toi_truncate.result create mode 100644 mysql-test/suite/galera/r/galera_wsrep_provider_options_syntax.result create mode 100644 mysql-test/suite/galera/r/lp1376747-2.result create mode 100644 mysql-test/suite/galera/r/lp1376747-3.result create mode 100644 mysql-test/suite/galera/r/lp1376747-4.result create mode 100644 mysql-test/suite/galera/r/lp1376747.result create mode 100644 mysql-test/suite/galera/r/pxc-421.result create mode 100644 mysql-test/suite/galera/t/ev51914.test create mode 100644 mysql-test/suite/galera/t/galera_admin.test create mode 100644 mysql-test/suite/galera/t/galera_desync_overlapped.test create mode 100644 mysql-test/suite/galera/t/galera_restart_on_unknown_option.test create mode 100644 mysql-test/suite/galera/t/galera_toi_ddl_fk_update.test create mode 100644 mysql-test/suite/galera/t/galera_toi_ddl_online.test create mode 100644 mysql-test/suite/galera/t/galera_toi_drop_database.test create mode 100644 mysql-test/suite/galera/t/galera_toi_truncate.test create mode 100644 mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test create mode 100644 mysql-test/suite/galera/t/lp1376747-2.test create mode 100644 mysql-test/suite/galera/t/lp1376747-3.test create mode 100644 mysql-test/suite/galera/t/lp1376747-4.test create mode 100644 mysql-test/suite/galera/t/lp1376747.test create mode 100644 mysql-test/suite/galera/t/pxc-421.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf b/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf new file mode 100644 index 00000000000..716a790fea6 --- /dev/null +++ b/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf @@ -0,0 +1,83 @@ + +# +# Let's understand the topology. +# * Independent Master with server-id = 1 +# * Galera cluster with 2 nodes: node#1 and node#2 with server-id = 2, 3 +# node#1 act as slave to Independent Master with server-id = 1 +# * Independent Slave with server-id = 4 replicating from galera node#2 +# + +# Use default setting for mysqld processes +!include include/default_mysqld.cnf + +[mysqld] +log-slave-updates +log-bin=mysqld-bin +binlog-format=row +gtid-mode=on +enforce-gtid-consistency=true + +[mysqld.1] +server-id=1 + +[mysqld.2] +server-id=2 + +wsrep_provider=@ENV.WSREP_PROVIDER +wsrep_cluster_address='gcomm://' +wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts=1;' + +# enforce read-committed characteristics across the cluster +wsrep_causal_reads=ON +wsrep_sync_wait = 7 + +wsrep_node_address=127.0.0.1 +wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port +wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port + +# Required for Galera +innodb_autoinc_lock_mode=2 + +innodb_flush_log_at_trx_commit=2 + +[mysqld.3] +server-id=3 + +wsrep_provider=@ENV.WSREP_PROVIDER +wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port' +wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts = 1;' + +# enforce read-committed characteristics across the cluster +wsrep_causal_reads=ON +wsrep_sync_wait = 7 + +wsrep_node_address=127.0.0.1 +wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port +wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port + +# Required for Galera +innodb_autoinc_lock_mode=2 + +innodb_flush_log_at_trx_commit=2 + +[mysqld.4] +server-id=4 + +[ENV] +NODE_MYPORT_1= @mysqld.1.port +NODE_MYSOCK_1= @mysqld.1.socket + +NODE_MYPORT_2= @mysqld.2.port +NODE_MYSOCK_2= @mysqld.2.socket + +NODE_MYPORT_3= @mysqld.3.port +NODE_MYSOCK_3= @mysqld.3.socket + +NODE_MYPORT_4= @mysqld.4.port +NODE_MYSOCK_4= @mysqld.4.socket + +NODE_GALERAPORT_2= @mysqld.2.#galera_port +NODE_GALERAPORT_3= @mysqld.3.#galera_port + +NODE_SSTPORT_2= @mysqld.2.#sst_port +NODE_SSTPORT_3= @mysqld.3.#sst_port diff --git a/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf b/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf new file mode 100644 index 00000000000..5f0af2e58e5 --- /dev/null +++ b/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf @@ -0,0 +1,87 @@ +# +# This .cnf file creates a setup with a 2-node Galera cluster and one stand-alone MySQL server, to be used as a slave +# + +# Use default setting for mysqld processes +!include include/default_mysqld.cnf + +[mysqld] +default-storage-engine=InnoDB + +[mysqld.1] +server-id=1 +binlog-format=row +log-bin=mysqld-bin +log_slave_updates +gtid-mode=on +enforce-gtid-consistency=true +event-scheduler=1 + +wsrep_provider=@ENV.WSREP_PROVIDER +wsrep_cluster_address='gcomm://' +wsrep_provider_options='base_port=@mysqld.1.#galera_port' + +# enforce read-committed characteristics across the cluster +wsrep_causal_reads=ON +wsrep_sync_wait = 7 + +wsrep_node_address=127.0.0.1 +wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port +wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port + +# Required for Galera +innodb_autoinc_lock_mode=2 + +innodb_flush_log_at_trx_commit=2 + +[mysqld.2] +server-id=2 +binlog-format=row +log-bin=mysqld-bin +log_slave_updates +gtid-mode=on +enforce-gtid-consistency=true +event-scheduler=1 + +wsrep_provider=@ENV.WSREP_PROVIDER +wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' +wsrep_provider_options='base_port=@mysqld.2.#galera_port' + +# enforce read-committed characteristics across the cluster +wsrep_causal_reads=ON +wsrep_sync_wait = 7 + +wsrep_node_address=127.0.0.1 +wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port +wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port + +# Required for Galera +innodb_autoinc_lock_mode=2 + +innodb_flush_log_at_trx_commit=2 + +[mysqld.3] +server-id=3 +replicate-ignore-db=test +replicate-wild-ignore-table=test.% +log-bin=mysqld-bin +log_slave_updates +gtid-mode=on +enforce-gtid-consistency=true +event-scheduler=1 + +[ENV] +NODE_MYPORT_1= @mysqld.1.port +NODE_MYSOCK_1= @mysqld.1.socket + +NODE_MYPORT_2= @mysqld.2.port +NODE_MYSOCK_2= @mysqld.2.socket + +NODE_MYPORT_3= @mysqld.3.port +NODE_MYSOCK_3= @mysqld.3.socket + +NODE_GALERAPORT_1= @mysqld.1.#galera_port +NODE_GALERAPORT_2= @mysqld.2.#galera_port + +NODE_SSTPORT_1= @mysqld.1.#sst_port +NODE_SSTPORT_2= @mysqld.2.#sst_port diff --git a/mysql-test/suite/galera/r/ev51914.result b/mysql-test/suite/galera/r/ev51914.result new file mode 100644 index 00000000000..4b9f7ace0da --- /dev/null +++ b/mysql-test/suite/galera/r/ev51914.result @@ -0,0 +1,162 @@ +SAVEPOINT in a stored function should be forbidden +CREATE FUNCTION f1 () RETURNS INT BEGIN +SAVEPOINT s; +RETURN 1; +END| +SELECT f1(); +f1() +1 +DROP FUNCTION f1; +ROLLBACK TO SAVEPOINT in a stored function should be forbidden +CREATE FUNCTION f2 () RETURNS INT BEGIN +ROLLBACK TO SAVEPOINT s; +RETURN 1; +END| +BEGIN; +SAVEPOINT s; +SELECT f2(); +ERROR 42000: SAVEPOINT s does not exist +COMMIT; +DROP FUNCTION f2; +BEGIN; +SAVEPOINT S; +ROLLBACK TO SAVEPOINT S; +COMMIT; +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (a INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +INSERT INTO t1 values (110), (111), (112), (113), (114); +Direct SAVEPOINT in a trigger should be forbidden +CREATE TRIGGER i1_t1 BEFORE INSERT ON t1 FOR EACH ROW SAVEPOINT s; +INSERT INTO t1 VALUES (1); +DROP TRIGGER i1_t1; +CREATE TRIGGER i2_t1 AFTER INSERT ON t1 FOR EACH ROW SAVEPOINT s; +INSERT INTO t1 VALUES (2); +DROP TRIGGER i2_t1; +INSERT INTO t1 VALUES (3); +CREATE TRIGGER u1_t1 BEFORE UPDATE ON t1 FOR EACH ROW SAVEPOINT s; +UPDATE t1 SET a=4 WHERE a=3; +DROP TRIGGER u1_t1; +CREATE TRIGGER u2_t1 AFTER UPDATE ON t1 FOR EACH ROW SAVEPOINT s; +UPDATE t1 SET a=4 WHERE a=3; +DROP TRIGGER u2_t1; +CREATE TRIGGER d1_t1 BEFORE DELETE ON t1 FOR EACH ROW SAVEPOINT s; +DELETE FROM t1; +DROP TRIGGER d1_t1; +CREATE TRIGGER d1_t1 AFTER DELETE ON t1 FOR EACH ROW SAVEPOINT s; +DELETE FROM t1; +DROP TRIGGER d1_t1; +SAVEPOINT in a compound statement in a trigger should be forbidden +CREATE TRIGGER i3_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN +SAVEPOINT s; +END| +INSERT INTO t1 VALUES (5); +DROP TRIGGER i3_t1; +SAVEPOINT in a PS call in a trigger should be forbidden +CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN +PREPARE set_savepoint FROM "SAVEPOINT s"; +EXECUTE set_savepoint; +DEALLOCATE PREPARE set_savepoint; +END| +ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger +SAVEPOINT in SP called from a trigger should be forbidden +CREATE PROCEDURE p1() BEGIN +SAVEPOINT s; +END| +CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1; +INSERT INTO t1 VALUES (6); +DROP TRIGGER i5_t1; +SAVEPOINT in a SP called from a PS called from a trigger be forbidden +PREPARE call_p1 FROM "CALL p1"; +CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW EXECUTE call_p1; +ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger +SAVEPOINT in a function called from a trigger should be forbidden +CREATE FUNCTION f1 () RETURNS INT BEGIN +SAVEPOINT s; +RETURN 1; +END| +CREATE TRIGGER i7_t1 BEFORE INSERT ON t1 FOR EACH ROW SET @foo = f1(); +INSERT INTO t1 VALUES (7); +DROP TRIGGER i7_t1; +SAVEPOINT in a SP called from a SP called from a trigger should be forbidden +CREATE PROCEDURE p2() BEGIN +CALL p1(); +END| +CREATE TRIGGER i8_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p2; +INSERT INTO t1 VALUES (8); +DROP TRIGGER i8_t1; +SAVEPOINT in a SP called from a trigger called from a SP should be forbidden +CREATE TRIGGER i9_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1; +CREATE PROCEDURE p3() BEGIN +INSERT INTO t1 VALUES (9); +END| +CALL p3(); +DROP TRIGGER i9_t1; +ROLLBACK TO SAVEPOINT in trigger as a trivial statement should be forbidden +CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW ROLLBACK TO SAVEPOINT s; +BEGIN; +SAVEPOINT s; +INSERT INTO t1 VALUES (5); +ERROR 42000: SAVEPOINT s does not exist +COMMIT; +DROP TRIGGER i4_t1; +ROLLBACK TO SAVEPOINT in a trigger in a SP call should be forbidden +CREATE PROCEDURE p4() BEGIN +ROLLBACK TO SAVEPOINT s; +END| +CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p4; +BEGIN; +SAVEPOINT s; +INSERT INTO t1 VALUES (6); +ERROR 42000: SAVEPOINT s does not exist +COMMIT; +DROP TRIGGER i5_t1; +SAVEPOINT in a SP next to a trigger should work +CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a = NEW.a + 1; +CREATE PROCEDURE p5() BEGIN +SAVEPOINT s; +INSERT INTO t1 VALUES (10); +ROLLBACK TO SAVEPOINT s; +END| +BEGIN; +CALL p5(); +COMMIT; +DROP TRIGGER i6_t1; +create trigger t1 before insert on t1 for each row +begin +insert into t2 values (NULL); +end| +INSERT INTO t1 VALUES (201), (202), (203); +SELECT * FROM t1; +a +5 +6 +7 +8 +9 +201 +202 +203 +SELECT COUNT(*) FROM t2; +COUNT(*) +3 +SELECT * FROM t1; +a +5 +6 +7 +8 +9 +201 +202 +203 +SELECT COUNT(*) FROM t2; +COUNT(*) +3 +DEALLOCATE PREPARE call_p1; +DROP TABLE t1, t2; +DROP PROCEDURE p1; +DROP PROCEDURE p2; +DROP PROCEDURE p3; +DROP PROCEDURE p4; +DROP PROCEDURE p5; +DROP FUNCTION f1; diff --git a/mysql-test/suite/galera/r/galera_admin.result b/mysql-test/suite/galera/r/galera_admin.result new file mode 100644 index 00000000000..e58b0a5e310 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_admin.result @@ -0,0 +1,43 @@ +DROP TABLE IF EXISTS t1, t2; +DROP TABLE IF EXISTS x1, x2; +CREATE TABLE t1 (f1 INTEGER); +CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER); +SET GLOBAL wsrep_replicate_myisam = TRUE; +CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM; +CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4; +INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +# ANALYZE test +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +# OPTIMIZE test +OPTIMIZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +test.t2 optimize note Table does not support optimize, doing recreate + analyze instead +test.t2 optimize status OK +# REPAIR test +REPAIR TABLE x1, x2; +Table Op Msg_type Msg_text +test.x1 repair status OK +test.x2 repair status OK +SELECT COUNT(*) = 10 FROM t1; +COUNT(*) = 10 +1 +SELECT COUNT(*) = 10 FROM x1; +COUNT(*) = 10 +1 +SELECT COUNT(*) = 10000 FROM t2; +COUNT(*) = 10000 +1 +SELECT COUNT(*) = 10 FROM x2; +COUNT(*) = 10 +1 +DROP TABLE t1, t2; +DROP TABLE x1, x2; +SET GLOBAL wsrep_replicate_myisam = FALSE; diff --git a/mysql-test/suite/galera/r/galera_desync_overlapped.result b/mysql-test/suite/galera/r/galera_desync_overlapped.result new file mode 100644 index 00000000000..a1e7d59a661 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_desync_overlapped.result @@ -0,0 +1,45 @@ +CREATE TABLE ten (f1 INTEGER); +INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +CREATE TABLE t1 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB; +CREATE TABLE t2 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB; +SET GLOBAL wsrep_desync = 1; +show status like 'wsrep_desync_count'; +Variable_name Value +wsrep_desync_count 1 +SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter1 WAIT_FOR alter2'; +INSERT INTO t1 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3; +SET GLOBAL wsrep_desync = 1; +Warnings: +Warning 1231 'wsrep_desync' is already ON. +show status like 'wsrep_desync_count'; +Variable_name Value +wsrep_desync_count 1 +SET DEBUG_SYNC='now WAIT_FOR alter1'; +SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter2'; +INSERT INTO t2 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3; +SET DEBUG_SYNC='RESET'; +SET GLOBAL wsrep_desync = 0; +show status like 'wsrep_desync_count'; +Variable_name Value +wsrep_desync_count 0 +SET GLOBAL wsrep_desync = 0; +Warnings: +Warning 1231 'wsrep_desync' is already OFF. +show status like 'wsrep_desync_count'; +Variable_name Value +wsrep_desync_count 0 +show status like 'wsrep_desync_count'; +Variable_name Value +wsrep_desync_count 0 +SET GLOBAL wsrep_desync = 0; +Warnings: +Warning 1231 'wsrep_desync' is already OFF. +SELECT COUNT(*) FROM t1; +COUNT(*) +1000 +SELECT COUNT(*) FROM t2; +COUNT(*) +1000 +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE ten; diff --git a/mysql-test/suite/galera/r/galera_restart_on_unknown_option.result b/mysql-test/suite/galera/r/galera_restart_on_unknown_option.result new file mode 100644 index 00000000000..a21b1edf3e7 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_restart_on_unknown_option.result @@ -0,0 +1,40 @@ +CALL mtr.add_suppression("Aborting"); +CALL mtr.add_suppression("unknown option '--galera-unknown-option'"); +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); +INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'); +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 a +Shutting down server ... +UPDATE t1 SET f2 = 'b' WHERE f1 > 1; +UPDATE t1 SET f2 = 'c' WHERE f1 > 2; +SELECT * FROM t1; +f1 f2 +1 a +2 b +3 c +Starting server ... +Starting server ... +SELECT * FROM t1; +f1 f2 +1 a +2 b +3 c +Shutting down server ... +UPDATE t1 SET f2 = 'd' WHERE f1 > 1; +UPDATE t1 SET f2 = 'd' WHERE f1 > 2; +SELECT * FROM t1; +f1 f2 +1 a +2 d +3 d +Starting server ... +Starting server ... +SELECT * FROM t1; +f1 f2 +1 a +2 d +3 d +DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_fk_update.result b/mysql-test/suite/galera/r/galera_toi_ddl_fk_update.result new file mode 100644 index 00000000000..8366cfd27c8 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_toi_ddl_fk_update.result @@ -0,0 +1,23 @@ +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +CREATE TABLE parent ( +id INT PRIMARY KEY, +KEY (id) +) ENGINE=InnoDB; +CREATE TABLE child ( +id INT PRIMARY KEY AUTO_INCREMENT, +parent_id INT +) ENGINE=InnoDB; +INSERT INTO parent VALUES (1); +INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; +ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id) ON UPDATE CASCADE;; +UPDATE parent SET id = 2 WHERE id = 1;; +SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2; +COUNT(*) = 10000 +1 +SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2; +COUNT(*) = 10000 +1 +DROP TABLE child; +DROP TABLE parent; +DROP TABLE ten; diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_online.result b/mysql-test/suite/galera/r/galera_toi_ddl_online.result new file mode 100644 index 00000000000..488b72ab843 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_toi_ddl_online.result @@ -0,0 +1,27 @@ +CREATE TABLE ten (f1 INTEGER); +INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; +INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; +CREATE INDEX i1 ON t1 (f2);; +ALTER TABLE t1 ADD COLUMN f3 INTEGER;; +SELECT COUNT(*) = 200000 FROM t1; +COUNT(*) = 200000 +1 +SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; +COUNT(*) = 3 +1 +SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1'; +COUNT(*) = 2 +1 +SELECT COUNT(*) = 200000 FROM t1; +COUNT(*) = 200000 +1 +SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; +COUNT(*) = 3 +1 +SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1'; +COUNT(*) = 2 +1 +DROP TABLE t1; +DROP TABLE ten; diff --git a/mysql-test/suite/galera/r/galera_toi_drop_database.result b/mysql-test/suite/galera/r/galera_toi_drop_database.result new file mode 100644 index 00000000000..d4f98c38847 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_toi_drop_database.result @@ -0,0 +1,22 @@ +CREATE DATABASE database1; +USE database1; +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; +USE database1; +INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; +DROP DATABASE database1;; +ERROR 42S02: Table 'database1.t1' doesn't exist +ERROR 42S02: Table 'database1.t2' doesn't exist +SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1'; +COUNT(*) = 0 +1 +USE database1; +ERROR 42000: Unknown database 'database1' +SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1'; +COUNT(*) = 0 +1 +USE database1; +ERROR 42000: Unknown database 'database1' diff --git a/mysql-test/suite/galera/r/galera_toi_truncate.result b/mysql-test/suite/galera/r/galera_toi_truncate.result new file mode 100644 index 00000000000..98bc9f4850b --- /dev/null +++ b/mysql-test/suite/galera/r/galera_toi_truncate.result @@ -0,0 +1,17 @@ +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;; +TRUNCATE TABLE t1;; +SELECT COUNT(*) = 1000000 FROM t1; +COUNT(*) = 1000000 +1 +DROP TABLE t1; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;; +TRUNCATE TABLE t1;; +SELECT COUNT(*) = 1000000 FROM t1; +COUNT(*) = 1000000 +1 +DROP TABLE t1; +DROP TABLE ten; diff --git a/mysql-test/suite/galera/r/galera_wsrep_provider_options_syntax.result b/mysql-test/suite/galera/r/galera_wsrep_provider_options_syntax.result new file mode 100644 index 00000000000..f19dc40205b --- /dev/null +++ b/mysql-test/suite/galera/r/galera_wsrep_provider_options_syntax.result @@ -0,0 +1,5 @@ +call mtr.add_suppression("WSREP\: Unknown parameter 'gmcasts\.segment'"); +call mtr.add_suppression("WSREP\: Set options returned 7"); +SET GLOBAL wsrep_provider_options="gmcasts.segment=1"; +ERROR HY000: Incorrect arguments to SET +Unhandled exceptions: 0 diff --git a/mysql-test/suite/galera/r/lp1376747-2.result b/mysql-test/suite/galera/r/lp1376747-2.result new file mode 100644 index 00000000000..3b8aee61ed2 --- /dev/null +++ b/mysql-test/suite/galera/r/lp1376747-2.result @@ -0,0 +1,19 @@ +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +FLUSH TABLES t1 FOR EXPORT; +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +INSERT INTO t1 VALUES (2,3); +UNLOCK TABLES; +### t1 should have column f2 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `f2` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * from t1; +id f2 +1 NULL +2 3 +DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/lp1376747-3.result b/mysql-test/suite/galera/r/lp1376747-3.result new file mode 100644 index 00000000000..fc982c94244 --- /dev/null +++ b/mysql-test/suite/galera/r/lp1376747-3.result @@ -0,0 +1,21 @@ +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +FLUSH TABLE WITH READ LOCK; +### This shouldn't block. +FLUSH TABLES t1 FOR EXPORT; +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +UNLOCK TABLES; +### t1 should have column f2 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `f2` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (2,3); +SELECT * from t1; +id f2 +1 NULL +2 3 +DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/lp1376747-4.result b/mysql-test/suite/galera/r/lp1376747-4.result new file mode 100644 index 00000000000..b0ae2b7fc92 --- /dev/null +++ b/mysql-test/suite/galera/r/lp1376747-4.result @@ -0,0 +1,36 @@ +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +SET session wsrep_sync_wait=0; +SET session wsrep_causal_reads=OFF; +FLUSH TABLE WITH READ LOCK; +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +INSERT INTO t1 VALUES (2,3); +SET session wsrep_sync_wait=0; +SET session wsrep_causal_reads=OFF; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +FLUSH TABLES t1 WITH READ LOCK;; +UNLOCK TABLES; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +UNLOCK TABLES; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `f2` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * from t1; +id f2 +1 NULL +2 3 +DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/lp1376747.result b/mysql-test/suite/galera/r/lp1376747.result new file mode 100644 index 00000000000..4617d5952bb --- /dev/null +++ b/mysql-test/suite/galera/r/lp1376747.result @@ -0,0 +1,19 @@ +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +FLUSH TABLES t1 WITH READ LOCK; +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +INSERT INTO t1 VALUES (2,3); +UNLOCK TABLES; +### t1 should have column f2 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `f2` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT * from t1; +id f2 +1 NULL +2 3 +DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/pxc-421.result b/mysql-test/suite/galera/r/pxc-421.result new file mode 100644 index 00000000000..1822201f338 --- /dev/null +++ b/mysql-test/suite/galera/r/pxc-421.result @@ -0,0 +1,35 @@ +set GLOBAL wsrep_slave_threads=26; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 (f1) SELECT * from t1 as x1; +set GLOBAL wsrep_slave_threads=16; +SET GLOBAL wsrep_provider='none'; +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +set GLOBAL wsrep_slave_threads=5; +SELECT COUNT(*) = 5 FROM t1; +COUNT(*) = 5 +1 +set GLOBAL wsrep_slave_threads=12; +SELECT COUNT(*) = 4 FROM t1; +COUNT(*) = 4 +1 +INSERT INTO t1 VALUES (100), (101), (102); +set GLOBAL wsrep_slave_threads=5; +INSERT INTO t1 (f1) SELECT * from t1 as x1; +show global variables like 'wsrep_slave_threads'; +Variable_name Value +wsrep_slave_threads 5 +SET GLOBAL wsrep_slave_threads = 1; +SELECT COUNT(*) FROM t1; +COUNT(*) +16 +SELECT COUNT(*) FROM t1; +COUNT(*) +15 +show global variables like 'wsrep_slave_threads'; +Variable_name Value +wsrep_slave_threads 12 +SET GLOBAL wsrep_slave_threads = 1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/ev51914.test b/mysql-test/suite/galera/t/ev51914.test new file mode 100644 index 00000000000..e5edacabe89 --- /dev/null +++ b/mysql-test/suite/galera/t/ev51914.test @@ -0,0 +1,214 @@ +# Disable SAVEPOINT and ROLLBACK TO SAVEPOINT in SP, SF, TR. + +--source include/galera_cluster.inc +--source include/have_innodb.inc + + +--connection node_1 +--echo SAVEPOINT in a stored function should be forbidden +--delimiter | +CREATE FUNCTION f1 () RETURNS INT BEGIN + SAVEPOINT s; + RETURN 1; +END| +--delimiter ; + +SELECT f1(); + +DROP FUNCTION f1; + +--echo ROLLBACK TO SAVEPOINT in a stored function should be forbidden +--delimiter | +CREATE FUNCTION f2 () RETURNS INT BEGIN + ROLLBACK TO SAVEPOINT s; + RETURN 1; +END| +--delimiter ; + +BEGIN; +SAVEPOINT s; +--error ER_SP_DOES_NOT_EXIST +SELECT f2(); +COMMIT; + +DROP FUNCTION f2; + +BEGIN; +SAVEPOINT S; +ROLLBACK TO SAVEPOINT S; +COMMIT; + + +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (a INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +INSERT INTO t1 values (110), (111), (112), (113), (114); + +--echo Direct SAVEPOINT in a trigger should be forbidden +--connection node_2 +CREATE TRIGGER i1_t1 BEFORE INSERT ON t1 FOR EACH ROW SAVEPOINT s; + +--connection node_1 +INSERT INTO t1 VALUES (1); +DROP TRIGGER i1_t1; + +CREATE TRIGGER i2_t1 AFTER INSERT ON t1 FOR EACH ROW SAVEPOINT s; +INSERT INTO t1 VALUES (2); +DROP TRIGGER i2_t1; + +INSERT INTO t1 VALUES (3); +CREATE TRIGGER u1_t1 BEFORE UPDATE ON t1 FOR EACH ROW SAVEPOINT s; +UPDATE t1 SET a=4 WHERE a=3; +DROP TRIGGER u1_t1; + +CREATE TRIGGER u2_t1 AFTER UPDATE ON t1 FOR EACH ROW SAVEPOINT s; +UPDATE t1 SET a=4 WHERE a=3; +DROP TRIGGER u2_t1; + +CREATE TRIGGER d1_t1 BEFORE DELETE ON t1 FOR EACH ROW SAVEPOINT s; +DELETE FROM t1; +DROP TRIGGER d1_t1; + +CREATE TRIGGER d1_t1 AFTER DELETE ON t1 FOR EACH ROW SAVEPOINT s; +DELETE FROM t1; +DROP TRIGGER d1_t1; + +--echo SAVEPOINT in a compound statement in a trigger should be forbidden +--delimiter | +CREATE TRIGGER i3_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN + SAVEPOINT s; +END| +--delimiter ; +INSERT INTO t1 VALUES (5); +DROP TRIGGER i3_t1; + +--echo SAVEPOINT in a PS call in a trigger should be forbidden +# echo handled by SAVEPOINT forbidden in PS +--delimiter | +--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG +CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN + PREPARE set_savepoint FROM "SAVEPOINT s"; + EXECUTE set_savepoint; + DEALLOCATE PREPARE set_savepoint; +END| +--delimiter ; + +--connection node_2 +--echo SAVEPOINT in SP called from a trigger should be forbidden +--delimiter | +CREATE PROCEDURE p1() BEGIN + SAVEPOINT s; +END| +--delimiter ; +--connection node_1 +CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1; +INSERT INTO t1 VALUES (6); +DROP TRIGGER i5_t1; + +--echo SAVEPOINT in a SP called from a PS called from a trigger be forbidden +# echo handled by SAVEPOINT forbidden in PS +PREPARE call_p1 FROM "CALL p1"; +--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG +CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW EXECUTE call_p1; + +--echo SAVEPOINT in a function called from a trigger should be forbidden +--delimiter | +CREATE FUNCTION f1 () RETURNS INT BEGIN + SAVEPOINT s; + RETURN 1; +END| +--delimiter ; +CREATE TRIGGER i7_t1 BEFORE INSERT ON t1 FOR EACH ROW SET @foo = f1(); +INSERT INTO t1 VALUES (7); +DROP TRIGGER i7_t1; + +--echo SAVEPOINT in a SP called from a SP called from a trigger should be forbidden +--delimiter | +CREATE PROCEDURE p2() BEGIN + CALL p1(); +END| +--delimiter ; +CREATE TRIGGER i8_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p2; +INSERT INTO t1 VALUES (8); +DROP TRIGGER i8_t1; + +--echo SAVEPOINT in a SP called from a trigger called from a SP should be forbidden +CREATE TRIGGER i9_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1; +--delimiter | +CREATE PROCEDURE p3() BEGIN + INSERT INTO t1 VALUES (9); +END| +--delimiter ; +CALL p3(); +DROP TRIGGER i9_t1; + +--echo ROLLBACK TO SAVEPOINT in trigger as a trivial statement should be forbidden +# Trigger activation creates a new savepoint level, making the earlier levels +# inaccessible. Thus forbidding SAVEPOINT should be enough as then there is +# no valid savepoint to pass to ROLLBACK TO SAVEPOINT, but we forbid it once +# more just in case. +CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW ROLLBACK TO SAVEPOINT s; +BEGIN; +SAVEPOINT s; +--error ER_SP_DOES_NOT_EXIST +INSERT INTO t1 VALUES (5); +COMMIT; +DROP TRIGGER i4_t1; + +--echo ROLLBACK TO SAVEPOINT in a trigger in a SP call should be forbidden +--delimiter | +CREATE PROCEDURE p4() BEGIN + ROLLBACK TO SAVEPOINT s; +END| +--delimiter ; +CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p4; +BEGIN; +SAVEPOINT s; +--error ER_SP_DOES_NOT_EXIST +INSERT INTO t1 VALUES (6); +COMMIT; +DROP TRIGGER i5_t1; + +--echo SAVEPOINT in a SP next to a trigger should work +CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a = NEW.a + 1; +--delimiter | +CREATE PROCEDURE p5() BEGIN + SAVEPOINT s; + INSERT INTO t1 VALUES (10); + ROLLBACK TO SAVEPOINT s; +END| +--delimiter ; +BEGIN; +CALL p5(); +COMMIT; +DROP TRIGGER i6_t1; + +--connection node_2 +delimiter |; +create trigger t1 before insert on t1 for each row +begin + insert into t2 values (NULL); +end| +delimiter ;| + +--connection node_1 +INSERT INTO t1 VALUES (201), (202), (203); + +--connection node_1 +SELECT * FROM t1; +SELECT COUNT(*) FROM t2; + +--connection node_2 +SELECT * FROM t1; +SELECT COUNT(*) FROM t2; + +--connection node_1 +DEALLOCATE PREPARE call_p1; + +--connection node_2 +DROP TABLE t1, t2; +DROP PROCEDURE p1; +DROP PROCEDURE p2; +DROP PROCEDURE p3; +DROP PROCEDURE p4; +DROP PROCEDURE p5; +DROP FUNCTION f1; diff --git a/mysql-test/suite/galera/t/galera_admin.test b/mysql-test/suite/galera/t/galera_admin.test new file mode 100644 index 00000000000..d62c454bdfa --- /dev/null +++ b/mysql-test/suite/galera/t/galera_admin.test @@ -0,0 +1,86 @@ +# +# Test that various admin commands from sql_admin.cc +# Currently, REPAIR, OPTIMIZE and ANALYZE are tested. +# Jira: PXC-390 +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +DROP TABLE IF EXISTS x1, x2; +--enable_warnings + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER); +CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER); +SET GLOBAL wsrep_replicate_myisam = TRUE; +CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM; +CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4; +INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); + +# Wait until all the data from t2 has been replicated +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 10 FROM x1; +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 10 FROM x2; +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 10 FROM t1; +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 10000 FROM t2; +--source include/wait_condition.inc + + +--echo # ANALYZE test +--connection node_2 +--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` + +--connection node_1 +ANALYZE TABLE t1, t2; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--source include/wait_condition.inc + + + +--echo # OPTIMIZE test +--connection node_2 +--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` + +--connection node_1 +OPTIMIZE TABLE t1, t2; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--source include/wait_condition.inc + + + +--echo # REPAIR test +--connection node_2 +--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` + +--connection node_1 +REPAIR TABLE x1, x2; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--source include/wait_condition.inc + + + +--connection node_2 +SELECT COUNT(*) = 10 FROM t1; +SELECT COUNT(*) = 10 FROM x1; +SELECT COUNT(*) = 10000 FROM t2; +SELECT COUNT(*) = 10 FROM x2; + +--connection node_1 +DROP TABLE t1, t2; +DROP TABLE x1, x2; +SET GLOBAL wsrep_replicate_myisam = FALSE; diff --git a/mysql-test/suite/galera/t/galera_desync_overlapped.test b/mysql-test/suite/galera/t/galera_desync_overlapped.test new file mode 100644 index 00000000000..8b78e8cdeb7 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_desync_overlapped.test @@ -0,0 +1,59 @@ +# +# Test for overlapped transactions under manual desync. +# +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_debug_sync.inc + +--let $galera_connection_name = node_1a +--let $galera_server_number = 1 +--source include/galera_connect.inc + +--connection node_1 + +CREATE TABLE ten (f1 INTEGER); +INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +CREATE TABLE t1 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB; +CREATE TABLE t2 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB; + +SET GLOBAL wsrep_desync = 1; +show status like 'wsrep_desync_count'; +SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter1 WAIT_FOR alter2'; +send INSERT INTO t1 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3; + +--connection node_1a + +SET GLOBAL wsrep_desync = 1; +show status like 'wsrep_desync_count'; +SET DEBUG_SYNC='now WAIT_FOR alter1'; +SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter2'; +send INSERT INTO t2 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3; + +--connection node_1 +reap; + +--connection node_1a +reap; + +--connection node_1 + +SET DEBUG_SYNC='RESET'; + +SET GLOBAL wsrep_desync = 0; +show status like 'wsrep_desync_count'; +SET GLOBAL wsrep_desync = 0; +show status like 'wsrep_desync_count'; + +--disable_query_log +call mtr.add_suppression("Trying to make wsrep_desync = OFF on the node that is already synchronized."); +--enable_query_log +show status like 'wsrep_desync_count'; +SET GLOBAL wsrep_desync = 0; + +SELECT COUNT(*) FROM t1; +SELECT COUNT(*) FROM t2; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE ten; diff --git a/mysql-test/suite/galera/t/galera_flush_local.opt b/mysql-test/suite/galera/t/galera_flush_local.opt index 45a0ca24dc7..5a1fb6748d9 100644 --- a/mysql-test/suite/galera/t/galera_flush_local.opt +++ b/mysql-test/suite/galera/t/galera_flush_local.opt @@ -1 +1 @@ ---query_cache_type=1 --query_cache_size=1000000 --userstat=1 --wsrep_replicate_myisam=true +--query_cache_type=1 --query_cache_size=1000000 diff --git a/mysql-test/suite/galera/t/galera_restart_on_unknown_option.test b/mysql-test/suite/galera/t/galera_restart_on_unknown_option.test new file mode 100644 index 00000000000..2f27678b547 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_restart_on_unknown_option.test @@ -0,0 +1,150 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +# Suppress expected warnings: + +CALL mtr.add_suppression("Aborting"); +CALL mtr.add_suppression("unknown option '--galera-unknown-option'"); + +# +# We should count the number of "Assertion failed" warnings +# in the log file before and after testing. To do this we need +# to save original log file before testing: +# +--let TEST_LOG=$MYSQLTEST_VARDIR/log/mysqld.2.err +--perl + use strict; + my $test_log=$ENV{'TEST_LOG'} or die "TEST_LOG not set"; + my $test_log_copy=$test_log . '.copy'; + if (-e $test_log_copy) { + unlink $test_log_copy; + } +EOF +--copy_file $TEST_LOG $TEST_LOG.copy + +--connection node_2 + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); +INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'); + +SELECT * FROM t1; + +# Initiate normal shutdown on the node 2 and +# waiting until shutdown has been completed: + +--echo Shutting down server ... +--source include/shutdown_mysqld.inc + +--connection node_1 + +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc + +# Some updates on node 1: + +UPDATE t1 SET f2 = 'b' WHERE f1 > 1; +UPDATE t1 SET f2 = 'c' WHERE f1 > 2; + +SELECT * FROM t1; + +# Remove the "grastate.dat" file (to initiate new SST) +# and restart node 2 with unknown option: + +--connection node_2 + +--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat + +--let $start_mysqld_params=--galera-unknown-option + +--echo Starting server ... +--exec echo "try:$start_mysqld_params" > $_expect_file_name + +# Sleep to ensure that server exited... + +--sleep 30 + +# Restart node 2 without unknown option: + +--let $start_mysqld_params= + +--echo Starting server ... +--source include/start_mysqld.inc + +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc + +# Sanity check (node 2 is running now and can perform SQL operators): + +SELECT * FROM t1; + +# Initiate normal shutdown on the node 2 and +# waiting until shutdown has been completed: + +--echo Shutting down server ... +--source include/shutdown_mysqld.inc + +--connection node_1 + +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc + +# Some updates on node 1 - to initiate IST next time: + +UPDATE t1 SET f2 = 'd' WHERE f1 > 1; +UPDATE t1 SET f2 = 'd' WHERE f1 > 2; + +SELECT * FROM t1; + +# Restart node 2 with unknown option: + +--connection node_2 + +--let $start_mysqld_params=--galera-unknown-option + +--echo Starting server ... +--exec echo "try:$start_mysqld_params" > $_expect_file_name + +# Sleep to ensure that server exited... + +--sleep 30 + +# Restart node 2 without unknown option: + +--let $start_mysqld_params= + +--echo Starting server ... +--source include/start_mysqld.inc + +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc + +# Sanity check (node 2 is running now and can perform SQL operators): + +SELECT * FROM t1; + +--connection node_1 + +DROP TABLE t1; + +# +# We should count the number of "Assertion failed" warnings +# in the log file during test phase - to print the error message +# if quantity of such warnings in log file increased at the end +# of the test: +# +--perl + use strict; + my $test_log=$ENV{'TEST_LOG'} or die "TEST_LOG not set"; + my $test_log_copy=$test_log . '.copy'; + open(FILE, $test_log_copy) or die("Unable to open $test_log_copy: $!\n"); + my $initial=grep(/Assertion * failed/gi,); + close(FILE); + open(FILE, $test_log) or die("Unable to open $test_log: $!\n"); + my $count_warnings=grep(/Assertion * failed/gi,); + close(FILE); + if ($count_warnings != $initial) { + my $diff=$count_warnings-$initial; + print "Assertion failed $diff times.\n"; + } +EOF +--remove_file $TEST_LOG.copy diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_fk_update.test b/mysql-test/suite/galera/t/galera_toi_ddl_fk_update.test new file mode 100644 index 00000000000..f42fae4ed51 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_toi_ddl_fk_update.test @@ -0,0 +1,49 @@ +--source include/big_test.inc +--source include/galera_cluster.inc +--source include/have_innodb.inc + +# +# This test creates a new FK constraint while an UPDATE is running +# + +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); + +CREATE TABLE parent ( + id INT PRIMARY KEY, + KEY (id) +) ENGINE=InnoDB; + +CREATE TABLE child ( + id INT PRIMARY KEY AUTO_INCREMENT, + parent_id INT +) ENGINE=InnoDB; + +INSERT INTO parent VALUES (1); + +INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; + +--connection node_1 +--sleep 1 +--send ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id) ON UPDATE CASCADE; + +--connection node_2 +--sleep 1 +--send UPDATE parent SET id = 2 WHERE id = 1; + +--connection node_1 +--reap + +--connection node_2 +--reap + +--connection node_2 +SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2; + +--connection node_1 +SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2; + +DROP TABLE child; +DROP TABLE parent; + +DROP TABLE ten; diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_online.test b/mysql-test/suite/galera/t/galera_toi_ddl_online.test new file mode 100644 index 00000000000..af45acc5953 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_toi_ddl_online.test @@ -0,0 +1,53 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +# +# In this test, we run concurrent INSERT against a table against which we have issued concurrent DDL statements that are fully online, +# that is, DDL statements that allow for the DML to proceed non-blocking while the DDL is in progress +# + +CREATE TABLE ten (f1 INTEGER); +INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; + +--connection node_1 +--send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; + +--let $galera_connection_name = node_1a +--let $galera_server_number = 1 +--source include/galera_connect.inc + +--connection node_1a +--send CREATE INDEX i1 ON t1 (f2); + + +--let $galera_connection_name = node_1b +--let $galera_server_number = 1 +--source include/galera_connect.inc + +--connection node_1b +--send ALTER TABLE t1 ADD COLUMN f3 INTEGER; + +--connection node_1 +--reap + +--connection node_1a +--reap + +--connection node_1b +--reap + +--connection node_2 +SELECT COUNT(*) = 200000 FROM t1; +SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; +SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1'; + +--connection node_1 +SELECT COUNT(*) = 200000 FROM t1; +SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; +SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1'; + +DROP TABLE t1; +DROP TABLE ten; diff --git a/mysql-test/suite/galera/t/galera_toi_drop_database.test b/mysql-test/suite/galera/t/galera_toi_drop_database.test new file mode 100644 index 00000000000..3176b11dfc0 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_toi_drop_database.test @@ -0,0 +1,54 @@ +# +# Test the operation of DDLs that affect multiple database objects +# + +--source include/big_test.inc +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--let $galera_connection_name = node_1a +--let $galera_server_number = 1 +--source include/galera_connect.inc + +--connection node_1 +CREATE DATABASE database1; +USE database1; + +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); + +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; + +# Insert 1M rows +--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; + +--connection node_1a +USE database1; +--send INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; + +--connection node_2 +--sleep 1 +--send DROP DATABASE database1; + +--connection node_1 +--sleep 30 +--error ER_NO_SUCH_TABLE +--reap + +--connection node_1a +--error ER_NO_SUCH_TABLE +--reap + +--connection node_2 +--reap + +--connection node_1 +SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1'; +--error ER_BAD_DB_ERROR +USE database1; + +--connection node_2 +SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1'; +--error ER_BAD_DB_ERROR +USE database1; diff --git a/mysql-test/suite/galera/t/galera_toi_truncate.test b/mysql-test/suite/galera/t/galera_toi_truncate.test new file mode 100644 index 00000000000..2d6027b17c2 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_toi_truncate.test @@ -0,0 +1,77 @@ +# +# Test the operation of TRUNCATE with concurrent DML. Even in the face of a concurrent INSERT, +# the TRUNCATE will complete first and be recorded in the history before the INSERT. +# + +--source include/big_test.inc +--source include/galera_cluster.inc +--source include/have_innodb.inc + +# +# INSERT and TRUNCATE on different nodes +# + +--connection node_1 +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); + +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; + +# Insert 100K rows +--connection node_2 +--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6; + +--connection node_1 +--sleep 1 +--send TRUNCATE TABLE t1; + +--connection node_1 +--reap + +--connection node_2 +--reap + +--connection node_2 +SELECT COUNT(*) = 1000000 FROM t1; + +--connection node_1 +--let $wait_condition = SELECT COUNT(*) = 1000000 FROM t1; +--source include/wait_condition.inc + +DROP TABLE t1; + +# +# INSERT AND TRUNCATE on same node +# + +--let $galera_connection_name = node_1a +--let $galera_server_number = 1 +--source include/galera_connect.inc + +--connection node_1 + +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; + +# Insert 100K rows +--connection node_1 +--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6; + +--connection node_1a +--sleep 1 +--send TRUNCATE TABLE t1; + +--connection node_1 +--reap + +--connection node_1a +--reap + +--connection node_1 +SELECT COUNT(*) = 1000000 FROM t1; + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1000000 FROM t1; +--source include/wait_condition.inc + +DROP TABLE t1; +DROP TABLE ten; diff --git a/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test b/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test new file mode 100644 index 00000000000..fe1abcf6c35 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test @@ -0,0 +1,20 @@ +# +# PXC-318: Typo in wsrep_provider_options causes an unhandled exception +# +--source include/galera_cluster.inc +--source include/have_innodb.inc +--let LOGF=$MYSQLTEST_VARDIR/log/mysqld.1.err +--disable_info +call mtr.add_suppression("WSREP\: Unknown parameter 'gmcasts\.segment'"); +call mtr.add_suppression("WSREP\: Set options returned 7"); +--error ER_WRONG_ARGUMENTS +SET GLOBAL wsrep_provider_options="gmcasts.segment=1"; +# Search for unhandled exception message. +perl; + use strict; + my $logf= $ENV{'LOGF'} or die "LOGF not set"; + open(FILE, "$logf") or die("Unable to open $logf: $!\n"); + my $count_warnings=grep(/terminate called after throwing an instance of /gi,); + print "Unhandled exceptions: $count_warnings\n"; + close(FILE); +EOF diff --git a/mysql-test/suite/galera/t/lp1376747-2.test b/mysql-test/suite/galera/t/lp1376747-2.test new file mode 100644 index 00000000000..360681d7674 --- /dev/null +++ b/mysql-test/suite/galera/t/lp1376747-2.test @@ -0,0 +1,22 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); + +--connection node_2 +FLUSH TABLES t1 FOR EXPORT; + +--connection node_1 +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +INSERT INTO t1 VALUES (2,3); + +--connection node_2 +UNLOCK TABLES; + +--echo ### t1 should have column f2 +SHOW CREATE TABLE t1; +SELECT * from t1; + +--connection node_1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/lp1376747-3.test b/mysql-test/suite/galera/t/lp1376747-3.test new file mode 100644 index 00000000000..75fe7d276cd --- /dev/null +++ b/mysql-test/suite/galera/t/lp1376747-3.test @@ -0,0 +1,28 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); + +--connection node_2 +FLUSH TABLE WITH READ LOCK; +--echo ### This shouldn't block. +FLUSH TABLES t1 FOR EXPORT; + +--connection node_1 +ALTER TABLE t1 ADD COLUMN f2 INTEGER; + +--connection node_2 +UNLOCK TABLES; + +--echo ### t1 should have column f2 +SHOW CREATE TABLE t1; + +--connection node_1 +INSERT INTO t1 VALUES (2,3); + +--connection node_2 +SELECT * from t1; + +--connection node_1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/lp1376747-4.test b/mysql-test/suite/galera/t/lp1376747-4.test new file mode 100644 index 00000000000..be56ee5edc1 --- /dev/null +++ b/mysql-test/suite/galera/t/lp1376747-4.test @@ -0,0 +1,53 @@ +# +# Test Flush tables with read lock along with +# flush tables with read lock for compatibility. +# Also, making sure all DDL and DMLs are propagated +# after provider is unpaused +# +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--let $galera_connection_name = node_2a +--let $galera_server_number = 2 +--source include/galera_connect.inc + +--connection node_1 +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); + +--connection node_2 +SET session wsrep_sync_wait=0; +SET session wsrep_causal_reads=OFF; +FLUSH TABLE WITH READ LOCK; + +--connection node_1 +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +INSERT INTO t1 VALUES (2,3); + +--connection node_2a +SET session wsrep_sync_wait=0; +SET session wsrep_causal_reads=OFF; +SHOW CREATE TABLE t1; +--sleep 1 +--send FLUSH TABLES t1 WITH READ LOCK; + +--connection node_2 +# let the flush table wait in pause state before we unlock +# table otherwise there is window where-in flush table is +# yet to wait in pause and unlock allows alter table to proceed. +# this is because send in asynchronous. +--sleep 3 +# this will release existing lock but will not resume +# the cluster as there is new FTRL that is still pausing it. +UNLOCK TABLES; +SHOW CREATE TABLE t1; + +--connection node_2a +--reap +UNLOCK TABLES; +--sleep 1 +SHOW CREATE TABLE t1; +SELECT * from t1; + +--connection node_1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/lp1376747.test b/mysql-test/suite/galera/t/lp1376747.test new file mode 100644 index 00000000000..769bb665c77 --- /dev/null +++ b/mysql-test/suite/galera/t/lp1376747.test @@ -0,0 +1,24 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); + +--connection node_2 +FLUSH TABLES t1 WITH READ LOCK; + +--connection node_1 +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +INSERT INTO t1 VALUES (2,3); + +--sleep 2 + +--connection node_2 +UNLOCK TABLES; + +--echo ### t1 should have column f2 +SHOW CREATE TABLE t1; +SELECT * from t1; + +--connection node_1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/pxc-421.test b/mysql-test/suite/galera/t/pxc-421.test new file mode 100644 index 00000000000..8a360b12f4c --- /dev/null +++ b/mysql-test/suite/galera/t/pxc-421.test @@ -0,0 +1,60 @@ +# +# PXC-421: Test deadlock involving updates of +# wsrep_provider, wsrep_cluster_address and wsrep_slave_threads. +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--connection node_1 +--let $wsrep_slave_1 = `SELECT @@wsrep_slave_threads` +set GLOBAL wsrep_slave_threads=26; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 (f1) SELECT * from t1 as x1; + +--connection node_2 +--let $wsrep_slave_2 = `SELECT @@wsrep_slave_threads` +set GLOBAL wsrep_slave_threads=16; +--let $wsrep_provider_orig = `SELECT @@wsrep_provider` +--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address` + +SET GLOBAL wsrep_provider='none'; +INSERT INTO t1 VALUES (2); + +--connection node_1 +INSERT INTO t1 VALUES (3); + +--connection node_2 +--disable_query_log +--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig'; +--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; +--enable_query_log + +--source include/wait_until_connected_again.inc +--source include/galera_wait_ready.inc + +INSERT INTO t1 VALUES (4); +set GLOBAL wsrep_slave_threads=5; + +# Node #2 has all the inserts +SELECT COUNT(*) = 5 FROM t1; + +--connection node_1 +set GLOBAL wsrep_slave_threads=12; +# Node #1 is missing the insert made while Node #2 was not replicated +SELECT COUNT(*) = 4 FROM t1; +INSERT INTO t1 VALUES (100), (101), (102); + +--connection node_2 +set GLOBAL wsrep_slave_threads=5; +INSERT INTO t1 (f1) SELECT * from t1 as x1; +show global variables like 'wsrep_slave_threads'; +--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_2 +SELECT COUNT(*) FROM t1; + +--connection node_1 +SELECT COUNT(*) FROM t1; +show global variables like 'wsrep_slave_threads'; +--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_1 +DROP TABLE t1; -- cgit v1.2.1 From 0e105bc1f22743d50c3dc64799b7969a7227748e Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Mon, 3 Oct 2016 03:09:49 -0700 Subject: Galera MTR Tests: Test for GCF-942 - safe_to_bootstrap flag in grastate.dat --- mysql-test/suite/galera_3nodes/disabled.def | 1 + .../r/galera_safe_to_bootstrap.result | 26 ++++ .../galera_3nodes/t/galera_safe_to_bootstrap.test | 164 +++++++++++++++++++++ 3 files changed, 191 insertions(+) create mode 100644 mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result create mode 100644 mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def index ca55c41ff72..502e7bfba68 100644 --- a/mysql-test/suite/galera_3nodes/disabled.def +++ b/mysql-test/suite/galera_3nodes/disabled.def @@ -5,3 +5,4 @@ galera_slave_options_do :MDEV-8798 galera_slave_options_ignore : MDEV-8798 galera_pc_bootstrap : TODO: Investigate: Timeout in wait_condition.inc galera_pc_weight : Test times out +galera_safe_to_bootstrap : I Really dont know :( diff --git a/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result b/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result new file mode 100644 index 00000000000..21f747d280b --- /dev/null +++ b/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result @@ -0,0 +1,26 @@ +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0'] +include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0'] +include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0'] +include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0'] +include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0'] +include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0'] +include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0'] +include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0'] +include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 1'] +include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0'] +include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0'] +include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0'] +SET SESSION wsrep_on = OFF; +Killing server ... +safe_to_bootstrap: 1 +safe_to_bootstrap: 0 +safe_to_bootstrap: 0 +CALL mtr.add_suppression("Failed to prepare for incremental state transfer"); +CALL mtr.add_suppression("Failed to prepare for incremental state transfer"); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test b/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test new file mode 100644 index 00000000000..c82f01a3d5c --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test @@ -0,0 +1,164 @@ +# +# Test the safe_to_bootstrap in grastate.dat +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; + +# +# At start, all grastate.dat files have safe_to_boostrap: 0 +# + +--let $assert_text= grastate.dat does not have 'safe_to_bootstrap: 0' +--let $assert_select= safe_to_bootstrap: 0 +--let $assert_count= 1 + +--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat +--source include/assert_grep.inc + +--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat +--source include/assert_grep.inc + +--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat +--source include/assert_grep.inc + +# +# Shut down one node +# + +--connection node_2 +--source include/shutdown_mysqld.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +# Still, all grastate.dat files should have safe_to_boostrap: 0 + +--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat +--source include/assert_grep.inc + +--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat +--source include/assert_grep.inc + +--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat +--source include/assert_grep.inc + +# +# Shut down one more node +# + +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 +--connection node_3 +--source include/shutdown_mysqld.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +# Now, nodes 2,3 should have safe_to_boostrap: 0 + +--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat +--source include/assert_grep.inc + +--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat +--source include/assert_grep.inc + +# But node #1 should have safe_to_boostrap: 1 + +--let $assert_text= grastate.dat does not have 'safe_to_bootstrap: 1' +--let $assert_select= safe_to_bootstrap: 1 + +--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat +--source include/assert_grep.inc + +# Restart one node + +--connection node_2 +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--source include/start_mysqld.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +# All nodes should be back to 'safe_to_bootstrap: 0' + +--let $assert_text= grastate.dat does not have 'safe_to_bootstrap: 0' +--let $assert_select= safe_to_bootstrap: 0 + +--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat +--source include/assert_grep.inc + +--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat +--source include/assert_grep.inc + +--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat +--source include/assert_grep.inc + +# +# Kill the cluster +# + +--connection node_2 +--source include/shutdown_mysqld.inc + +--connection node_1 +SET SESSION wsrep_on = OFF; +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--source include/kill_galera.inc + +# +# Only node #1 should have safe_to_bootstrap: 1 +# include/assert_grep.inc requires a running server, so we revert to simple grep +# + +--error 0 +--exec grep 'safe_to_bootstrap: 1' $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat + +--error 0 +--exec grep 'safe_to_bootstrap: 0' $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat + +--error 0 +--exec grep 'safe_to_bootstrap: 0' $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat + +# +# Attempt to bootstrap nodes #2, #3, should fail +# + +--error 1 +--exec $MYSQLD --defaults-group-suffix=.2 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-new-cluster | grep 'This node is not safe to bootstrap the cluster' +--error 1 +--exec $MYSQLD --defaults-group-suffix=.3 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-new-cluster | grep 'This node is not safe to bootstrap the cluster' + +# +# Attempt to bootstrap starting from node #1, should succeed +# + +--connection node_1 +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--source include/start_mysqld.inc +--source include/wait_until_connected_again.inc + +--connection node_2 +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--source include/start_mysqld.inc + +--connection node_3 +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.3.expect +--source include/start_mysqld.inc + +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_2 +CALL mtr.add_suppression("Failed to prepare for incremental state transfer"); + +--connection node_3 +CALL mtr.add_suppression("Failed to prepare for incremental state transfer"); +SHOW CREATE TABLE t1; + +DROP TABLE t1; -- cgit v1.2.1 From c2eaae268dad0ec280efb1ede83b18832629ea98 Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Tue, 11 Oct 2016 03:37:42 -0700 Subject: Galera MTR Tests: GCF-981 - galera_bf_abort is non deterministic --- mysql-test/suite/galera/r/galera_bf_abort.result | 8 ++++---- mysql-test/suite/galera/t/galera_bf_abort.test | 13 +++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/galera_bf_abort.result b/mysql-test/suite/galera/r/galera_bf_abort.result index c55f1a4dfcb..cc750f05050 100644 --- a/mysql-test/suite/galera/r/galera_bf_abort.result +++ b/mysql-test/suite/galera/r/galera_bf_abort.result @@ -1,9 +1,9 @@ -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (1,'node_2'); +INSERT INTO t1 VALUES (1,'node_1'); +INSERT INTO t1 VALUES (2, 'node_2'); ERROR 40001: Deadlock found when trying to get lock; try restarting transaction wsrep_local_aborts_increment 1 diff --git a/mysql-test/suite/galera/t/galera_bf_abort.test b/mysql-test/suite/galera/t/galera_bf_abort.test index 69825ea4919..f3476fba490 100644 --- a/mysql-test/suite/galera/t/galera_bf_abort.test +++ b/mysql-test/suite/galera/t/galera_bf_abort.test @@ -5,20 +5,25 @@ # Test a local transaction being aborted by a slave one # -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB; +--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 --connection node_2 --let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (1,'node_2'); --connection node_1 -INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (1,'node_1'); + +--connection node_2a +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'node_1' +--source include/wait_condition.inc --connection node_2 --error ER_LOCK_DEADLOCK -INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (2, 'node_2'); --let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -- cgit v1.2.1 From 4573924f7d0efd47ee44ae8cc8bb6cef3ccd6ca4 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Sun, 12 Mar 2017 23:00:20 +0530 Subject: Galera MTR Tests: MW-308 , MW-307, GCF-992 * a dedicated test for wsrep_retry_autocommit * some galera_toi_* tests were only passing because wsrep_retry_autocommit was in effect. The tests were changed to do not use autocommit * higher timeout values in galera_2nodes.cnf , galera_3nodes.cnf # Conflicts: # mysql-test/suite/galera/galera_2nodes.cnf # mysql-test/suite/galera/r/galera_defaults.result # mysql-test/suite/galera_3nodes/galera_3nodes.cnf --- mysql-test/suite/galera/galera_2nodes.cnf | 6 +- mysql-test/suite/galera/r/galera_defaults.result | 2 +- .../suite/galera/r/galera_toi_ddl_online.result | 27 ------ .../suite/galera/r/galera_toi_drop_database.result | 6 +- .../suite/galera/r/galera_toi_truncate.result | 14 ++-- .../galera/r/galera_var_retry_autocommit.result | 32 +++++++ .../suite/galera/t/galera_toi_ddl_online.test | 53 ------------ .../suite/galera/t/galera_toi_drop_database.test | 12 +-- mysql-test/suite/galera/t/galera_toi_truncate.test | 48 ++--------- .../galera/t/galera_var_retry_autocommit.test | 97 ++++++++++++++++++++++ mysql-test/suite/galera_3nodes/galera_3nodes.cnf | 17 ++-- 11 files changed, 169 insertions(+), 145 deletions(-) delete mode 100644 mysql-test/suite/galera/r/galera_toi_ddl_online.result create mode 100644 mysql-test/suite/galera/r/galera_var_retry_autocommit.result delete mode 100644 mysql-test/suite/galera/t/galera_toi_ddl_online.test create mode 100644 mysql-test/suite/galera/t/galera_var_retry_autocommit.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf index 956e09e7b82..36630f718c4 100644 --- a/mysql-test/suite/galera/galera_2nodes.cnf +++ b/mysql-test/suite/galera/galera_2nodes.cnf @@ -7,6 +7,9 @@ innodb-autoinc-lock-mode=2 default-storage-engine=innodb wsrep-provider=@ENV.WSREP_PROVIDER wsrep_node_address=127.0.0.1 +wsrep_cluster_address='gcomm://' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S' + # enforce read-committed characteristics across the cluster wsrep-causal-reads=ON wsrep-sync-wait=7 @@ -25,7 +28,8 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S' + wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' diff --git a/mysql-test/suite/galera/r/galera_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result index 3d75b86172a..a9bec4fc1dc 100644 --- a/mysql-test/suite/galera/r/galera_defaults.result +++ b/mysql-test/suite/galera/r/galera_defaults.result @@ -47,7 +47,7 @@ WSREP_SST_DONOR WSREP_SST_DONOR_REJECTS_QUERIES OFF WSREP_SST_METHOD rsync WSREP_SYNC_WAIT 7 -; ; ; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; ; gcache.keep_pages_size = 0; gcache.mem_size = 0; ; gcache.page_size = 128M; gcache.size = 10M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; ; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; ; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; ; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2; socket.recv_buf_size = 212992; +; ; ; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; ; gcache.keep_pages_size = 0; gcache.mem_size = 0; ; gcache.page_size = 128M; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; ;gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; ; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; ; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2; socket.recv_buf_size = 212992; SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_%' AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'; diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_online.result b/mysql-test/suite/galera/r/galera_toi_ddl_online.result deleted file mode 100644 index 488b72ab843..00000000000 --- a/mysql-test/suite/galera/r/galera_toi_ddl_online.result +++ /dev/null @@ -1,27 +0,0 @@ -CREATE TABLE ten (f1 INTEGER); -INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB; -INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; -CREATE INDEX i1 ON t1 (f2);; -ALTER TABLE t1 ADD COLUMN f3 INTEGER;; -SELECT COUNT(*) = 200000 FROM t1; -COUNT(*) = 200000 -1 -SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -COUNT(*) = 3 -1 -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1'; -COUNT(*) = 2 -1 -SELECT COUNT(*) = 200000 FROM t1; -COUNT(*) = 200000 -1 -SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -COUNT(*) = 3 -1 -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1'; -COUNT(*) = 2 -1 -DROP TABLE t1; -DROP TABLE ten; diff --git a/mysql-test/suite/galera/r/galera_toi_drop_database.result b/mysql-test/suite/galera/r/galera_toi_drop_database.result index d4f98c38847..8f4098419eb 100644 --- a/mysql-test/suite/galera/r/galera_toi_drop_database.result +++ b/mysql-test/suite/galera/r/galera_toi_drop_database.result @@ -4,12 +4,14 @@ CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_retry_autocommit = 0; INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; USE database1; +SET SESSION wsrep_retry_autocommit = 0; INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; DROP DATABASE database1;; -ERROR 42S02: Table 'database1.t1' doesn't exist -ERROR 42S02: Table 'database1.t2' doesn't exist +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1'; COUNT(*) = 0 1 diff --git a/mysql-test/suite/galera/r/galera_toi_truncate.result b/mysql-test/suite/galera/r/galera_toi_truncate.result index 98bc9f4850b..f52316f3cbc 100644 --- a/mysql-test/suite/galera/r/galera_toi_truncate.result +++ b/mysql-test/suite/galera/r/galera_toi_truncate.result @@ -1,17 +1,15 @@ CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_retry_autocommit = 0; INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;; TRUNCATE TABLE t1;; -SELECT COUNT(*) = 1000000 FROM t1; -COUNT(*) = 1000000 +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 1 -DROP TABLE t1; -CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;; -TRUNCATE TABLE t1;; -SELECT COUNT(*) = 1000000 FROM t1; -COUNT(*) = 1000000 +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 1 DROP TABLE t1; DROP TABLE ten; diff --git a/mysql-test/suite/galera/r/galera_var_retry_autocommit.result b/mysql-test/suite/galera/r/galera_var_retry_autocommit.result new file mode 100644 index 00000000000..f4d17ad9a41 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_var_retry_autocommit.result @@ -0,0 +1,32 @@ +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB; +CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f2 = SLEEP(5); +SET SESSION wsrep_retry_autocommit = 0; +INSERT INTO t1 (f1) VALUES (1),(2);; +TRUNCATE TABLE t1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +SET SESSION wsrep_retry_autocommit = 1; +INSERT INTO t1 (f1) VALUES (3),(4);; +TRUNCATE TABLE t1; +SELECT * FROM test.t1; +f1 f2 +3 0 +4 0 +CREATE PROCEDURE repeated_truncate () +BEGIN +DECLARE i INT; +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET i = 0; +WHILE i <= 1000 DO +TRUNCATE TABLE t1; +SET i = i + 1; +END WHILE; +END| +CALL repeated_truncate(); +SET SESSION wsrep_retry_autocommit = 1; +INSERT INTO t1 (f1) VALUES (5),(6); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +SET SESSION wsrep_retry_autocommit = 1024; +INSERT INTO t1 (f1) VALUES (7),(8);; +include/diff_servers.inc [servers=1 2] +DROP TABLE t1; +DROP PROCEDURE repeated_truncate; diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_online.test b/mysql-test/suite/galera/t/galera_toi_ddl_online.test deleted file mode 100644 index af45acc5953..00000000000 --- a/mysql-test/suite/galera/t/galera_toi_ddl_online.test +++ /dev/null @@ -1,53 +0,0 @@ ---source include/galera_cluster.inc ---source include/have_innodb.inc - -# -# In this test, we run concurrent INSERT against a table against which we have issued concurrent DDL statements that are fully online, -# that is, DDL statements that allow for the DML to proceed non-blocking while the DDL is in progress -# - -CREATE TABLE ten (f1 INTEGER); -INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); - -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB; -INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; - ---connection node_1 ---send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; - ---let $galera_connection_name = node_1a ---let $galera_server_number = 1 ---source include/galera_connect.inc - ---connection node_1a ---send CREATE INDEX i1 ON t1 (f2); - - ---let $galera_connection_name = node_1b ---let $galera_server_number = 1 ---source include/galera_connect.inc - ---connection node_1b ---send ALTER TABLE t1 ADD COLUMN f3 INTEGER; - ---connection node_1 ---reap - ---connection node_1a ---reap - ---connection node_1b ---reap - ---connection node_2 -SELECT COUNT(*) = 200000 FROM t1; -SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1'; - ---connection node_1 -SELECT COUNT(*) = 200000 FROM t1; -SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1'; - -DROP TABLE t1; -DROP TABLE ten; diff --git a/mysql-test/suite/galera/t/galera_toi_drop_database.test b/mysql-test/suite/galera/t/galera_toi_drop_database.test index 3176b11dfc0..0a37a4010ce 100644 --- a/mysql-test/suite/galera/t/galera_toi_drop_database.test +++ b/mysql-test/suite/galera/t/galera_toi_drop_database.test @@ -2,7 +2,6 @@ # Test the operation of DDLs that affect multiple database objects # ---source include/big_test.inc --source include/galera_cluster.inc --source include/have_innodb.inc @@ -20,11 +19,14 @@ INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; -# Insert 1M rows +# Make sure autocommit retrying does not kick in as this will mask the error we expect to get +SET SESSION wsrep_retry_autocommit = 0; +# Attemp to insert 1M rows --send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; --connection node_1a USE database1; +SET SESSION wsrep_retry_autocommit = 0; --send INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; --connection node_2 @@ -32,12 +34,12 @@ USE database1; --send DROP DATABASE database1; --connection node_1 ---sleep 30 ---error ER_NO_SUCH_TABLE +--sleep 1 +--error ER_LOCK_DEADLOCK --reap --connection node_1a ---error ER_NO_SUCH_TABLE +--error ER_LOCK_DEADLOCK --reap --connection node_2 diff --git a/mysql-test/suite/galera/t/galera_toi_truncate.test b/mysql-test/suite/galera/t/galera_toi_truncate.test index 2d6027b17c2..59ef5c2028f 100644 --- a/mysql-test/suite/galera/t/galera_toi_truncate.test +++ b/mysql-test/suite/galera/t/galera_toi_truncate.test @@ -1,9 +1,8 @@ # -# Test the operation of TRUNCATE with concurrent DML. Even in the face of a concurrent INSERT, -# the TRUNCATE will complete first and be recorded in the history before the INSERT. +# Test the operation of TRUNCATE with concurrent DML. +# The DML should be BF-aborted if the DDL arrives from another node # ---source include/big_test.inc --source include/galera_cluster.inc --source include/have_innodb.inc @@ -19,6 +18,8 @@ CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; # Insert 100K rows --connection node_2 +# Prevent autocommit retring from masking the deadlock error we expect to get +SET SESSION wsrep_retry_autocommit = 0; --send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6; --connection node_1 @@ -29,49 +30,14 @@ CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; --reap --connection node_2 +--error ER_LOCK_DEADLOCK --reap --connection node_2 -SELECT COUNT(*) = 1000000 FROM t1; +SELECT COUNT(*) = 0 FROM t1; --connection node_1 ---let $wait_condition = SELECT COUNT(*) = 1000000 FROM t1; ---source include/wait_condition.inc - -DROP TABLE t1; - -# -# INSERT AND TRUNCATE on same node -# - ---let $galera_connection_name = node_1a ---let $galera_server_number = 1 ---source include/galera_connect.inc - ---connection node_1 - -CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; - -# Insert 100K rows ---connection node_1 ---send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6; - ---connection node_1a ---sleep 1 ---send TRUNCATE TABLE t1; - ---connection node_1 ---reap - ---connection node_1a ---reap - ---connection node_1 -SELECT COUNT(*) = 1000000 FROM t1; - ---connection node_2 ---let $wait_condition = SELECT COUNT(*) = 1000000 FROM t1; ---source include/wait_condition.inc +SELECT COUNT(*) = 0 FROM t1; DROP TABLE t1; DROP TABLE ten; diff --git a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test new file mode 100644 index 00000000000..6ef647b24e1 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test @@ -0,0 +1,97 @@ +# +# Test that the wsrep_retry_autocommit variable is respected. We use an INSERT that +# proceeds very slowly due to extra SLEEP() in a trigger +# + +--source include/galera_cluster.inc + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB; +CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f2 = SLEEP(5); + +# +# With wsrep_retry_autocommit = 0, error is certain +# + +--connection node_1 +SET SESSION wsrep_retry_autocommit = 0; +--send INSERT INTO t1 (f1) VALUES (1),(2); + +--connection node_2 +--sleep 1 +TRUNCATE TABLE t1; + +--connection node_1 +--error ER_LOCK_DEADLOCK +--reap + +# +# With wsrep_retry_autocommit = 1, success against one TRUNCATE +# + +--connection node_1 +SET SESSION wsrep_retry_autocommit = 1; +--send INSERT INTO t1 (f1) VALUES (3),(4); + +--connection node_2 +--sleep 1 +TRUNCATE TABLE t1; + +--connection node_1 +--error 0 +--reap +SELECT * FROM test.t1; + +# +# With wsrep_retry_autocommit = 1, failure against multiple TRUNCATEs +# + +--connection node_2 +DELIMITER |; +CREATE PROCEDURE repeated_truncate () +BEGIN + DECLARE i INT; + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + + SET i = 0; + WHILE i <= 1000 DO + TRUNCATE TABLE t1; + SET i = i + 1; + END WHILE; +END| +DELIMITER ;| + +# Begin streaming TRUNCATEs +--let $truncate_connection_id = `SELECT CONNECTION_ID()` +--send CALL repeated_truncate() + +--connection node_1 +SET SESSION wsrep_retry_autocommit = 1; +--sleep 1 +--error ER_LOCK_DEADLOCK +INSERT INTO t1 (f1) VALUES (5),(6); + +# +# With wsrep_retry_autocommit = 1024, success against multiple TRUNCATEs +# + +--connection node_1 +SET SESSION wsrep_retry_autocommit = 1024; +--send INSERT INTO t1 (f1) VALUES (7),(8); + +--sleep 6 + +# Once he stream of TRUNCATEs is complete +--connection node_2 +--reap + +# the INSERT will eventually be sucessfull +--connection node_1 +--error 0 +--reap + +--let $diff_servers = 1 2 +--source include/diff_servers.inc + +DROP TABLE t1; +DROP PROCEDURE repeated_truncate; diff --git a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf index f19277bb36a..3921e3aa362 100644 --- a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf +++ b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf @@ -12,11 +12,10 @@ wsrep-causal-reads=ON wsrep-sync-wait=7 [mysqld.1] -#galera_port=@OPT.port -#ist_port=@OPT.port -#sst_port=@OPT.port -wsrep-cluster-address=gcomm:// -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S' +wsrep-cluster-address='gcomm://' +wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S' + +wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' @@ -25,7 +24,9 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S' +wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S' + +wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' @@ -34,7 +35,9 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S' +wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S' + +wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port' -- cgit v1.2.1 From 108fd77486f9876c4b718abf23b91aea7426e9c0 Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Wed, 2 Nov 2016 02:01:10 -0700 Subject: Galera MTR Tests: GAL-405 Initial implementation of GCache recovery on startup. --- mysql-test/suite/galera/r/galera_defaults.result | 2 +- .../suite/galera/r/galera_gcache_recover.result | 18 ++ .../r/galera_gcache_recover_full_gcache.result | 19 ++ .../galera/r/galera_gcache_recover_manytrx.result | 107 ++++++++++ .../suite/galera/t/galera_gcache_recover.cnf | 7 + .../suite/galera/t/galera_gcache_recover.test | 77 ++++++++ .../galera/t/galera_gcache_recover_full_gcache.cnf | 9 + .../t/galera_gcache_recover_full_gcache.test | 59 ++++++ .../galera/t/galera_gcache_recover_manytrx.cnf | 8 + .../galera/t/galera_gcache_recover_manytrx.test | 216 +++++++++++++++++++++ 10 files changed, 521 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/galera/r/galera_gcache_recover.result create mode 100644 mysql-test/suite/galera/r/galera_gcache_recover_full_gcache.result create mode 100644 mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result create mode 100644 mysql-test/suite/galera/t/galera_gcache_recover.cnf create mode 100644 mysql-test/suite/galera/t/galera_gcache_recover.test create mode 100644 mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.cnf create mode 100644 mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.test create mode 100644 mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf create mode 100644 mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/galera_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result index a9bec4fc1dc..a06e6229f1d 100644 --- a/mysql-test/suite/galera/r/galera_defaults.result +++ b/mysql-test/suite/galera/r/galera_defaults.result @@ -47,7 +47,7 @@ WSREP_SST_DONOR WSREP_SST_DONOR_REJECTS_QUERIES OFF WSREP_SST_METHOD rsync WSREP_SYNC_WAIT 7 -; ; ; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; ; gcache.keep_pages_size = 0; gcache.mem_size = 0; ; gcache.page_size = 128M; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; ;gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; ; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; ; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2; socket.recv_buf_size = 212992; +; ; ; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; ; gcache.keep_pages_size = 0; gcache.mem_size = 0; ; gcache.page_size = 128M; gcache.recover = no; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; ;gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; ; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; ; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2; socket.recv_buf_size = 212992; SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_%' AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'; diff --git a/mysql-test/suite/galera/r/galera_gcache_recover.result b/mysql-test/suite/galera/r/galera_gcache_recover.result new file mode 100644 index 00000000000..127bcba39d8 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_gcache_recover.result @@ -0,0 +1,18 @@ +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_sync_wait = 0; +Killing server ... +INSERT INTO t1 VALUES (2); +Killing server ... +Performing --wsrep-recover ... +Using --wsrep-start-position when starting mysqld ... +INSERT INTO t1 VALUES (3); +Performing --wsrep-recover ... +Using --wsrep-start-position when starting mysqld ... +include/diff_servers.inc [servers=1 2] +CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); +include/assert_grep.inc [async IST sender starting to serve] +CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); +include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence] +DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_gcache_recover_full_gcache.result b/mysql-test/suite/galera/r/galera_gcache_recover_full_gcache.result new file mode 100644 index 00000000000..30ee5772411 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_gcache_recover_full_gcache.result @@ -0,0 +1,19 @@ +SET SESSION wsrep_sync_wait = 0; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB; +SET SESSION wsrep_sync_wait = 0; +Killing server ... +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); +Killing server ... +Performing --wsrep-recover ... +Using --wsrep-start-position when starting mysqld ... +Performing --wsrep-recover ... +Using --wsrep-start-position when starting mysqld ... +include/diff_servers.inc [servers=1 2] +DROP TABLE t1; +CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); +include/assert_grep.inc [IST first seqno 2 not found from cache, falling back to SST] +CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); diff --git a/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result b/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result new file mode 100644 index 00000000000..868b39bfbd6 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result @@ -0,0 +1,107 @@ +SET SESSION wsrep_sync_wait = 0; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB; +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +CREATE PROCEDURE insert_simple () +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET SESSION wsrep_sync_wait = 0; +WHILE 1 DO +INSERT INTO t1 (f1, f2) VALUES (DEFAULT,'abcdef'); +END WHILE; +END| +CREATE PROCEDURE insert_multi () +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET SESSION wsrep_sync_wait = 0; +WHILE 1 DO +INSERT INTO t1 (f1) VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT); +END WHILE; +END| +CREATE PROCEDURE insert_transaction () +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET SESSION wsrep_sync_wait = 0; +SET AUTOCOMMIT = OFF; +WHILE 1 DO +START TRANSACTION; +INSERT INTO t1 (f1) VALUES (DEFAULT); +INSERT INTO t1 (f1) VALUES (DEFAULT); +INSERT INTO t1 (f1) VALUES (DEFAULT); +INSERT INTO t1 (f1) VALUES (DEFAULT); +INSERT INTO t1 (f1) VALUES (DEFAULT); +INSERT INTO t1 (f1) VALUES (DEFAULT); +INSERT INTO t1 (f1) VALUES (DEFAULT); +INSERT INTO t1 (f1) VALUES (DEFAULT); +INSERT INTO t1 (f1) VALUES (DEFAULT); +INSERT INTO t1 (f1) VALUES (DEFAULT); +COMMIT; +END WHILE; +END| +CREATE PROCEDURE update_simple () +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET SESSION wsrep_sync_wait = 0; +WHILE 1 DO +UPDATE t1 SET f2 = CONCAT(f2,f2); +END WHILE; +END| +CREATE PROCEDURE insert_1k () +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET SESSION wsrep_sync_wait = 0; +WHILE 1 DO +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024)); +END WHILE; +END| +CREATE PROCEDURE insert_1m () +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET SESSION wsrep_sync_wait = 0; +WHILE 1 DO +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024)); +END WHILE; +END| +CREATE PROCEDURE insert_10m () +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET SESSION wsrep_sync_wait = 0; +WHILE 1 DO +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); +END WHILE; +END| +CALL insert_simple();; +CALL insert_multi();; +CALL insert_transaction ();; +CALL update_simple ();; +CALL insert_1k ();; +CALL insert_1m ();; +CALL insert_10m ();; +SET SESSION wsrep_sync_wait = 0; +Killing server ... +Killing server ... +ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to MySQL server during query +Performing --wsrep-recover ... +Using --wsrep-start-position when starting mysqld ... +Performing --wsrep-recover ... +Using --wsrep-start-position when starting mysqld ... +include/diff_servers.inc [servers=1 2] +DROP TABLE t1; +DROP TABLE ten; +DROP PROCEDURE insert_simple; +DROP PROCEDURE insert_multi; +DROP PROCEDURE insert_transaction; +DROP PROCEDURE update_simple; +DROP PROCEDURE insert_1k; +DROP PROCEDURE insert_1m; +CALL mtr.add_suppression("conflict state 7 after post commit"); +CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); +include/assert_grep.inc [async IST sender starting to serve] +CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); +include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence] diff --git a/mysql-test/suite/galera/t/galera_gcache_recover.cnf b/mysql-test/suite/galera/t/galera_gcache_recover.cnf new file mode 100644 index 00000000000..c7b59b6a27e --- /dev/null +++ b/mysql-test/suite/galera/t/galera_gcache_recover.cnf @@ -0,0 +1,7 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true' + +[mysqld.2] +wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true' diff --git a/mysql-test/suite/galera/t/galera_gcache_recover.test b/mysql-test/suite/galera/t/galera_gcache_recover.test new file mode 100644 index 00000000000..e1bfe517d27 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_gcache_recover.test @@ -0,0 +1,77 @@ +# +# Kill entire cluster while gcache.recover=yes. Expect that node #2 will rejoin using IST +# + +--source include/galera_cluster.inc +--source include/big_test.inc + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +SET SESSION wsrep_sync_wait = 0; + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) > 0 FROM t1; +--source include/wait_condition.inc + +SET SESSION wsrep_sync_wait = 0; +--source include/kill_galera.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (2); + +--source include/kill_galera.inc + +--sleep 1 + +--connection node_1 +--let $galera_wsrep_recover_server_id=1 +--source suite/galera/include/galera_wsrep_recover.inc + +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--source include/start_mysqld.inc + +INSERT INTO t1 VALUES (3); + +--connection node_2 +--let $galera_wsrep_recover_server_id=2 +--source suite/galera/include/galera_wsrep_recover.inc + +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--source include/start_mysqld.inc + +--connection node_1 +--source include/wait_until_connected_again.inc +--source include/galera_wait_ready.inc +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; + +--let $diff_servers = 1 2 +--source include/diff_servers.inc + +--connection node_1 +# Warning happens when the cluster is started for the first time +CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); + +# Confirm that IST took place +--let $assert_text = async IST sender starting to serve +--let $assert_select = async IST sender starting to serve +--let $assert_count = 1 +--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err +--let $assert_only_after = starting as process +--source include/assert_grep.inc + +--connection node_2 +CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); + +# Confirm that gcache recovery took place + +--let $assert_text = Recovering GCache ring buffer: found gapless sequence +--let $assert_select = Recovering GCache ring buffer: found gapless sequence +--let $assert_count = 1 +--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err +--let $assert_only_after = starting as process +--source include/assert_grep.inc + +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.cnf b/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.cnf new file mode 100644 index 00000000000..da74ea9fc5d --- /dev/null +++ b/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.cnf @@ -0,0 +1,9 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +max_allowed_packet=10M +innodb_log_file_size=110M +wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true;gcache.size=10M' + +[mysqld.2] +wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.test b/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.test new file mode 100644 index 00000000000..b7fd9cf3aed --- /dev/null +++ b/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.test @@ -0,0 +1,59 @@ +# +# Attempt gcache recovery on a full gcache. Node will not be able to join via IST due to gcache rollover +# + +--source include/galera_cluster.inc +--source include/big_test.inc + +SET SESSION wsrep_sync_wait = 0; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB; + +--connection node_2 +SET SESSION wsrep_sync_wait = 0; +--source include/kill_galera.inc + +--connection node_1 +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); +INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); +--source include/kill_galera.inc + +--connection node_1 +--let $galera_wsrep_recover_server_id=1 +--source suite/galera/include/galera_wsrep_recover.inc + +--let $_expect_file_name = $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--source include/start_mysqld.inc +--connection node_2 +--let $galera_wsrep_recover_server_id=2 +--source suite/galera/include/galera_wsrep_recover.inc + +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--source include/start_mysqld.inc + +--connection node_1 +--source include/wait_until_connected_again.inc +--source include/galera_wait_ready.inc +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; + +--let $diff_servers = 1 2 +--source include/diff_servers.inc + +--connection node_1 +DROP TABLE t1; + +# Warning always happens when the cluster is started for the first time +CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); + +# Confirm that IST did not take place +--let $assert_text = IST first seqno 2 not found from cache, falling back to SST +--let $assert_select = IST first seqno 2 not found from cache, falling back to SST +--let $assert_count = 1 +--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err +--let $assert_only_after = starting as process +--source include/assert_grep.inc + +--connection node_2 +CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf new file mode 100644 index 00000000000..39af0e94b94 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf @@ -0,0 +1,8 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +innodb_log_file_size=110M +wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true;' + +[mysqld.2] +wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true;' diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test new file mode 100644 index 00000000000..3bfcdc9f117 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test @@ -0,0 +1,216 @@ +# +# Kill entire cluster while various transactions are in progress +# restore the cluster and expect that node #2 will rejoin using IST +# + +--source include/galera_cluster.inc +--source include/big_test.inc + +SET SESSION wsrep_sync_wait = 0; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB; +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); + +DELIMITER |; +CREATE PROCEDURE insert_simple () +BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + SET SESSION wsrep_sync_wait = 0; + WHILE 1 DO + INSERT INTO t1 (f1, f2) VALUES (DEFAULT,'abcdef'); + END WHILE; +END| + +CREATE PROCEDURE insert_multi () +BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + SET SESSION wsrep_sync_wait = 0; + WHILE 1 DO + INSERT INTO t1 (f1) VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT); + END WHILE; +END| + +CREATE PROCEDURE insert_transaction () +BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + SET SESSION wsrep_sync_wait = 0; + SET AUTOCOMMIT = OFF; + WHILE 1 DO + START TRANSACTION; + INSERT INTO t1 (f1) VALUES (DEFAULT); + INSERT INTO t1 (f1) VALUES (DEFAULT); + INSERT INTO t1 (f1) VALUES (DEFAULT); + INSERT INTO t1 (f1) VALUES (DEFAULT); + INSERT INTO t1 (f1) VALUES (DEFAULT); + + INSERT INTO t1 (f1) VALUES (DEFAULT); + INSERT INTO t1 (f1) VALUES (DEFAULT); + INSERT INTO t1 (f1) VALUES (DEFAULT); + INSERT INTO t1 (f1) VALUES (DEFAULT); + INSERT INTO t1 (f1) VALUES (DEFAULT); + COMMIT; + END WHILE; +END| + +DELIMITER ;| +DELIMITER |; + +CREATE PROCEDURE update_simple () +BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + SET SESSION wsrep_sync_wait = 0; + WHILE 1 DO + UPDATE t1 SET f2 = CONCAT(f2,f2); + END WHILE; +END| + +CREATE PROCEDURE insert_1k () +BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + SET SESSION wsrep_sync_wait = 0; + WHILE 1 DO + INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024)); + END WHILE; +END| + +CREATE PROCEDURE insert_1m () +BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + SET SESSION wsrep_sync_wait = 0; + WHILE 1 DO + INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024)); + END WHILE; +END| + +CREATE PROCEDURE insert_10m () +BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + SET SESSION wsrep_sync_wait = 0; + WHILE 1 DO + INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10)); + END WHILE; +END| + +DELIMITER ;| + +--connect node_1_insert_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connect node_1_insert_multi, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connect node_1_insert_transaction, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connect node_1_update_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connect node_1_insert_1k, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connect node_1_insert_1m, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connect node_1_insert_10m, 127.0.0.1, root, , test, $NODE_MYPORT_1 + +--connection node_1_insert_simple +--send CALL insert_simple(); + +--connection node_1_insert_multi +--send CALL insert_multi(); + +--connection node_1_insert_transaction +--send CALL insert_transaction (); + +--connection node_1_update_simple +--send CALL update_simple (); + +--connection node_1_insert_1k +--send CALL insert_1k (); + +--connection node_1_insert_1m +--send CALL insert_1m (); + +--connection node_1_insert_10m +--send CALL insert_10m (); + +--connection node_2 +SET SESSION wsrep_sync_wait = 0; +--source include/kill_galera.inc + +--sleep 10 +--connection node_1 +--source include/kill_galera.inc + +--connection node_1_insert_simple +--error 2013 +--reap + +--connection node_1_insert_multi +--error 2013 +--reap + +--connection node_1_insert_transaction +--error 2013 +--reap + +--connection node_1_update_simple +--error 2013 +--reap + +--connection node_1_insert_1k +--error 2013 +--reap + +--connection node_1_insert_1m +--error 2013 +--reap + +--connection node_1_insert_10m +--error 2013 +--reap + +--connection node_1 +--let $galera_wsrep_recover_server_id=1 +--source suite/galera/include/galera_wsrep_recover.inc + +--let $_expect_file_name = $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--source include/start_mysqld.inc +--connection node_2 +--let $galera_wsrep_recover_server_id=2 +--source suite/galera/include/galera_wsrep_recover.inc + +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--source include/start_mysqld.inc + +--connection node_1 +--source include/wait_until_connected_again.inc +--source include/galera_wait_ready.inc +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; + +--let $diff_servers = 1 2 +--source include/diff_servers.inc + +--connection node_1 +DROP TABLE t1; +DROP TABLE ten; +DROP PROCEDURE insert_simple; +DROP PROCEDURE insert_multi; +DROP PROCEDURE insert_transaction; +DROP PROCEDURE update_simple; +DROP PROCEDURE insert_1k; +DROP PROCEDURE insert_1m; + +--connection node_1 +CALL mtr.add_suppression("conflict state 7 after post commit"); + +# Warning happens when the cluster is started for the first time +CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); + +# Confirm that IST took place +--let $assert_text = async IST sender starting to serve +--let $assert_select = async IST sender starting to serve +--let $assert_count = 1 +--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err +--let $assert_only_after = starting as process +--source include/assert_grep.inc + +--connection node_2 +CALL mtr.add_suppression("Skipped GCache ring buffer recovery"); + +# Confirm that gcache recovery took place + +--let $assert_text = Recovering GCache ring buffer: found gapless sequence +--let $assert_select = Recovering GCache ring buffer: found gapless sequence +--let $assert_count = 1 +--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err +--let $assert_only_after = starting as process +--source include/assert_grep.inc -- cgit v1.2.1 From 16e683fdad2595b37388f9320d76930cbe425a52 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Tue, 14 Mar 2017 07:11:17 +0530 Subject: Galera MTR Tests: Tests for GAL-419 Respect safe_to_bootstrap flag also with gcomm:// Signed-off-by: Sachin Setiya --- mysql-test/suite/galera/r/GAL-419.result | 4 +++ .../galera/r/galera_var_cluster_address.result | 23 ++++++++++++++ mysql-test/suite/galera/t/GAL-419.test | 35 ++++++++++++++++++++ .../suite/galera/t/galera_var_cluster_address.test | 37 +++++++++++++++++++++- 4 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/galera/r/GAL-419.result create mode 100644 mysql-test/suite/galera/t/GAL-419.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/GAL-419.result b/mysql-test/suite/galera/r/GAL-419.result new file mode 100644 index 00000000000..410c91b4f98 --- /dev/null +++ b/mysql-test/suite/galera/r/GAL-419.result @@ -0,0 +1,4 @@ +SET SESSION wsrep_sync_wait = 0; +Killing server ... +SET SESSION wsrep_sync_wait = 0; +Killing server ... diff --git a/mysql-test/suite/galera/r/galera_var_cluster_address.result b/mysql-test/suite/galera/r/galera_var_cluster_address.result index 17b5a7bca37..bb3ea8e3a53 100644 --- a/mysql-test/suite/galera/r/galera_var_cluster_address.result +++ b/mysql-test/suite/galera/r/galera_var_cluster_address.result @@ -26,6 +26,28 @@ VARIABLE_VALUE = 'Primary' SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 +SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1'; +SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS; +COUNT(*) > 0 +1 +SHOW STATUS LIKE 'wsrep_ready'; +Variable_name Value +wsrep_ready ON +SHOW STATUS LIKE 'wsrep_cluster_status'; +Variable_name Value +wsrep_cluster_status Primary +SHOW STATUS LIKE 'wsrep_local_state'; +Variable_name Value +wsrep_local_state 4 +SHOW STATUS LIKE 'wsrep_local_state_comment'; +Variable_name Value +wsrep_local_state_comment Synced +SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +VARIABLE_VALUE = 'Primary' +1 +SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +VARIABLE_VALUE = 2 +1 CALL mtr.add_suppression("Backend not supported: foo"); CALL mtr.add_suppression("Failed to initialize backend using 'foo"); CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'foo"); @@ -36,4 +58,5 @@ CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed t CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)"); CALL mtr.add_suppression("gcs connect failed: Connection timed out"); CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7"); +CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7"); # End of test diff --git a/mysql-test/suite/galera/t/GAL-419.test b/mysql-test/suite/galera/t/GAL-419.test new file mode 100644 index 00000000000..e50b948bf35 --- /dev/null +++ b/mysql-test/suite/galera/t/GAL-419.test @@ -0,0 +1,35 @@ +# +# GAL-419 safe_to_bootstrap: boostrap using wsrep_cluster_address=gcomm:// not prevented +# + +--source include/galera_cluster.inc +--source include/big_test.inc + +--connection node_2 +SET SESSION wsrep_sync_wait = 0; +--source include/kill_galera.inc + +--connection node_1 +SET SESSION wsrep_sync_wait = 0; +--source include/kill_galera.inc + +--sleep 2 + +# Node #1 has wsrep_cluster_address=gcomm:// in my.cnf, so should fail to bootstrap + +--error 1 +--exec $MYSQLD --defaults-group-suffix=.1 --defaults-file=$MYSQLTEST_VARDIR/my.cnf | grep 'This node is not safe to bootstrap the cluster' + +# Unless we remove grastate.dat + +--remove_file $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat +--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat + +--connection node_1 +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--source include/start_mysqld.inc +--source include/wait_until_connected_again.inc + +--connection node_2 +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--source include/start_mysqld.inc diff --git a/mysql-test/suite/galera/t/galera_var_cluster_address.test b/mysql-test/suite/galera/t/galera_var_cluster_address.test index 740c38765f6..5328b5e7a94 100644 --- a/mysql-test/suite/galera/t/galera_var_cluster_address.test +++ b/mysql-test/suite/galera/t/galera_var_cluster_address.test @@ -58,6 +58,41 @@ SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VA SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +# +# Set to invalid host +# + +--connection node_2 +SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1'; +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--error 0 +SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS; + +# Must return 'OFF' +SHOW STATUS LIKE 'wsrep_ready'; + +# Must return 'Non-primary' +SHOW STATUS LIKE 'wsrep_cluster_status'; + +# Must return 0 = 'Initialized' +SHOW STATUS LIKE 'wsrep_local_state'; +SHOW STATUS LIKE 'wsrep_local_state_comment'; + +# +# Reset everything as it was +# + +--connection node_2 +--disable_query_log +--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node2'; +--enable_query_log + +--connection node_1 +SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; + --connection node_2 CALL mtr.add_suppression("Backend not supported: foo"); CALL mtr.add_suppression("Failed to initialize backend using 'foo"); @@ -69,7 +104,7 @@ CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed t CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)"); CALL mtr.add_suppression("gcs connect failed: Connection timed out"); CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7"); - +CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7"); # Restore original auto_increment_offset values. --source include/auto_increment_offset_restore.inc -- cgit v1.2.1 From 5d9c74719383b280f3d960c4d21bed238bfdbb38 Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Wed, 2 Nov 2016 07:04:34 -0700 Subject: Galera MTR tests: Update galera_defaults.result for GAL-360 --- mysql-test/suite/galera/r/galera_defaults.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/galera_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result index a06e6229f1d..b5b94ad317b 100644 --- a/mysql-test/suite/galera/r/galera_defaults.result +++ b/mysql-test/suite/galera/r/galera_defaults.result @@ -47,7 +47,7 @@ WSREP_SST_DONOR WSREP_SST_DONOR_REJECTS_QUERIES OFF WSREP_SST_METHOD rsync WSREP_SYNC_WAIT 7 -; ; ; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; ; gcache.keep_pages_size = 0; gcache.mem_size = 0; ; gcache.page_size = 128M; gcache.recover = no; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; ;gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; ; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; ; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2; socket.recv_buf_size = 212992; +; ; ; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; ; gcache.keep_pages_size = 0; gcache.mem_size = 0; ; gcache.page_size = 128M; gcache.recover = no; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; ;gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; ; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; ; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2; socket.recv_buf_size = 212992; SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_%' AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'; -- cgit v1.2.1 From 0a06347333092b54a5545f1c3ce51cd527f7571d Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Thu, 3 Nov 2016 00:49:20 -0700 Subject: Galera MTR Tests: Test for MW-309 - Fix wsrep_max_ws_rows so that it does not affect SELECT queries --- mysql-test/suite/galera/r/MW-309.result | 22 ++++++++++++++++++++++ mysql-test/suite/galera/t/MW-309.test | 31 +++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 mysql-test/suite/galera/r/MW-309.result create mode 100644 mysql-test/suite/galera/t/MW-309.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/MW-309.result b/mysql-test/suite/galera/r/MW-309.result new file mode 100644 index 00000000000..3dd49a041ee --- /dev/null +++ b/mysql-test/suite/galera/r/MW-309.result @@ -0,0 +1,22 @@ +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +SET GLOBAL wsrep_max_ws_rows = 2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +SELECT * FROM t1 GROUP BY f1; +f1 +1 +SELECT * FROM t1 GROUP BY f1; +f1 +1 +SELECT * FROM t1 GROUP BY f1; +f1 +1 +SHOW STATUS LIKE '%wsrep%'; +SET GLOBAL wsrep_max_ws_rows = 0; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MW-309.test b/mysql-test/suite/galera/t/MW-309.test new file mode 100644 index 00000000000..d4939f2745f --- /dev/null +++ b/mysql-test/suite/galera/t/MW-309.test @@ -0,0 +1,31 @@ +# +# MW-309 Regression: wsrep_max_ws_rows limit also applies to certain SELECT queries +# + +--source include/galera_cluster.inc + +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; + +SET GLOBAL wsrep_max_ws_rows = 2; + +SET AUTOCOMMIT=OFF; +START TRANSACTION; +SELECT * FROM t1 GROUP BY f1; +SELECT * FROM t1 GROUP BY f1; + +--error 0 +SELECT * FROM t1 GROUP BY f1; + +--disable_result_log +--error 0 +SHOW STATUS LIKE '%wsrep%'; +--enable_result_log + +SET GLOBAL wsrep_max_ws_rows = 0; +DROP TABLE t1; -- cgit v1.2.1 From 395c420f0fbbd675d2bc32f195bfc2ce7b730d5e Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Thu, 3 Nov 2016 04:05:05 -0700 Subject: Galera MTR Tests: MW-305 , re-enable the test for ALTER USER --- mysql-test/suite/galera/r/galera_account_management.result | 7 +++++++ mysql-test/suite/galera/t/galera_account_management.test | 14 ++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/galera_account_management.result b/mysql-test/suite/galera/r/galera_account_management.result index 9b3ae9ba46e..4fa33a63064 100644 --- a/mysql-test/suite/galera/r/galera_account_management.result +++ b/mysql-test/suite/galera/r/galera_account_management.result @@ -2,6 +2,13 @@ CREATE USER user1, user2 IDENTIFIED BY 'password'; SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2'); COUNT(*) = 2 1 +ALTER USER user1 PASSWORD EXPIRE; +SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1'; +password_expired = 'Y' +1 +SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1'; +password_expired = 'Y' +1 RENAME USER user2 TO user3; SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2'; COUNT(*) = 0 diff --git a/mysql-test/suite/galera/t/galera_account_management.test b/mysql-test/suite/galera/t/galera_account_management.test index 357319ad106..6dea0fcfa9e 100644 --- a/mysql-test/suite/galera/t/galera_account_management.test +++ b/mysql-test/suite/galera/t/galera_account_management.test @@ -18,14 +18,12 @@ SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2'); # ALTER USER # -# LP bug 1376269 -# -#--connection node_1 -#ALTER USER user1 PASSWORD EXPIRE; -#SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1'; -# -#--connection node_2 -#SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1'; +--connection node_1 +ALTER USER user1 PASSWORD EXPIRE; +SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1'; + +--connection node_2 +SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1'; # # RENAME USER -- cgit v1.2.1 From 451bf7243ac9a634593fbca006354d8dae59f34c Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Fri, 4 Nov 2016 01:33:54 -0700 Subject: Galera MTR Tests: Test for MW-313 Enforce wsrep_max_ws_rows also when binlog is enabled --- mysql-test/suite/galera/r/MW-313.result | 32 ++++++++++++++++++ mysql-test/suite/galera/t/MW-313-master.opt | 1 + mysql-test/suite/galera/t/MW-313.test | 50 +++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 mysql-test/suite/galera/r/MW-313.result create mode 100644 mysql-test/suite/galera/t/MW-313-master.opt create mode 100644 mysql-test/suite/galera/t/MW-313.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/MW-313.result b/mysql-test/suite/galera/r/MW-313.result new file mode 100644 index 00000000000..dc605ffc370 --- /dev/null +++ b/mysql-test/suite/galera/r/MW-313.result @@ -0,0 +1,32 @@ +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +SET GLOBAL wsrep_max_ws_rows = 2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +SELECT * FROM t1 GROUP BY f1; +f1 +1 +SELECT * FROM t1 GROUP BY f1; +f1 +1 +SELECT * FROM t1 GROUP BY f1; +f1 +1 +SHOW STATUS LIKE '%wsrep%'; +INSERT INTO t1 SELECT * FROM t1; +ERROR HY000: wsrep_max_ws_rows exceeded +START TRANSACTION; +INSERT INTO t1 (f1) VALUES (1); +INSERT INTO t1 (f1) VALUES (2),(3),(4); +ERROR HY000: wsrep_max_ws_rows exceeded +ROLLBACK; +START TRANSACTION; +DELETE FROM t1; +ERROR HY000: wsrep_max_ws_rows exceeded +DROP TABLE t1; +SET GLOBAL wsrep_max_ws_rows = 0; diff --git a/mysql-test/suite/galera/t/MW-313-master.opt b/mysql-test/suite/galera/t/MW-313-master.opt new file mode 100644 index 00000000000..8a755e98b00 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-313-master.opt @@ -0,0 +1 @@ +--log-bin --log-slave-updates diff --git a/mysql-test/suite/galera/t/MW-313.test b/mysql-test/suite/galera/t/MW-313.test new file mode 100644 index 00000000000..d697cb2cfcd --- /dev/null +++ b/mysql-test/suite/galera/t/MW-313.test @@ -0,0 +1,50 @@ +# +# MW-313 Enforce wsrep_max_ws_rows also when binlog is enabled +# + +--source include/galera_cluster.inc +--source include/have_binlog_format_row.inc + +# No error expected for SELECT and SHOW + +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; + +SET GLOBAL wsrep_max_ws_rows = 2; + +SET AUTOCOMMIT=OFF; +START TRANSACTION; +SELECT * FROM t1 GROUP BY f1; +SELECT * FROM t1 GROUP BY f1; + +--error 0 +SELECT * FROM t1 GROUP BY f1; + +--disable_result_log +--error 0 +SHOW STATUS LIKE '%wsrep%'; +--enable_result_log + +# Error expected for DML + +--error ER_ERROR_DURING_COMMIT +INSERT INTO t1 SELECT * FROM t1; + +START TRANSACTION; +INSERT INTO t1 (f1) VALUES (1); + +--error ER_ERROR_DURING_COMMIT +INSERT INTO t1 (f1) VALUES (2),(3),(4); + +ROLLBACK; +START TRANSACTION; +--error ER_ERROR_DURING_COMMIT +DELETE FROM t1; + +DROP TABLE t1; +SET GLOBAL wsrep_max_ws_rows = 0; -- cgit v1.2.1 From 64bb59fce9278e6e5c4128c636b7e0f5f3cebe16 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Tue, 14 Mar 2017 11:19:03 +0530 Subject: Galera MTR Tests: stability fixes * remove part of galera_var_cluster_address.test that can not be tested reliably * reduce running time for galera_gcache_recover_manytrx.test * Additional wait_conditions for GAL-401.test Signed-off-by: Sachin Setiya --- mysql-test/suite/galera/galera_2nodes.cnf | 2 +- mysql-test/suite/galera/r/GAL-401.result | 1 + .../suite/galera/r/galera_many_tables_pk.result | 11 ++++--- .../galera/r/galera_var_cluster_address.result | 23 -------------- mysql-test/suite/galera/t/GAL-401.test | 5 +++ .../galera/t/galera_gcache_recover_manytrx.cnf | 1 + .../suite/galera/t/galera_many_tables_pk.test | 21 +++++++------ .../suite/galera/t/galera_var_cluster_address.test | 36 ---------------------- 8 files changed, 26 insertions(+), 74 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf index 36630f718c4..0dc22ee4a81 100644 --- a/mysql-test/suite/galera/galera_2nodes.cnf +++ b/mysql-test/suite/galera/galera_2nodes.cnf @@ -8,7 +8,7 @@ default-storage-engine=innodb wsrep-provider=@ENV.WSREP_PROVIDER wsrep_node_address=127.0.0.1 wsrep_cluster_address='gcomm://' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' # enforce read-committed characteristics across the cluster wsrep-causal-reads=ON diff --git a/mysql-test/suite/galera/r/GAL-401.result b/mysql-test/suite/galera/r/GAL-401.result index e1da2b4cf1a..4de13cf142b 100644 --- a/mysql-test/suite/galera/r/GAL-401.result +++ b/mysql-test/suite/galera/r/GAL-401.result @@ -9,6 +9,7 @@ SHOW STATUS LIKE 'wsrep_desync_count'; Variable_name Value wsrep_desync_count 0 SET @@global.wsrep_desync = 0; +SET SESSION wsrep_sync_wait=7; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/suite/galera/r/galera_many_tables_pk.result b/mysql-test/suite/galera/r/galera_many_tables_pk.result index 6b6899d979d..37474797d74 100644 --- a/mysql-test/suite/galera/r/galera_many_tables_pk.result +++ b/mysql-test/suite/galera/r/galera_many_tables_pk.result @@ -1,20 +1,21 @@ -SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%'; -COUNT(*) = 1000 +SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%'; +COUNT(*) = 100 1 SET AUTOCOMMIT=OFF; START TRANSACTION; COMMIT; CREATE TABLE sum_table (f1 INTEGER); -SELECT SUM(f1) = 1000 FROM sum_table; -SUM(f1) = 1000 +SELECT SUM(f1) = 100 FROM sum_table; +SUM(f1) = 100 1 SET AUTOCOMMIT=OFF; START TRANSACTION; SET AUTOCOMMIT=OFF; START TRANSACTION; -UPDATE t1000 SET f1 = 3; +UPDATE t100 SET f1 = 3; COMMIT; COMMIT; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +include/diff_servers.inc [servers=1 2] DROP SCHEMA test; CREATE SCHEMA test; diff --git a/mysql-test/suite/galera/r/galera_var_cluster_address.result b/mysql-test/suite/galera/r/galera_var_cluster_address.result index bb3ea8e3a53..17b5a7bca37 100644 --- a/mysql-test/suite/galera/r/galera_var_cluster_address.result +++ b/mysql-test/suite/galera/r/galera_var_cluster_address.result @@ -26,28 +26,6 @@ VARIABLE_VALUE = 'Primary' SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 -SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1'; -SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS; -COUNT(*) > 0 -1 -SHOW STATUS LIKE 'wsrep_ready'; -Variable_name Value -wsrep_ready ON -SHOW STATUS LIKE 'wsrep_cluster_status'; -Variable_name Value -wsrep_cluster_status Primary -SHOW STATUS LIKE 'wsrep_local_state'; -Variable_name Value -wsrep_local_state 4 -SHOW STATUS LIKE 'wsrep_local_state_comment'; -Variable_name Value -wsrep_local_state_comment Synced -SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -VARIABLE_VALUE = 'Primary' -1 -SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -VARIABLE_VALUE = 2 -1 CALL mtr.add_suppression("Backend not supported: foo"); CALL mtr.add_suppression("Failed to initialize backend using 'foo"); CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'foo"); @@ -58,5 +36,4 @@ CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed t CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)"); CALL mtr.add_suppression("gcs connect failed: Connection timed out"); CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7"); -CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7"); # End of test diff --git a/mysql-test/suite/galera/t/GAL-401.test b/mysql-test/suite/galera/t/GAL-401.test index 1f7b493717f..05295d1b977 100644 --- a/mysql-test/suite/galera/t/GAL-401.test +++ b/mysql-test/suite/galera/t/GAL-401.test @@ -38,6 +38,11 @@ SHOW STATUS LIKE 'wsrep_desync_count'; # Resync node_2, should pass: SET @@global.wsrep_desync = 0; + +--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; +--source include/wait_condition.inc + +SET SESSION wsrep_sync_wait=7; SHOW CREATE TABLE t1; DROP TABLE t1; CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored."); diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf index 39af0e94b94..c08551eae84 100644 --- a/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf +++ b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf @@ -5,4 +5,5 @@ innodb_log_file_size=110M wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true;' [mysqld.2] +innodb_log_file_size=110M wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true;' diff --git a/mysql-test/suite/galera/t/galera_many_tables_pk.test b/mysql-test/suite/galera/t/galera_many_tables_pk.test index 886cb7c1a00..72c7e08bcc3 100644 --- a/mysql-test/suite/galera/t/galera_many_tables_pk.test +++ b/mysql-test/suite/galera/t/galera_many_tables_pk.test @@ -3,16 +3,16 @@ --source include/have_innodb.inc # -# This test forces 1K tables with a PK to participate in a single transaction +# This test forces 100 tables with a PK to participate in a single transaction # # -# First, create 1K tables and make sure the DDLs are all propagated +# First, create 100 tables and make sure the DDLs are all propagated # --connection node_1 ---let $count = 1000 +--let $count = 100 while ($count) { --disable_query_log @@ -23,7 +23,7 @@ while ($count) } --connection node_2 -SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%'; +SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%'; # # Second, create a transaction that uses all those tables @@ -33,7 +33,7 @@ SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test SET AUTOCOMMIT=OFF; START TRANSACTION; ---let $count = 1000 +--let $count = 100 while ($count) { --disable_query_log @@ -52,7 +52,7 @@ COMMIT; --connection node_2 CREATE TABLE sum_table (f1 INTEGER); ---let $count = 1000 +--let $count = 100 while ($count) { --disable_query_log @@ -62,7 +62,7 @@ while ($count) --dec $count } -SELECT SUM(f1) = 1000 FROM sum_table; +SELECT SUM(f1) = 100 FROM sum_table; # # Fourth, create a deadlock @@ -72,7 +72,7 @@ SELECT SUM(f1) = 1000 FROM sum_table; SET AUTOCOMMIT=OFF; START TRANSACTION; ---let $count = 1000 +--let $count = 100 while ($count) { --disable_query_log @@ -85,7 +85,7 @@ while ($count) --connection node_2 SET AUTOCOMMIT=OFF; START TRANSACTION; -UPDATE t1000 SET f1 = 3; +UPDATE t100 SET f1 = 3; --connection node_1 COMMIT; @@ -94,5 +94,8 @@ COMMIT; --error ER_LOCK_DEADLOCK COMMIT; +--let $diff_servers = 1 2 +--source include/diff_servers.inc + DROP SCHEMA test; CREATE SCHEMA test; diff --git a/mysql-test/suite/galera/t/galera_var_cluster_address.test b/mysql-test/suite/galera/t/galera_var_cluster_address.test index 5328b5e7a94..984a262c7bd 100644 --- a/mysql-test/suite/galera/t/galera_var_cluster_address.test +++ b/mysql-test/suite/galera/t/galera_var_cluster_address.test @@ -58,41 +58,6 @@ SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VA SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -# -# Set to invalid host -# - ---connection node_2 -SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1'; ---let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; ---source include/wait_condition.inc - ---error 0 -SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS; - -# Must return 'OFF' -SHOW STATUS LIKE 'wsrep_ready'; - -# Must return 'Non-primary' -SHOW STATUS LIKE 'wsrep_cluster_status'; - -# Must return 0 = 'Initialized' -SHOW STATUS LIKE 'wsrep_local_state'; -SHOW STATUS LIKE 'wsrep_local_state_comment'; - -# -# Reset everything as it was -# - ---connection node_2 ---disable_query_log ---eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node2'; ---enable_query_log - ---connection node_1 -SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; - --connection node_2 CALL mtr.add_suppression("Backend not supported: foo"); CALL mtr.add_suppression("Failed to initialize backend using 'foo"); @@ -104,7 +69,6 @@ CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed t CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)"); CALL mtr.add_suppression("gcs connect failed: Connection timed out"); CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7"); -CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7"); # Restore original auto_increment_offset values. --source include/auto_increment_offset_restore.inc -- cgit v1.2.1 From f78332c5818d0ba0b145bb09aa0bd4eedade7397 Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Sat, 5 Nov 2016 09:15:14 -0700 Subject: Galera MTR Tests: stability fix for galera#414.test --- mysql-test/suite/galera/t/galera#414.test | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/t/galera#414.test b/mysql-test/suite/galera/t/galera#414.test index 0ee6dcac700..dccb28e4054 100644 --- a/mysql-test/suite/galera/t/galera#414.test +++ b/mysql-test/suite/galera/t/galera#414.test @@ -24,10 +24,14 @@ SET SESSION wsrep_on = OFF; SET SESSION wsrep_on = ON; --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; --source include/wait_condition.inc +--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; +--source include/wait_condition.inc --connection node_1 CALL mtr.add_suppression("Failed to set packet size"); --connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; +--source include/wait_condition.inc CALL mtr.add_suppression("Failed to set packet size"); -- cgit v1.2.1 From 6fabf12ba0c13c023451a8f4d9d0de95f44d38aa Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Wed, 23 Nov 2016 02:55:36 -0800 Subject: Galera MTR Test: Test for MW-28 : Assertion with --wsrep-log-conflicts --- .../galera/r/galera_wsrep_log_conficts.result | 18 +++++++ .../galera/t/galera_wsrep_log_conficts-master.opt | 1 + .../suite/galera/t/galera_wsrep_log_conficts.test | 55 ++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 mysql-test/suite/galera/r/galera_wsrep_log_conficts.result create mode 100644 mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt create mode 100644 mysql-test/suite/galera/t/galera_wsrep_log_conficts.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/galera_wsrep_log_conficts.result b/mysql-test/suite/galera/r/galera_wsrep_log_conficts.result new file mode 100644 index 00000000000..b535c6477b7 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_wsrep_log_conficts.result @@ -0,0 +1,18 @@ +CREATE TABLE t1 ( +f1 VARCHAR(255) PRIMARY KEY +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES ('abc'); +SELECT f1 = 'abc' FROM t1; +f1 = 'abc' +1 +SET AUTOCOMMIT=OFF; +START TRANSACTION; +UPDATE t1 SET f1 = 'klm'; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +UPDATE t1 SET f1 = 'xyz'; +COMMIT; +COMMIT; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +include/assert_grep.inc [cluster conflict due to high priority abort for threads] +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt b/mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt new file mode 100644 index 00000000000..930c483bd64 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt @@ -0,0 +1 @@ +--wsrep_log_conflicts=ON diff --git a/mysql-test/suite/galera/t/galera_wsrep_log_conficts.test b/mysql-test/suite/galera/t/galera_wsrep_log_conficts.test new file mode 100644 index 00000000000..3af08cbf637 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_wsrep_log_conficts.test @@ -0,0 +1,55 @@ +# +# Test --wsrep_log_conflicts=ON +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc + +CREATE TABLE t1 ( + f1 VARCHAR(255) PRIMARY KEY +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO t1 VALUES ('abc'); + +--connection node_2 +SELECT f1 = 'abc' FROM t1; + +# +# Provoke a conflict +# + +--connection node_1 +SET AUTOCOMMIT=OFF; +START TRANSACTION; +UPDATE t1 SET f1 = 'klm'; + +--connection node_2 +SET AUTOCOMMIT=OFF; +START TRANSACTION; +UPDATE t1 SET f1 = 'xyz'; + +--connection node_1 +COMMIT; + +--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 +--connection node_2a +--let $wait_condition = SELECT f1 = 'klm' FROM t1; +--source include/wait_condition.inc + +--connection node_2 +--error ER_LOCK_DEADLOCK +COMMIT; + +# +# We can not really check the log output very much because it is quite variable +# + +--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err +--let $assert_only_after = CURRENT_TEST + +--let $assert_text = cluster conflict due to high priority abort for threads +--let $assert_select = cluster conflict due to high priority abort for threads +--let $assert_match = cluster conflict due to high priority abort for threads +--source include/assert_grep.inc + +DROP TABLE t1; -- cgit v1.2.1 From f29c40d0a5d84a23500df4bac1657dce64bd3d9a Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Tue, 14 Mar 2017 14:31:13 +0530 Subject: GAL-480 MTR test --- mysql-test/suite/galera/r/GAL-480.result | 39 ++++++++++++++++++++++++++ mysql-test/suite/galera/t/GAL-480.test | 47 ++++++++++++++++++++++++++++++++ mysql-test/suite/galera/t/MW-309.test | 1 + 3 files changed, 87 insertions(+) create mode 100644 mysql-test/suite/galera/r/GAL-480.result create mode 100644 mysql-test/suite/galera/t/GAL-480.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/GAL-480.result b/mysql-test/suite/galera/r/GAL-480.result new file mode 100644 index 00000000000..b762e07423e --- /dev/null +++ b/mysql-test/suite/galera/r/GAL-480.result @@ -0,0 +1,39 @@ +CREATE TABLE t1 (f1 CHAR(10), f0 integer) ENGINE=InnoDB; +FLUSH TABLE t1 FOR EXPORT; +UNLOCK TABLES; +ALTER TABLE t1 DROP COLUMN f1; +SET SESSION wsrep_osu_method='RSU'; +ALTER TABLE t1 ADD COLUMN f1 CHAR(10); +ALTER TABLE t1 DROP COLUMN f1; +ALTER TABLE t1 ADD COLUMN f2 CHAR(10); +ALTER TABLE t1 DROP COLUMN f2; +ALTER TABLE t1 ADD COLUMN f3 CHAR(10); +ALTER TABLE t1 DROP COLUMN f3; +ALTER TABLE t1 ADD COLUMN f4 CHAR(10); +ALTER TABLE t1 DROP COLUMN f4; +ALTER TABLE t1 ADD COLUMN f5 CHAR(10); +ALTER TABLE t1 DROP COLUMN f5; +ALTER TABLE t1 ADD COLUMN f6 CHAR(10); +ALTER TABLE t1 DROP COLUMN f6; +ALTER TABLE t1 ADD COLUMN f7 CHAR(10); +ALTER TABLE t1 DROP COLUMN f7; +ALTER TABLE t1 ADD COLUMN f8 CHAR(10); +ALTER TABLE t1 DROP COLUMN f8; +ALTER TABLE t1 ADD COLUMN f9 CHAR(10); +ALTER TABLE t1 DROP COLUMN f9; +ALTER TABLE t1 ADD COLUMN f10 CHAR(10); +ALTER TABLE t1 DROP COLUMN f10; +ALTER TABLE t1 ADD COLUMN f11 CHAR(10); +ALTER TABLE t1 DROP COLUMN f11; +ALTER TABLE t1 ADD COLUMN f12 CHAR(10); +ALTER TABLE t1 DROP COLUMN f12; +ALTER TABLE t1 ADD COLUMN f13 CHAR(10); +ALTER TABLE t1 DROP COLUMN f13; +ALTER TABLE t1 ADD COLUMN f14 CHAR(10); +ALTER TABLE t1 DROP COLUMN f14; +ALTER TABLE t1 ADD COLUMN f15 CHAR(10); +ALTER TABLE t1 DROP COLUMN f15; +ALTER TABLE t1 ADD COLUMN f16 CHAR(10); +ALTER TABLE t1 DROP COLUMN f16; +SET SESSION wsrep_osu_method='TOI'; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/GAL-480.test b/mysql-test/suite/galera/t/GAL-480.test new file mode 100644 index 00000000000..142772fd8f9 --- /dev/null +++ b/mysql-test/suite/galera/t/GAL-480.test @@ -0,0 +1,47 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--connection node_1 +CREATE TABLE t1 (f1 CHAR(10), f0 integer) ENGINE=InnoDB; + +FLUSH TABLE t1 FOR EXPORT; +UNLOCK TABLES; + +ALTER TABLE t1 DROP COLUMN f1; + +SET SESSION wsrep_osu_method='RSU'; +ALTER TABLE t1 ADD COLUMN f1 CHAR(10); +ALTER TABLE t1 DROP COLUMN f1; +ALTER TABLE t1 ADD COLUMN f2 CHAR(10); +ALTER TABLE t1 DROP COLUMN f2; +ALTER TABLE t1 ADD COLUMN f3 CHAR(10); +ALTER TABLE t1 DROP COLUMN f3; +ALTER TABLE t1 ADD COLUMN f4 CHAR(10); +ALTER TABLE t1 DROP COLUMN f4; +ALTER TABLE t1 ADD COLUMN f5 CHAR(10); +ALTER TABLE t1 DROP COLUMN f5; +ALTER TABLE t1 ADD COLUMN f6 CHAR(10); +ALTER TABLE t1 DROP COLUMN f6; +ALTER TABLE t1 ADD COLUMN f7 CHAR(10); +ALTER TABLE t1 DROP COLUMN f7; +ALTER TABLE t1 ADD COLUMN f8 CHAR(10); +ALTER TABLE t1 DROP COLUMN f8; +ALTER TABLE t1 ADD COLUMN f9 CHAR(10); +ALTER TABLE t1 DROP COLUMN f9; +ALTER TABLE t1 ADD COLUMN f10 CHAR(10); +ALTER TABLE t1 DROP COLUMN f10; +ALTER TABLE t1 ADD COLUMN f11 CHAR(10); +ALTER TABLE t1 DROP COLUMN f11; +ALTER TABLE t1 ADD COLUMN f12 CHAR(10); +ALTER TABLE t1 DROP COLUMN f12; +ALTER TABLE t1 ADD COLUMN f13 CHAR(10); +ALTER TABLE t1 DROP COLUMN f13; +ALTER TABLE t1 ADD COLUMN f14 CHAR(10); +ALTER TABLE t1 DROP COLUMN f14; +ALTER TABLE t1 ADD COLUMN f15 CHAR(10); +ALTER TABLE t1 DROP COLUMN f15; +ALTER TABLE t1 ADD COLUMN f16 CHAR(10); +ALTER TABLE t1 DROP COLUMN f16; + +SET SESSION wsrep_osu_method='TOI'; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MW-309.test b/mysql-test/suite/galera/t/MW-309.test index d4939f2745f..351a508ecec 100644 --- a/mysql-test/suite/galera/t/MW-309.test +++ b/mysql-test/suite/galera/t/MW-309.test @@ -3,6 +3,7 @@ # --source include/galera_cluster.inc +--source include/have_innodb.inc CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); -- cgit v1.2.1 From 17f716062d51a1a8023c9e0ea2a483d651555fce Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Thu, 8 Dec 2016 00:17:28 -0800 Subject: Galera MTR Tests: Test for MW-329 Fix incorrect affected rows count after replay --- mysql-test/suite/galera/r/MW-329.result | 80 +++++++++++++++++++++++++++++++++ mysql-test/suite/galera/t/MW-329.test | 61 +++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 mysql-test/suite/galera/r/MW-329.result create mode 100644 mysql-test/suite/galera/t/MW-329.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/MW-329.result b/mysql-test/suite/galera/r/MW-329.result new file mode 100644 index 00000000000..c782bf38f48 --- /dev/null +++ b/mysql-test/suite/galera/r/MW-329.result @@ -0,0 +1,80 @@ +CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; +INSERT INTO t1 (f1) VALUES (1),(65535); +FLUSH STATUS; +SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'; +VARIABLE_VALUE = 0 +1 +CREATE PROCEDURE proc_insert () +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET SESSION wsrep_sync_wait = 0; +WHILE 1 DO +INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 )); +END WHILE; +END| +CALL proc_insert();; +SELECT ROW_COUNT() > 0; +ROW_COUNT() > 0 +1 +SELECT FOUND_ROWS() > 0; +FOUND_ROWS() > 0 +1 +SELECT ROW_COUNT() > 0; +ROW_COUNT() > 0 +1 +SELECT FOUND_ROWS() > 0; +FOUND_ROWS() > 0 +1 +SELECT ROW_COUNT() > 0; +ROW_COUNT() > 0 +1 +SELECT FOUND_ROWS() > 0; +FOUND_ROWS() > 0 +1 +SELECT ROW_COUNT() > 0; +ROW_COUNT() > 0 +1 +SELECT FOUND_ROWS() > 0; +FOUND_ROWS() > 0 +1 +SELECT ROW_COUNT() > 0; +ROW_COUNT() > 0 +1 +SELECT FOUND_ROWS() > 0; +FOUND_ROWS() > 0 +1 +SELECT ROW_COUNT() > 0; +ROW_COUNT() > 0 +1 +SELECT FOUND_ROWS() > 0; +FOUND_ROWS() > 0 +1 +SELECT ROW_COUNT() > 0; +ROW_COUNT() > 0 +1 +SELECT FOUND_ROWS() > 0; +FOUND_ROWS() > 0 +1 +SELECT ROW_COUNT() > 0; +ROW_COUNT() > 0 +1 +SELECT FOUND_ROWS() > 0; +FOUND_ROWS() > 0 +1 +SELECT ROW_COUNT() > 0; +ROW_COUNT() > 0 +1 +SELECT FOUND_ROWS() > 0; +FOUND_ROWS() > 0 +1 +SELECT ROW_COUNT() > 0; +ROW_COUNT() > 0 +1 +SELECT FOUND_ROWS() > 0; +FOUND_ROWS() > 0 +1 +SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'; +VARIABLE_VALUE > 0 +1 +DROP PROCEDURE proc_insert; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MW-329.test b/mysql-test/suite/galera/t/MW-329.test new file mode 100644 index 00000000000..d22eb4d6a79 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-329.test @@ -0,0 +1,61 @@ +# +# #MW-329 Fix incorrect affected rows count after replay +# + +--source include/galera_cluster.inc + +CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; + +# We start with a populated table +INSERT INTO t1 (f1) VALUES (1),(65535); + +# Clear the wsrep_local_replays counter + +FLUSH STATUS; +SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'; + +# +# Run concurrent INSERTs +# + +DELIMITER |; +CREATE PROCEDURE proc_insert () +BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + SET SESSION wsrep_sync_wait = 0; + WHILE 1 DO + INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 )); + END WHILE; +END| +DELIMITER ;| + +--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connection node_1b +--send CALL proc_insert(); + +# +# Run concurrent UPDATEs. We expect that each UPDATE will report that +# some rows were matched and updated +# + +--connection node_2 +--let $count = 10 +while ($count) +{ + --let $signature = `SELECT LEFT(MD5(RAND()), 10)` + --disable_query_log + --eval UPDATE t1 SET f2 = '$signature' + --enable_query_log + SELECT ROW_COUNT() > 0; + SELECT FOUND_ROWS() > 0; + --dec $count +} + +# +# Confirm that some transaction replays occurred +# + +SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'; + +DROP PROCEDURE proc_insert; +DROP TABLE t1; -- cgit v1.2.1 From 5ac0d5fc24d6d7bfc8c8f634749b303072edf7d9 Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Thu, 8 Dec 2016 05:15:31 -0800 Subject: Galera MTR Tests: Stability fix for MW-329 --- mysql-test/suite/galera/r/MW-329.result | 60 ----------------------------- mysql-test/suite/galera/t/MW-329-master.opt | 1 + mysql-test/suite/galera/t/MW-329.test | 24 +++++++++++- 3 files changed, 23 insertions(+), 62 deletions(-) create mode 100644 mysql-test/suite/galera/t/MW-329-master.opt (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/MW-329.result b/mysql-test/suite/galera/r/MW-329.result index c782bf38f48..655d8e9e291 100644 --- a/mysql-test/suite/galera/r/MW-329.result +++ b/mysql-test/suite/galera/r/MW-329.result @@ -13,66 +13,6 @@ INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 )); END WHILE; END| CALL proc_insert();; -SELECT ROW_COUNT() > 0; -ROW_COUNT() > 0 -1 -SELECT FOUND_ROWS() > 0; -FOUND_ROWS() > 0 -1 -SELECT ROW_COUNT() > 0; -ROW_COUNT() > 0 -1 -SELECT FOUND_ROWS() > 0; -FOUND_ROWS() > 0 -1 -SELECT ROW_COUNT() > 0; -ROW_COUNT() > 0 -1 -SELECT FOUND_ROWS() > 0; -FOUND_ROWS() > 0 -1 -SELECT ROW_COUNT() > 0; -ROW_COUNT() > 0 -1 -SELECT FOUND_ROWS() > 0; -FOUND_ROWS() > 0 -1 -SELECT ROW_COUNT() > 0; -ROW_COUNT() > 0 -1 -SELECT FOUND_ROWS() > 0; -FOUND_ROWS() > 0 -1 -SELECT ROW_COUNT() > 0; -ROW_COUNT() > 0 -1 -SELECT FOUND_ROWS() > 0; -FOUND_ROWS() > 0 -1 -SELECT ROW_COUNT() > 0; -ROW_COUNT() > 0 -1 -SELECT FOUND_ROWS() > 0; -FOUND_ROWS() > 0 -1 -SELECT ROW_COUNT() > 0; -ROW_COUNT() > 0 -1 -SELECT FOUND_ROWS() > 0; -FOUND_ROWS() > 0 -1 -SELECT ROW_COUNT() > 0; -ROW_COUNT() > 0 -1 -SELECT FOUND_ROWS() > 0; -FOUND_ROWS() > 0 -1 -SELECT ROW_COUNT() > 0; -ROW_COUNT() > 0 -1 -SELECT FOUND_ROWS() > 0; -FOUND_ROWS() > 0 -1 SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'; VARIABLE_VALUE > 0 1 diff --git a/mysql-test/suite/galera/t/MW-329-master.opt b/mysql-test/suite/galera/t/MW-329-master.opt new file mode 100644 index 00000000000..6565a6af3c4 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-329-master.opt @@ -0,0 +1 @@ +--wsrep-retry-autocommit=0 diff --git a/mysql-test/suite/galera/t/MW-329.test b/mysql-test/suite/galera/t/MW-329.test index d22eb4d6a79..445f8795dff 100644 --- a/mysql-test/suite/galera/t/MW-329.test +++ b/mysql-test/suite/galera/t/MW-329.test @@ -31,6 +31,7 @@ DELIMITER ;| --connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1 --connection node_1b +--let $connection_id = `SELECT CONNECTION_ID()` --send CALL proc_insert(); # @@ -44,10 +45,15 @@ while ($count) { --let $signature = `SELECT LEFT(MD5(RAND()), 10)` --disable_query_log + --error 0,ER_LOCK_DEADLOCK --eval UPDATE t1 SET f2 = '$signature' --enable_query_log - SELECT ROW_COUNT() > 0; - SELECT FOUND_ROWS() > 0; + --let $row_count = `SELECT ROW_COUNT()` + if (`SELECT @@error_count = 0`) { + if (`SELECT $row_count = 0`) { + --die ROW_COUNT() = 0 + } + } --dec $count } @@ -57,5 +63,19 @@ while ($count) SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'; +# +# Terminate the stored procedure +# + +--connection node_1 +--disable_query_log +--eval KILL CONNECTION $connection_id +--enable_query_log + +--connection node_1b +--error 0,2013,1317 +--reap + +--connection node_1 DROP PROCEDURE proc_insert; DROP TABLE t1; -- cgit v1.2.1 From dd2f023427a7125dda307d6e5ca5ec42c6fd741b Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Thu, 15 Dec 2016 01:22:44 -0800 Subject: Galera MTR Tests: restore galera_autoinc_sst_xtrabackup.test to use xtrabackup SST --- mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf | 5 ++--- mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf index 7d684cef67d..b4bf5f02171 100644 --- a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf +++ b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.cnf @@ -1,9 +1,8 @@ !include ../galera_2nodes.cnf [mysqld] -#wsrep_sst_method=xtrabackup-v2 -#wsrep_sst_auth="root:" -#wsrep_debug=ON +wsrep_sst_method=xtrabackup-v2 +wsrep_sst_auth="root:" [mysqld.1] wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' diff --git a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test index 251450f7099..30ce9bc4ceb 100644 --- a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test +++ b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test @@ -1,6 +1,6 @@ # # Test that autoincrement works correctly while the cluster membership -# is changing and IST takes place. +# is changing and SST takes place. # --source include/big_test.inc -- cgit v1.2.1 From 69b5bd7ae3ac8e4f3021fc28e01aa3aaa1b0e3bd Mon Sep 17 00:00:00 2001 From: Philip Stoev Date: Fri, 16 Dec 2016 02:30:09 -0800 Subject: Galera MTR Tests: Tests for MW-328 Fix unnecessary/silent BF aborts --- mysql-test/suite/galera/r/MW-328A.result | 21 +++++++++++ mysql-test/suite/galera/r/MW-328B.result | 17 +++++++++ mysql-test/suite/galera/r/MW-328C.result | 17 +++++++++ mysql-test/suite/galera/r/MW-328D.result | 15 ++++++++ mysql-test/suite/galera/r/MW-328E.result | 15 ++++++++ mysql-test/suite/galera/t/MW-328-footer.inc | 18 ++++++++++ mysql-test/suite/galera/t/MW-328-header.inc | 29 +++++++++++++++ mysql-test/suite/galera/t/MW-328A.test | 55 +++++++++++++++++++++++++++++ mysql-test/suite/galera/t/MW-328B.test | 35 ++++++++++++++++++ mysql-test/suite/galera/t/MW-328C.test | 35 ++++++++++++++++++ mysql-test/suite/galera/t/MW-328D.test | 39 ++++++++++++++++++++ mysql-test/suite/galera/t/MW-328E.test | 40 +++++++++++++++++++++ 12 files changed, 336 insertions(+) create mode 100644 mysql-test/suite/galera/r/MW-328A.result create mode 100644 mysql-test/suite/galera/r/MW-328B.result create mode 100644 mysql-test/suite/galera/r/MW-328C.result create mode 100644 mysql-test/suite/galera/r/MW-328D.result create mode 100644 mysql-test/suite/galera/r/MW-328E.result create mode 100644 mysql-test/suite/galera/t/MW-328-footer.inc create mode 100644 mysql-test/suite/galera/t/MW-328-header.inc create mode 100644 mysql-test/suite/galera/t/MW-328A.test create mode 100644 mysql-test/suite/galera/t/MW-328B.test create mode 100644 mysql-test/suite/galera/t/MW-328C.test create mode 100644 mysql-test/suite/galera/t/MW-328D.test create mode 100644 mysql-test/suite/galera/t/MW-328E.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/MW-328A.result b/mysql-test/suite/galera/r/MW-328A.result new file mode 100644 index 00000000000..daed2469f11 --- /dev/null +++ b/mysql-test/suite/galera/r/MW-328A.result @@ -0,0 +1,21 @@ +CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; +INSERT INTO t1 (f1) VALUES (1); +CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB; +CREATE PROCEDURE proc_update () +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET SESSION wsrep_sync_wait = 0; +WHILE 1 DO +UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4); +END WHILE; +END| +CALL proc_update();; +SET SESSION wsrep_retry_autocommit = 0; +have_successes +1 +have_deadlocks +1 +Got one of the listed errors +DROP PROCEDURE proc_update; +DROP TABLE t1, t2; +CALL mtr.add_suppression("conflict state 3 after post commit"); diff --git a/mysql-test/suite/galera/r/MW-328B.result b/mysql-test/suite/galera/r/MW-328B.result new file mode 100644 index 00000000000..780988938f6 --- /dev/null +++ b/mysql-test/suite/galera/r/MW-328B.result @@ -0,0 +1,17 @@ +CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; +INSERT INTO t1 (f1) VALUES (1); +CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB; +CREATE PROCEDURE proc_update () +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET SESSION wsrep_sync_wait = 0; +WHILE 1 DO +UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4); +END WHILE; +END| +CALL proc_update();; +SET SESSION wsrep_retry_autocommit = 0; +Got one of the listed errors +DROP PROCEDURE proc_update; +DROP TABLE t1, t2; +CALL mtr.add_suppression("conflict state 3 after post commit"); diff --git a/mysql-test/suite/galera/r/MW-328C.result b/mysql-test/suite/galera/r/MW-328C.result new file mode 100644 index 00000000000..5cd74f05171 --- /dev/null +++ b/mysql-test/suite/galera/r/MW-328C.result @@ -0,0 +1,17 @@ +CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; +INSERT INTO t1 (f1) VALUES (1); +CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB; +CREATE PROCEDURE proc_update () +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET SESSION wsrep_sync_wait = 0; +WHILE 1 DO +UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4); +END WHILE; +END| +CALL proc_update();; +SET SESSION wsrep_retry_autocommit = 10000; +Got one of the listed errors +DROP PROCEDURE proc_update; +DROP TABLE t1, t2; +CALL mtr.add_suppression("conflict state 3 after post commit"); diff --git a/mysql-test/suite/galera/r/MW-328D.result b/mysql-test/suite/galera/r/MW-328D.result new file mode 100644 index 00000000000..f6d055def93 --- /dev/null +++ b/mysql-test/suite/galera/r/MW-328D.result @@ -0,0 +1,15 @@ +CREATE TABLE t1 (i INT) ENGINE = InnoDB; +INSERT INTO t1 (i) VALUES(1); +CREATE TABLE t2 (i INT) ENGINE = InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE; +i +1 +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE;; +DELETE FROM t1 WHERE i = 1; +COMMIT; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +DROP TABLE t1, t2; diff --git a/mysql-test/suite/galera/r/MW-328E.result b/mysql-test/suite/galera/r/MW-328E.result new file mode 100644 index 00000000000..5829559fa4d --- /dev/null +++ b/mysql-test/suite/galera/r/MW-328E.result @@ -0,0 +1,15 @@ +create table t1 (i int primary key, j int) engine=innodb; +create table t2 (i int primary key, j int) engine=innodb; +insert into t1 values (1,0); +insert into t2 values (2,0); +set autocommit=off; +start transaction; +update t1 set j=1 where i=1; +set autocommit=off; +start transaction; +begin; +update t2 set j=1 where i=2; +insert into t1 select * from t2;; +insert into t2 select * from t1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +DROP TABLE t1, t2; diff --git a/mysql-test/suite/galera/t/MW-328-footer.inc b/mysql-test/suite/galera/t/MW-328-footer.inc new file mode 100644 index 00000000000..5b736df220f --- /dev/null +++ b/mysql-test/suite/galera/t/MW-328-footer.inc @@ -0,0 +1,18 @@ +# +# Cleanup for MW-328 tests +# + +--connection node_1 +--disable_query_log +--eval KILL CONNECTION $sp_connection_id +--enable_query_log + +--connection node_1X +--error 2013,1317 +--reap + +--connection node_1 +DROP PROCEDURE proc_update; +DROP TABLE t1, t2; + +CALL mtr.add_suppression("conflict state 3 after post commit"); diff --git a/mysql-test/suite/galera/t/MW-328-header.inc b/mysql-test/suite/galera/t/MW-328-header.inc new file mode 100644 index 00000000000..f0a6ccaccc6 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-328-header.inc @@ -0,0 +1,29 @@ +# +# Initialization for MW-328 tests +# + +CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; +INSERT INTO t1 (f1) VALUES (1); + +CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB; + +# +# Have some random updates going on against t1 +# + +DELIMITER |; +CREATE PROCEDURE proc_update () +BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + SET SESSION wsrep_sync_wait = 0; + WHILE 1 DO + UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4); + END WHILE; +END| + +DELIMITER ;| + +--connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connection node_1X +--let $sp_connection_id = `SELECT CONNECTION_ID()` +--send CALL proc_update(); diff --git a/mysql-test/suite/galera/t/MW-328A.test b/mysql-test/suite/galera/t/MW-328A.test new file mode 100644 index 00000000000..836dd088749 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-328A.test @@ -0,0 +1,55 @@ +# +# MW-328 Fix unnecessary/silent BF aborts +# + +# +# Attempt to insert into t2 and check if insert actually inserted rows if +# a success was reported. +# + +--source include/galera_cluster.inc +--source suite/galera/t/MW-328-header.inc + +--connection node_2 +--let $count = 100 +--let $successes = 0 +--let $deadlocks = 0 + +SET SESSION wsrep_retry_autocommit = 0; + +--disable_query_log + +while ($count) +{ + TRUNCATE TABLE t2; + + --error 0,1213 + INSERT IGNORE INTO t2 SELECT f2 FROM t1; + if ($mysql_errno != 1213) { + --inc $successes + if (`SELECT COUNT(*) = 0 FROM t2`) { + --die No rows arrived in table t2 + } + } + + if ($mysql_errno == 1213) { + --inc $deadlocks + + } + + --dec $count +} + +--enable_query_log + +# +# Check that the test produced both deadlocks and successes +# + +--disable_query_log +--eval SELECT $successes > 0 AS have_successes +--eval SELECT $deadlocks > 0 AS have_deadlocks +--enable_query_log + + +--source suite/galera/t/MW-328-footer.inc diff --git a/mysql-test/suite/galera/t/MW-328B.test b/mysql-test/suite/galera/t/MW-328B.test new file mode 100644 index 00000000000..11969dd0b47 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-328B.test @@ -0,0 +1,35 @@ +# +# MW-328 Fix unnecessary/silent BF aborts +# + +# +# Make sure an unrelated SELECT following a BF-aborted query never +# gets the deadlock error +# + +--source include/galera_cluster.inc +--source suite/galera/t/MW-328-header.inc + +--connection node_2 +--let $count = 100 + +SET SESSION wsrep_retry_autocommit = 0; + +--disable_query_log + +while ($count) +{ + --error 0,1213 + INSERT IGNORE INTO t2 SELECT f2 FROM t1; + + --disable_result_log + --error 0 + SELECT 1 FROM DUAL; + --enable_result_log + + --dec $count +} + +--enable_query_log + +--source suite/galera/t/MW-328-footer.inc diff --git a/mysql-test/suite/galera/t/MW-328C.test b/mysql-test/suite/galera/t/MW-328C.test new file mode 100644 index 00000000000..7241dfbdbca --- /dev/null +++ b/mysql-test/suite/galera/t/MW-328C.test @@ -0,0 +1,35 @@ +# +# MW-328 Fix unnecessary/silent BF aborts +# + +# +# Make sure that a high value of wsrep_retry_autocommit +# masks all deadlock errors +# + +--source include/galera_cluster.inc +--source suite/galera/t/MW-328-header.inc + +--connection node_2 +--let $count = 100 + +SET SESSION wsrep_retry_autocommit = 10000; + +--disable_query_log + +while ($count) +{ + --error 0 + INSERT IGNORE INTO t2 SELECT f2 FROM t1; + + --disable_result_log + --error 0 + SELECT 1 FROM DUAL; + --enable_result_log + + --dec $count +} + +--enable_query_log + +--source suite/galera/t/MW-328-footer.inc diff --git a/mysql-test/suite/galera/t/MW-328D.test b/mysql-test/suite/galera/t/MW-328D.test new file mode 100644 index 00000000000..e8a22f22a99 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-328D.test @@ -0,0 +1,39 @@ +# +# MW-328 Fix unnecessary/silent BF aborts +# + +# +# Test that non-Galera deadlock error still behaves as expected +# + +--source include/galera_cluster.inc + +CREATE TABLE t1 (i INT) ENGINE = InnoDB; +INSERT INTO t1 (i) VALUES(1); + +CREATE TABLE t2 (i INT) ENGINE = InnoDB; + +# Create a deadlock situation + +--connection node_1 +SET AUTOCOMMIT=OFF; +START TRANSACTION; +SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE; + +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connection node_1a +SET AUTOCOMMIT=OFF; +START TRANSACTION; +--send INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE; + +--connection node_1 +--sleep 2 +DELETE FROM t1 WHERE i = 1; +COMMIT; + +# We expect that ER_LOCK_DEADLOCK will be delivered even though it was a INSERT INGORE statement +--connection node_1a +--error ER_LOCK_DEADLOCK +--reap + +DROP TABLE t1, t2; diff --git a/mysql-test/suite/galera/t/MW-328E.test b/mysql-test/suite/galera/t/MW-328E.test new file mode 100644 index 00000000000..34b17be7b08 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-328E.test @@ -0,0 +1,40 @@ +# +# MW-328 Fix unnecessary/silent BF aborts +# + +# +# Test that non-Galera deadlock error still behaves as expected (case #2) +# + +--source include/galera_cluster.inc + +create table t1 (i int primary key, j int) engine=innodb; +create table t2 (i int primary key, j int) engine=innodb; + +insert into t1 values (1,0); +insert into t2 values (2,0); + +set autocommit=off; +start transaction; +update t1 set j=1 where i=1; + +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connection node_1a +set autocommit=off; +start transaction; +begin; +update t2 set j=1 where i=2; + +--connection node_1 +# Hang expected here +--send insert into t1 select * from t2; + +--sleep 2 +--connection node_1a +--error ER_LOCK_DEADLOCK +insert into t2 select * from t1; + +--connection node_1 +--reap + +DROP TABLE t1, t2; -- cgit v1.2.1 From ad7b00fb90fc954e782eff57e54ae25fe4e439eb Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Tue, 14 Mar 2017 16:17:28 +0530 Subject: Galera MTR Tests: do not run innodb.innodb_stats_del_mark and some other tests with Galera, as it produces warnings Signed-off-by: Sachin Setiya --- mysql-test/suite/innodb/t/galera.skip | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/t/galera.skip b/mysql-test/suite/innodb/t/galera.skip index 5b6aeb13c32..fbc9e466ddb 100644 --- a/mysql-test/suite/innodb/t/galera.skip +++ b/mysql-test/suite/innodb/t/galera.skip @@ -41,4 +41,9 @@ innodb-table-online : ALTER succeeds as it is given a higher priority innodb-index-online-purge : ALTER succeeds as it is given a higher priority innodb-wl5522-debug : Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. innodb_stats_table_flag_auto_recalc : Performs multiple restarts in a row which causes '1047: Unknown command' errors +innodb-lock-inherit-read_commited : Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT +innodb-index-debug : Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT +flush-hang : Unsafe statement written to the binary log +innodb_deadlock_with_autoinc : Test uses autoinc_lock_mode = 0 +innodb_stats_del_mark : Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. -- cgit v1.2.1 From 1743d68868a1c5ddbd21c82b9e99541c08ee0361 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Tue, 14 Mar 2017 18:41:38 +0530 Subject: Fix Some failing tests Signed-off-by: Sachin Setiya --- mysql-test/suite/galera/t/MW-258.test | 1 + mysql-test/suite/galera/t/MW-313.test | 1 + mysql-test/suite/galera/t/MW-328A.test | 1 + mysql-test/suite/galera/t/MW-328B.test | 1 + mysql-test/suite/galera/t/MW-328C.test | 1 + mysql-test/suite/galera/t/MW-328D.test | 1 + mysql-test/suite/galera/t/MW-328E.test | 1 + mysql-test/suite/galera/t/MW-329.test | 1 + mysql-test/suite/galera/t/galera_var_retry_autocommit.test | 1 + 9 files changed, 9 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/t/MW-258.test b/mysql-test/suite/galera/t/MW-258.test index f5519f8a081..174dd2c02c6 100644 --- a/mysql-test/suite/galera/t/MW-258.test +++ b/mysql-test/suite/galera/t/MW-258.test @@ -34,6 +34,7 @@ UNLOCK TABLES; --connection node_1 --echo value after RSU: +--sleep 3 SHOW STATUS LIKE 'wsrep_desync_count'; SHOW VARIABLES LIKE 'wsrep_desync'; SET GLOBAL wsrep_desync=0; diff --git a/mysql-test/suite/galera/t/MW-313.test b/mysql-test/suite/galera/t/MW-313.test index d697cb2cfcd..92fd835c615 100644 --- a/mysql-test/suite/galera/t/MW-313.test +++ b/mysql-test/suite/galera/t/MW-313.test @@ -3,6 +3,7 @@ # --source include/galera_cluster.inc +--source include/have_innodb.inc --source include/have_binlog_format_row.inc # No error expected for SELECT and SHOW diff --git a/mysql-test/suite/galera/t/MW-328A.test b/mysql-test/suite/galera/t/MW-328A.test index 836dd088749..4d6e1ea3625 100644 --- a/mysql-test/suite/galera/t/MW-328A.test +++ b/mysql-test/suite/galera/t/MW-328A.test @@ -8,6 +8,7 @@ # --source include/galera_cluster.inc +--source include/have_innodb.inc --source suite/galera/t/MW-328-header.inc --connection node_2 diff --git a/mysql-test/suite/galera/t/MW-328B.test b/mysql-test/suite/galera/t/MW-328B.test index 11969dd0b47..a7b4053ab0c 100644 --- a/mysql-test/suite/galera/t/MW-328B.test +++ b/mysql-test/suite/galera/t/MW-328B.test @@ -8,6 +8,7 @@ # --source include/galera_cluster.inc +--source include/have_innodb.inc --source suite/galera/t/MW-328-header.inc --connection node_2 diff --git a/mysql-test/suite/galera/t/MW-328C.test b/mysql-test/suite/galera/t/MW-328C.test index 7241dfbdbca..b681e743ab3 100644 --- a/mysql-test/suite/galera/t/MW-328C.test +++ b/mysql-test/suite/galera/t/MW-328C.test @@ -8,6 +8,7 @@ # --source include/galera_cluster.inc +--source include/have_innodb.inc --source suite/galera/t/MW-328-header.inc --connection node_2 diff --git a/mysql-test/suite/galera/t/MW-328D.test b/mysql-test/suite/galera/t/MW-328D.test index e8a22f22a99..d5cffdb8f47 100644 --- a/mysql-test/suite/galera/t/MW-328D.test +++ b/mysql-test/suite/galera/t/MW-328D.test @@ -7,6 +7,7 @@ # --source include/galera_cluster.inc +--source include/have_innodb.inc CREATE TABLE t1 (i INT) ENGINE = InnoDB; INSERT INTO t1 (i) VALUES(1); diff --git a/mysql-test/suite/galera/t/MW-328E.test b/mysql-test/suite/galera/t/MW-328E.test index 34b17be7b08..fd4b0bf9039 100644 --- a/mysql-test/suite/galera/t/MW-328E.test +++ b/mysql-test/suite/galera/t/MW-328E.test @@ -7,6 +7,7 @@ # --source include/galera_cluster.inc +--source include/have_innodb.inc create table t1 (i int primary key, j int) engine=innodb; create table t2 (i int primary key, j int) engine=innodb; diff --git a/mysql-test/suite/galera/t/MW-329.test b/mysql-test/suite/galera/t/MW-329.test index 445f8795dff..acf6763b396 100644 --- a/mysql-test/suite/galera/t/MW-329.test +++ b/mysql-test/suite/galera/t/MW-329.test @@ -3,6 +3,7 @@ # --source include/galera_cluster.inc +--source include/have_innodb.inc CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; diff --git a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test index 6ef647b24e1..bf4da3234c5 100644 --- a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test +++ b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test @@ -4,6 +4,7 @@ # --source include/galera_cluster.inc +--source include/have_innodb.inc --connection node_1 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB; -- cgit v1.2.1 From 5bb765366710848e8cda3f7cca6bd50467b9b947 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Thu, 16 Mar 2017 02:13:31 +0530 Subject: Fix wsrep_affected_rows. The value of wsrep_affected_rows were not reseted properly for slave. Now we also wsrep_affected_rows in Xid_log_event::do_apply_event also , apart from THD::cleanup_after_query(). Signed-off-by: Sachin Setiya --- mysql-test/suite/wsrep/r/wsrep_rpl.result | 4 ++-- mysql-test/suite/wsrep/t/wsrep_rpl.test | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/wsrep/r/wsrep_rpl.result b/mysql-test/suite/wsrep/r/wsrep_rpl.result index fd792c215b3..a5db3b28ec0 100644 --- a/mysql-test/suite/wsrep/r/wsrep_rpl.result +++ b/mysql-test/suite/wsrep/r/wsrep_rpl.result @@ -5,12 +5,12 @@ include/master-slave.inc # wsrep_max_ws_rows exceeded. Error_Code 1180 # CREATE TABLE t1(i INT) ENGINE = INNODB; -SET @@GLOBAL.wsrep_max_ws_rows = 1; +SET @@GLOBAL.wsrep_max_ws_rows = 2; INSERT INTO t1 VALUES(1), (2); SELECT COUNT(*) = 2 FROM t1; COUNT(*) = 2 1 -SET @@GLOBAL.wsrep_max_ws_rows = 1; +SET @@GLOBAL.wsrep_max_ws_rows = 2; DELETE FROM t1; SELECT COUNT(*) = 0 FROM t1; COUNT(*) = 0 diff --git a/mysql-test/suite/wsrep/t/wsrep_rpl.test b/mysql-test/suite/wsrep/t/wsrep_rpl.test index 1cc7214325d..4f34aadc365 100644 --- a/mysql-test/suite/wsrep/t/wsrep_rpl.test +++ b/mysql-test/suite/wsrep/t/wsrep_rpl.test @@ -15,18 +15,13 @@ let $wsrep_max_ws_rows_slave = `SELECT @@GLOBAL.wsrep_max_ws_rows`; connection master; CREATE TABLE t1(i INT) ENGINE = INNODB; -# Setting wsrep_max_ws_rows should have no impact on replication master -# unless its a cluster node. -SET @@GLOBAL.wsrep_max_ws_rows = 1; +SET @@GLOBAL.wsrep_max_ws_rows = 2; INSERT INTO t1 VALUES(1), (2); - sync_slave_with_master; SELECT COUNT(*) = 2 FROM t1; connection slave; -# Setting wsrep_max_ws_rows should have no impact on replication slave -# unless its a cluster node. -SET @@GLOBAL.wsrep_max_ws_rows = 1; +SET @@GLOBAL.wsrep_max_ws_rows = 2; connection master; DELETE FROM t1; @@ -38,7 +33,6 @@ connection master; DROP TABLE t1; sync_slave_with_master; - # Restore wsrep_max_ws_rows on master and slave connection master; eval SET @@GLOBAL.wsrep_max_ws_rows = $wsrep_max_ws_rows_master; -- cgit v1.2.1 From c401773c8dd97bd9f6bf6cff9fcafdf24fbd0ee1 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Thu, 16 Mar 2017 08:07:58 +0530 Subject: Fix test cases Signed-off-by: Sachin Setiya --- mysql-test/suite/galera/disabled.def | 3 +++ mysql-test/suite/galera/t/galera_roles.test | 2 ++ 2 files changed, 5 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 907f7931483..0129e430ed7 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -32,3 +32,6 @@ galera_binlog_stmt_autoinc : TODO: investigate galera_concurrent_ctas : Test times out, investigate galera_sst_xtrabackup-v2-options : TODO: Fix test case mysql-wsrep#33 : TODO: investigate +GAL-480 : Investigate +galera_fk_no_pk :Investigate +galera_account_management : Investigate diff --git a/mysql-test/suite/galera/t/galera_roles.test b/mysql-test/suite/galera/t/galera_roles.test index 16e417d1fdb..eea35762539 100644 --- a/mysql-test/suite/galera/t/galera_roles.test +++ b/mysql-test/suite/galera/t/galera_roles.test @@ -36,6 +36,7 @@ GRANT SELECT (a) ON test1.t2 TO role1; --connect(foo_node_1,127.0.0.1,foo,,test,$port_1,) --let $port_2= \$NODE_MYPORT_2 +--sleep 1 --connect(foo_node_2,127.0.0.1,foo,,test,$port_2,) --echo @@ -101,6 +102,7 @@ REVOKE EXECUTE ON PROCEDURE test1.pr1 FROM role1; --echo # Connect with foo_node_1 --connection foo_node_1 +--sleep 1 --error ER_PROCACCESS_DENIED_ERROR CALL test1.pr1(); -- cgit v1.2.1 From b22026ddfd8c2b12e3793482c95c0977dd764b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 21 Mar 2017 10:00:02 +0200 Subject: Fix failure on galera_toi_drop_database test. It is assumed that both insert..select statements take so long that drop database from node2 gets to abort them both but on fast machines it was too small. Increased the size of insert. --- mysql-test/suite/galera/r/galera_toi_drop_database.result | 4 ++-- mysql-test/suite/galera/t/galera_toi_drop_database.test | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/galera_toi_drop_database.result b/mysql-test/suite/galera/r/galera_toi_drop_database.result index 8f4098419eb..d652a5154be 100644 --- a/mysql-test/suite/galera/r/galera_toi_drop_database.result +++ b/mysql-test/suite/galera/r/galera_toi_drop_database.result @@ -5,10 +5,10 @@ INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; SET SESSION wsrep_retry_autocommit = 0; -INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; +INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;; USE database1; SET SESSION wsrep_retry_autocommit = 0; -INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; +INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;; DROP DATABASE database1;; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction ERROR 40001: Deadlock found when trying to get lock; try restarting transaction diff --git a/mysql-test/suite/galera/t/galera_toi_drop_database.test b/mysql-test/suite/galera/t/galera_toi_drop_database.test index 0a37a4010ce..e790a0ba812 100644 --- a/mysql-test/suite/galera/t/galera_toi_drop_database.test +++ b/mysql-test/suite/galera/t/galera_toi_drop_database.test @@ -22,12 +22,12 @@ CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; # Make sure autocommit retrying does not kick in as this will mask the error we expect to get SET SESSION wsrep_retry_autocommit = 0; # Attemp to insert 1M rows ---send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; +--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6; --connection node_1a USE database1; SET SESSION wsrep_retry_autocommit = 0; ---send INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; +--send INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6; --connection node_2 --sleep 1 -- cgit v1.2.1 From 656d0f10e51a554ec2ff895c5e25e16a5da0d00e Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Tue, 21 Mar 2017 14:23:45 +0530 Subject: Fix galera_admin test Patch credit Jan --- mysql-test/suite/galera/t/galera_admin.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/t/galera_admin.test b/mysql-test/suite/galera/t/galera_admin.test index d62c454bdfa..e3c43256ad5 100644 --- a/mysql-test/suite/galera/t/galera_admin.test +++ b/mysql-test/suite/galera/t/galera_admin.test @@ -56,7 +56,7 @@ ANALYZE TABLE t1, t2; OPTIMIZE TABLE t1, t2; --connection node_2 ---let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' --source include/wait_condition.inc @@ -69,7 +69,7 @@ OPTIMIZE TABLE t1, t2; REPAIR TABLE x1, x2; --connection node_2 ---let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' --source include/wait_condition.inc -- cgit v1.2.1 From 4eb29ecfab1522319d5b2494f60d7279f4522314 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Wed, 22 Mar 2017 09:40:57 +0530 Subject: MDEV-12319 Test added to disabled.def --- mysql-test/suite/galera/disabled.def | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 0129e430ed7..389ed86100a 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -35,3 +35,14 @@ mysql-wsrep#33 : TODO: investigate GAL-480 : Investigate galera_fk_no_pk :Investigate galera_account_management : Investigate +galera.galera_var_retry_autocommit : MDEV-12319 #Sparodic Faliure +galera.galera_gcs_fc_limit : MDEV-12319 #Sparodic Faliure +galera.galera_toi_ddl_nonconflicting : MDEV-12319 #Sparodic Faliure +galera.mysql-wsrep#198 : MDEV-12319 #Sparodic Faliure +galera.galera_pc_ignore_sb : MDEV-12319 #Sparodic Faliure +galera.MW-329 : MDEV-12319 #Sparodic Faliure +galera.galera_ist_recv_bind : MDEV-12319 #Failed to start mysqld +galera.galera_ist_restart_joiner : MDEV-12319 #Failed to start mysqld +galera.galera_ssl_compression : MDEV-12319 #Failed to start mysqld +galera.galera_wan : MDEV-12319 #Failed to start mysqld +galera.rpl_row_annotate : MDEV-12319 #Failed to start mysqld -- cgit v1.2.1 From bb20f6d9e29f68ad8c830bf83c971d2849dac24e Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Thu, 23 Mar 2017 10:26:55 +0530 Subject: MDEV-12319 Part 2 Add more tests to disabled.diff Signed-off-by: Sachin Setiya --- mysql-test/suite/galera/disabled.def | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 389ed86100a..d96eb005eed 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -46,3 +46,5 @@ galera.galera_ist_restart_joiner : MDEV-12319 #Failed to start mysqld galera.galera_ssl_compression : MDEV-12319 #Failed to start mysqld galera.galera_wan : MDEV-12319 #Failed to start mysqld galera.rpl_row_annotate : MDEV-12319 #Failed to start mysqld +galera.MW-44 : MDEV-12319 +galera.galera_var_slave_threads : MDEV-12319 -- cgit v1.2.1 From d95dc57e751b00e1f8dc3fadaf29c3e06c499419 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Thu, 23 Mar 2017 13:18:29 +0530 Subject: Fix galera.galera_gcs_fc_limit --- mysql-test/suite/galera/t/galera_gcs_fc_limit.test | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/t/galera_gcs_fc_limit.test b/mysql-test/suite/galera/t/galera_gcs_fc_limit.test index 721d84ecb05..dc65a452d7c 100644 --- a/mysql-test/suite/galera/t/galera_gcs_fc_limit.test +++ b/mysql-test/suite/galera/t/galera_gcs_fc_limit.test @@ -19,10 +19,13 @@ SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1'; LOCK TABLE t1 WRITE; --connection node_1 - +--sleep 1 INSERT INTO t1 VALUES (2); +--sleep 1 INSERT INTO t1 VALUES (3); +--sleep 1 INSERT INTO t1 VALUES (4); +--sleep 1 # This query will hang because flow control will kick in --send -- cgit v1.2.1 From 5dca5b8007c285f893221d3cb874c8f413da8155 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 30 Mar 2017 15:02:30 +1100 Subject: MDEV-7560: check_galera_version to account for greater version than specified Signed-off-by: Daniel Black --- .../suite/wsrep/include/check_galera_version.inc | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/wsrep/include/check_galera_version.inc b/mysql-test/suite/wsrep/include/check_galera_version.inc index 38b4ada98b9..cb35269249b 100644 --- a/mysql-test/suite/wsrep/include/check_galera_version.inc +++ b/mysql-test/suite/wsrep/include/check_galera_version.inc @@ -12,11 +12,29 @@ --disable_query_log -eval SET @GALERA_VERSION=(SELECT CONCAT('$galera_version', '%')); +# Required Version -if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE - VARIABLE_NAME LIKE 'wsrep_provider_version' AND - VARIABLE_VALUE LIKE @GALERA_VERSION`) +eval SET @GALERA_VERSION='$galera_version'; +SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @GALERA_MAJOR_VERSION; +SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\2') AS UNSIGNED) INTO @GALERA_MID_VERSION; +SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\3') AS UNSIGNED) INTO @GALERA_MINOR_VERSION; + +# Actual +SELECT VARIABLE_VALUE INTO @ACTUAL_GALERA_VERSION FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_provider_version'; + +SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @ACTUAL_GALERA_MAJOR_VERSION; +SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\2') AS UNSIGNED) INTO @ACTUAL_GALERA_MID_VERSION; +SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\3') AS UNSIGNED) INTO @ACTUAL_GALERA_MINOR_VERSION; + +# For testing +#SELECT @GALERA_MAJOR_VERSION, @GALERA_MID_VERSION, @GALERA_MINOR_VERSION; +#SELECT @ACTUAL_GALERA_VERSION; +#SELECT @ACTUAL_GALERA_MAJOR_VERSION, @ACTUAL_GALERA_MID_VERSION, @ACTUAL_GALERA_MINOR_VERSION; + +if (!`SELECT (@ACTUAL_GALERA_MAJOR_VERSION > @GALERA_MAJOR_VERSION) OR + (@ACTUAL_GALERA_MAJOR_VERSION = @GALERA_MAJOR_VERSION AND @ACTUAL_GALERA_MID_VERSION > @GALERA_MID_VERSION) OR + (@ACTUAL_GALERA_MAJOR_VERSION = @GALERA_MAJOR_VERSION AND @ACTUAL_GALERA_MID_VERSION = @GALERA_MID_VERSION AND @ACTUAL_GALERA_MINOR_VERSION >= @GALERA_MINOR_VERSION) + `) { skip Test requires Galera library version $galera_version; } -- cgit v1.2.1 From a65623b3eb2695069791aa21d278b8bc751a560e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 12 May 2017 16:52:09 +0200 Subject: MDEV-11883 MariaDB crashes with out-of-memory when query information_schema CSV engine didn't expect CSM files to be read-only --- mysql-test/suite/csv/read_only.result | 30 ++++++++++++++++++++++++++++++ mysql-test/suite/csv/read_only.test | 19 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 mysql-test/suite/csv/read_only.result create mode 100644 mysql-test/suite/csv/read_only.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/csv/read_only.result b/mysql-test/suite/csv/read_only.result new file mode 100644 index 00000000000..d6936681f65 --- /dev/null +++ b/mysql-test/suite/csv/read_only.result @@ -0,0 +1,30 @@ +create table t1 (a int not null) engine=csv; +insert t1 values (1),(2); +flush tables; +select * from information_schema.tables where table_schema='test'; +TABLE_CATALOG def +TABLE_SCHEMA test +TABLE_NAME t1 +TABLE_TYPE BASE TABLE +ENGINE NULL +VERSION NULL +ROW_FORMAT NULL +TABLE_ROWS NULL +AVG_ROW_LENGTH NULL +DATA_LENGTH NULL +MAX_DATA_LENGTH NULL +INDEX_LENGTH NULL +DATA_FREE NULL +AUTO_INCREMENT NULL +CREATE_TIME NULL +UPDATE_TIME NULL +CHECK_TIME NULL +TABLE_COLLATION NULL +CHECKSUM NULL +CREATE_OPTIONS NULL +TABLE_COMMENT File './test/t1.CSM' not found (Errcode: 13 "Permission denied") +Warnings: +Level Warning +Code 29 +Message File './test/t1.CSM' not found (Errcode: 13 "Permission denied") +drop table t1; diff --git a/mysql-test/suite/csv/read_only.test b/mysql-test/suite/csv/read_only.test new file mode 100644 index 00000000000..2af209182d0 --- /dev/null +++ b/mysql-test/suite/csv/read_only.test @@ -0,0 +1,19 @@ +# +# MDEV-11883 MariaDB crashes with out-of-memory when query information_schema +# +source include/have_csv.inc; + +let datadir=`select @@datadir`; + +create table t1 (a int not null) engine=csv; +insert t1 values (1),(2); +flush tables; + +chmod 0400 $datadir/test/t1.CSM; +chmod 0400 $datadir/test/t1.CSV; + +--replace_result $datadir ./ +query_vertical select * from information_schema.tables where table_schema='test'; + +drop table t1; + -- cgit v1.2.1 From 24ff1793114fa9f15d493c26d879000307e6f00d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Tue, 16 May 2017 13:53:15 +0300 Subject: 5.6.36 --- .../suite/perfschema/r/start_server_1_digest.result | 7 +++++++ .../suite/perfschema/t/start_server_1_digest-master.opt | 1 + mysql-test/suite/perfschema/t/start_server_1_digest.test | 15 +++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 mysql-test/suite/perfschema/r/start_server_1_digest.result create mode 100644 mysql-test/suite/perfschema/t/start_server_1_digest-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_1_digest.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/perfschema/r/start_server_1_digest.result b/mysql-test/suite/perfschema/r/start_server_1_digest.result new file mode 100644 index 00000000000..cf07022d344 --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_1_digest.result @@ -0,0 +1,7 @@ +SELECT "Digest table has a size 1 and is full already." as use_case; +use_case +Digest table has a size 1 and is full already. +select SCHEMA_NAME, DIGEST, DIGEST_TEXT +from performance_schema.events_statements_summary_by_digest; +SCHEMA_NAME DIGEST DIGEST_TEXT +NULL NULL NULL diff --git a/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt b/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt new file mode 100644 index 00000000000..e59be3eb02f --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt @@ -0,0 +1 @@ +--performance-schema-digests-size=1 diff --git a/mysql-test/suite/perfschema/t/start_server_1_digest.test b/mysql-test/suite/perfschema/t/start_server_1_digest.test new file mode 100644 index 00000000000..998d9a5eebe --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_1_digest.test @@ -0,0 +1,15 @@ +# ----------------------------------------------------------------------- +# Tests for the performance schema statement Digests. +# ----------------------------------------------------------------------- + +--source include/not_embedded.inc +--source include/have_perfschema.inc +--source include/no_protocol.inc + +SELECT "Digest table has a size 1 and is full already." as use_case; + +select SCHEMA_NAME, DIGEST, DIGEST_TEXT + from performance_schema.events_statements_summary_by_digest; + + + -- cgit v1.2.1 From f7dab76aa286560d167c666e058a494e93c04da5 Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 17 May 2017 00:00:27 +0300 Subject: MDEV-12756 rpl.rpl_killed_ddl fails in buildbot with 'Can't find record' The issue was that my_errno was not set properly when a repair was killed, which confused the rpl_killed_ddl script. I also added an extra test line in varchar.inc to ensure we don't give duplicate error rows. --- mysql-test/suite/innodb/r/innodb.result | 3 +++ mysql-test/suite/maria/maria.result | 3 +++ 2 files changed, 6 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index 2ce73304281..8e0e6d5b512 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -1917,6 +1917,9 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 13 const # Using where; Using index alter table t1 add unique(v); ERROR 23000: Duplicate entry '{ ' for key 'v_2' +show warnings; +Level Code Message +Error 1062 Duplicate entry 'v' for key 'v_2' alter table t1 add key(v); Warnings: Note 1831 Duplicate index `v_2`. This is deprecated and will be disallowed in a future release diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result index 04b042059fb..88f39827f27 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -1145,6 +1145,9 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 13 const # Using where; Using index alter table t1 add unique(v); ERROR 23000: Duplicate entry '{ ' for key 'v_2' +show warnings; +Level Code Message +Error 1062 Duplicate entry 'a' for key 'v_2' alter table t1 add key(v); Warnings: Note 1831 Duplicate index `v_2`. This is deprecated and will be disallowed in a future release -- cgit v1.2.1 From 5fe55b1b0251a894d87488d7dc973b044af12736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Wed, 17 May 2017 15:44:11 +0300 Subject: Fix sys_vars innodb_empty_free_list_algorithm_basic Post xtradb 5.6.36 merge the output has changed. --- .../suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result b/mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result index f95553e3fa2..771c6e917ac 100644 --- a/mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result @@ -1,7 +1,7 @@ SET @start_value = @@GLOBAL.innodb_empty_free_list_algorithm; SELECT @@GLOBAL.innodb_empty_free_list_algorithm; @@GLOBAL.innodb_empty_free_list_algorithm -backoff +legacy SELECT @@SESSION.innodb_empty_free_list_algorithm; ERROR HY000: Variable 'innodb_empty_free_list_algorithm' is a GLOBAL variable SET GLOBAL innodb_empty_free_list_algorithm='legacy'; -- cgit v1.2.1 From f302a3cf9d9de48cae660641ec9695412f74b80e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Fri, 28 Apr 2017 10:07:03 +0300 Subject: MDEV-12593: InnoDB page compression should use lz4_compress_default if available lz4.cmake: Check if shared or static lz4 library has LZ4_compress_default function and if it has define HAVE_LZ4_COMPRESS_DEFAULT. fil_compress_page: If HAVE_LZ4_COMPRESS_DEFAULT is defined use LZ4_compress_default function for compression if not use LZ4_compress_limitedOutput function. Introduced a innodb-page-compression.inc file for page compression tests that will also search .ibd file to verify that pages are compressed (i.e. used search string is not found). Modified page compression tests to use this file. Note that snappy method is not included because of MDEV-12615 InnoDB page compression method snappy mostly does not compress pages that will be fixed on different commit. --- .../innodb/include/innodb-page-compression.inc | 131 ++++++ .../innodb/r/innodb-page_compression_bzip2.result | 489 ++++---------------- .../r/innodb-page_compression_default.result | 118 ++++- .../innodb/r/innodb-page_compression_lz4.result | 490 ++++----------------- .../innodb/r/innodb-page_compression_lzma.result | 489 ++++---------------- .../innodb/r/innodb-page_compression_lzo.result | 403 ++++------------- .../innodb/r/innodb-page_compression_zip.result | 405 ++++------------- .../innodb/t/innodb-page_compression_bzip2.test | 249 +---------- .../innodb/t/innodb-page_compression_default.test | 51 +-- .../innodb/t/innodb-page_compression_lz4.test | 251 +---------- .../innodb/t/innodb-page_compression_lzma.test | 249 +---------- .../innodb/t/innodb-page_compression_lzo.test | 203 +-------- .../innodb/t/innodb-page_compression_zip.test | 203 +-------- 13 files changed, 632 insertions(+), 3099 deletions(-) create mode 100644 mysql-test/suite/innodb/include/innodb-page-compression.inc (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/include/innodb-page-compression.inc b/mysql-test/suite/innodb/include/innodb-page-compression.inc new file mode 100644 index 00000000000..3acbeaf0988 --- /dev/null +++ b/mysql-test/suite/innodb/include/innodb-page-compression.inc @@ -0,0 +1,131 @@ +--disable_warnings +set global innodb_file_format = `Barracuda`; +set global innodb_file_per_table = on; +--enable_warnings + +create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; + +--disable_query_log +begin; +let $i = 2000; +while ($i) +{ + insert into innodb_normal(b) values(REPEAT('Aa',50)); + insert into innodb_normal(b) values(REPEAT('a',100)); + insert into innodb_normal(b) values(REPEAT('b',100)); + insert into innodb_normal(b) values(REPEAT('0',100)); + insert into innodb_normal(b) values(REPEAT('1',100)); + dec $i; +} + +insert into innodb_page_compressed1 select * from innodb_normal; +insert into innodb_page_compressed2 select * from innodb_normal; +insert into innodb_page_compressed3 select * from innodb_normal; +insert into innodb_page_compressed4 select * from innodb_normal; +insert into innodb_page_compressed5 select * from innodb_normal; +insert into innodb_page_compressed6 select * from innodb_normal; +insert into innodb_page_compressed7 select * from innodb_normal; +insert into innodb_page_compressed8 select * from innodb_normal; +insert into innodb_page_compressed9 select * from innodb_normal; +commit; +--enable_query_log + +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed3; +select count(*) from innodb_page_compressed4; +select count(*) from innodb_page_compressed5; +select count(*) from innodb_page_compressed6; +select count(*) from innodb_page_compressed6; +select count(*) from innodb_page_compressed7; +select count(*) from innodb_page_compressed8; +select count(*) from innodb_page_compressed9; + +# +# Wait until pages are really compressed +# +let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_COMPRESSED'; +--source include/wait_condition.inc + +--let $MYSQLD_DATADIR=`select @@datadir` + +# shutdown before grep + +--source include/shutdown_mysqld.inc + +--let t1_IBD = $MYSQLD_DATADIR/test/innodb_normal.ibd +--let SEARCH_RANGE = 10000000 +--let SEARCH_PATTERN=AaAaAaAa +--echo # innodb_normal expected FOUND +-- let SEARCH_FILE=$t1_IBD +-- source include/search_pattern_in_file.inc +--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed1.ibd +--echo # innodb_page_compressed1 page compressed expected NOT FOUND +-- let SEARCH_FILE=$t1_IBD +-- source include/search_pattern_in_file.inc +--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed2.ibd +--echo # innodb_page_compressed2 page compressed expected NOT FOUND +-- let SEARCH_FILE=$t1_IBD +-- source include/search_pattern_in_file.inc +--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed3.ibd +--echo # innodb_page_compressed3 page compressed expected NOT FOUND +-- let SEARCH_FILE=$t1_IBD +-- source include/search_pattern_in_file.inc +--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed4.ibd +--echo # innodb_page_compressed4 page compressed expected NOT FOUND +-- let SEARCH_FILE=$t1_IBD +-- source include/search_pattern_in_file.inc +--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed5.ibd +--echo # innodb_page_compressed5 page compressed expected NOT FOUND +-- let SEARCH_FILE=$t1_IBD +-- source include/search_pattern_in_file.inc +--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed6.ibd +--echo # innodb_page_compressed6 page compressed expected NOT FOUND +-- let SEARCH_FILE=$t1_IBD +-- source include/search_pattern_in_file.inc +--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed7.ibd +--echo # innodb_page_compressed7 page compressed expected NOT FOUND +-- let SEARCH_FILE=$t1_IBD +-- source include/search_pattern_in_file.inc +--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed8.ibd +--echo # innodb_page_compressed8 page compressed expected NOT FOUND +-- let SEARCH_FILE=$t1_IBD +-- source include/search_pattern_in_file.inc +--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed9.ibd +--echo # innodb_page_compressed9 page compressed expected NOT FOUND +-- let SEARCH_FILE=$t1_IBD +-- source include/search_pattern_in_file.inc + +-- source include/start_mysqld.inc + +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed3; +select count(*) from innodb_page_compressed4; +select count(*) from innodb_page_compressed5; +select count(*) from innodb_page_compressed6; +select count(*) from innodb_page_compressed6; +select count(*) from innodb_page_compressed7; +select count(*) from innodb_page_compressed8; +select count(*) from innodb_page_compressed9; + +let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_DECOMPRESSED'; +--source include/wait_condition.inc + +drop table innodb_normal; +drop table innodb_page_compressed1; +drop table innodb_page_compressed2; +drop table innodb_page_compressed3; +drop table innodb_page_compressed4; +drop table innodb_page_compressed5; +drop table innodb_page_compressed6; +drop table innodb_page_compressed7; +drop table innodb_page_compressed8; +drop table innodb_page_compressed9; diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result index 8d3bc063a71..3a3d6f92cac 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result @@ -1,431 +1,91 @@ -set global innodb_file_format = `barracuda`; +set global innodb_compression_algorithm = bzip2; +set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; -set global innodb_compression_algorithm = 5; -create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8; -show warnings; -Level Code Message -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -Level Code Message -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -Level Code Message -show create table innodb_page_compressed1; -Table Create Table -innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1 -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -Level Code Message -show create table innodb_page_compressed2; -Table Create Table -innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2 -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -Level Code Message -show create table innodb_page_compressed3; -Table Create Table -innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3 -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -Level Code Message -show create table innodb_page_compressed4; -Table Create Table -innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4 -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -Level Code Message -show create table innodb_page_compressed5; -Table Create Table -innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5 -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -Level Code Message -show create table innodb_page_compressed6; -Table Create Table -innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6 -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -Level Code Message -show create table innodb_page_compressed7; -Table Create Table -innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7 -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_page_compressed8; -Table Create Table -innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -Level Code Message -show create table innodb_page_compressed9; -Table Create Table -innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9 -create procedure innodb_insert_proc (repeat_count int) -begin -declare current_num int; -set current_num = 0; -while current_num < repeat_count do -insert into innodb_normal values(current_num,'testing..'); -set current_num = current_num + 1; -end while; -end// -commit; -set autocommit=0; -call innodb_insert_proc(5000); -commit; -set autocommit=1; -select count(*) from innodb_normal; -count(*) -5000 -insert into innodb_compressed select * from innodb_normal; -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_compressed; -count(*) -5000 +create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; select count(*) from innodb_page_compressed1; count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -alter table innodb_normal page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_normal; -Table Create Table -innodb_normal CREATE TABLE `innodb_normal` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0; -show warnings; -Level Code Message -show create table innodb_compressed; -Table Create Table -innodb_compressed CREATE TABLE `innodb_compressed` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 +10000 +select count(*) from innodb_page_compressed3; +count(*) +10000 +select count(*) from innodb_page_compressed4; +count(*) +10000 +select count(*) from innodb_page_compressed5; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed7; +count(*) +10000 +select count(*) from innodb_page_compressed8; +count(*) +10000 +select count(*) from innodb_page_compressed9; +count(*) +10000 +# innodb_normal expected FOUND +FOUND /AaAaAaAa/ in innodb_normal.ibd +# innodb_page_compressed1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd +# innodb_page_compressed2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd +# innodb_page_compressed3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd +# innodb_page_compressed4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd +# innodb_page_compressed5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd +# innodb_page_compressed6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd +# innodb_page_compressed7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd +# innodb_page_compressed8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd +# innodb_page_compressed9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd select count(*) from innodb_page_compressed1; count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -set global innodb_compression_algorithm = 1; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -set global innodb_compression_algorithm = 0; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed3; count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed4; count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed5; count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed6; count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed6; count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed7; count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed8; count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed9; count(*) -5000 -drop procedure innodb_insert_proc; +10000 drop table innodb_normal; -drop table innodb_compressed; drop table innodb_page_compressed1; drop table innodb_page_compressed2; drop table innodb_page_compressed3; @@ -435,3 +95,4 @@ drop table innodb_page_compressed6; drop table innodb_page_compressed7; drop table innodb_page_compressed8; drop table innodb_page_compressed9; +#done diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_default.result b/mysql-test/suite/innodb/r/innodb-page_compression_default.result index 10e1d6c766c..18f7fb5e04a 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_default.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_default.result @@ -1,20 +1,98 @@ -SET GLOBAL innodb_file_format = `Barracuda`; -SET GLOBAL innodb_file_per_table = ON; -create table t1 (c1 int not null primary key auto_increment, b char(200)) engine=innodb page_compressed=1; -insert into t1 values(NULL,'compressed_text_aaaaaaaaabbbbbbbbbbbbbccccccccccccc'); -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -# t1 compressed expected NOT FOUND -NOT FOUND /compressed_text/ in t1.ibd -drop table t1; +call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+."); +set global innodb_file_format = `Barracuda`; +set global innodb_file_per_table = on; +create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; +select count(*) from innodb_page_compressed1; +count(*) +10000 +select count(*) from innodb_page_compressed3; +count(*) +10000 +select count(*) from innodb_page_compressed4; +count(*) +10000 +select count(*) from innodb_page_compressed5; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed7; +count(*) +10000 +select count(*) from innodb_page_compressed8; +count(*) +10000 +select count(*) from innodb_page_compressed9; +count(*) +10000 +# innodb_normal expected FOUND +FOUND /AaAaAaAa/ in innodb_normal.ibd +# innodb_page_compressed1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd +# innodb_page_compressed2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd +# innodb_page_compressed3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd +# innodb_page_compressed4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd +# innodb_page_compressed5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd +# innodb_page_compressed6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd +# innodb_page_compressed7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd +# innodb_page_compressed8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd +# innodb_page_compressed9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd +select count(*) from innodb_page_compressed1; +count(*) +10000 +select count(*) from innodb_page_compressed3; +count(*) +10000 +select count(*) from innodb_page_compressed4; +count(*) +10000 +select count(*) from innodb_page_compressed5; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed7; +count(*) +10000 +select count(*) from innodb_page_compressed8; +count(*) +10000 +select count(*) from innodb_page_compressed9; +count(*) +10000 +drop table innodb_normal; +drop table innodb_page_compressed1; +drop table innodb_page_compressed2; +drop table innodb_page_compressed3; +drop table innodb_page_compressed4; +drop table innodb_page_compressed5; +drop table innodb_page_compressed6; +drop table innodb_page_compressed7; +drop table innodb_page_compressed8; +drop table innodb_page_compressed9; +#done diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result index eeab2622cb6..d60eb62ec15 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result @@ -1,432 +1,91 @@ -set global innodb_file_format = `barracuda`; +set global innodb_compression_algorithm = lz4; +set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; -set global innodb_compression_algorithm = 2; -create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8; -show warnings; -Level Code Message -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -Level Code Message -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -Level Code Message -show create table innodb_page_compressed1; -Table Create Table -innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1 -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -Level Code Message -show create table innodb_page_compressed2; -Table Create Table -innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2 -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -Level Code Message -show create table innodb_page_compressed3; -Table Create Table -innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3 -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -Level Code Message -show create table innodb_page_compressed4; -Table Create Table -innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4 -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -Level Code Message -show create table innodb_page_compressed5; -Table Create Table -innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5 -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -Level Code Message -show create table innodb_page_compressed6; -Table Create Table -innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6 -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -Level Code Message -show create table innodb_page_compressed7; -Table Create Table -innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7 -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_page_compressed8; -Table Create Table -innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -Level Code Message -show create table innodb_page_compressed9; -Table Create Table -innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9 -create procedure innodb_insert_proc (repeat_count int) -begin -declare current_num int; -set current_num = 0; -while current_num < repeat_count do -insert into innodb_normal values(current_num,'testing..'); -set current_num = current_num + 1; -end while; -end// -commit; -set autocommit=0; -call innodb_insert_proc(5000); -commit; -set autocommit=1; -select count(*) from innodb_normal; -count(*) -5000 -insert into innodb_compressed select * from innodb_normal; -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_compressed; -count(*) -5000 +create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; select count(*) from innodb_page_compressed1; count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -alter table innodb_normal page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_normal; -Table Create Table -innodb_normal CREATE TABLE `innodb_normal` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0; -show warnings; -Level Code Message -show create table innodb_compressed; -Table Create Table -innodb_compressed CREATE TABLE `innodb_compressed` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -count(*) -5000 +10000 +select count(*) from innodb_page_compressed3; +count(*) +10000 +select count(*) from innodb_page_compressed4; +count(*) +10000 +select count(*) from innodb_page_compressed5; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed7; +count(*) +10000 +select count(*) from innodb_page_compressed8; +count(*) +10000 +select count(*) from innodb_page_compressed9; +count(*) +10000 +# innodb_normal expected FOUND +FOUND /AaAaAaAa/ in innodb_normal.ibd +# innodb_page_compressed1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd +# innodb_page_compressed2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd +# innodb_page_compressed3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd +# innodb_page_compressed4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd +# innodb_page_compressed5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd +# innodb_page_compressed6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd +# innodb_page_compressed7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd +# innodb_page_compressed8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd +# innodb_page_compressed9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd select count(*) from innodb_page_compressed1; count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -set global innodb_compression_algorithm = 1; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -set global innodb_compression_algorithm = 0; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed3; count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed4; count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed5; count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed6; count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed6; count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed7; count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed8; count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed9; count(*) -5000 -drop procedure innodb_insert_proc; +10000 drop table innodb_normal; -drop table innodb_compressed; drop table innodb_page_compressed1; drop table innodb_page_compressed2; drop table innodb_page_compressed3; @@ -436,3 +95,4 @@ drop table innodb_page_compressed6; drop table innodb_page_compressed7; drop table innodb_page_compressed8; drop table innodb_page_compressed9; +#done diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result index d340801b656..b3cc9c9b627 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result @@ -1,431 +1,91 @@ -set global innodb_file_format = `barracuda`; +set global innodb_compression_algorithm = lzma; +set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; -set global innodb_compression_algorithm = 4; -create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8; -show warnings; -Level Code Message -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -Level Code Message -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -Level Code Message -show create table innodb_page_compressed1; -Table Create Table -innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1 -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -Level Code Message -show create table innodb_page_compressed2; -Table Create Table -innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2 -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -Level Code Message -show create table innodb_page_compressed3; -Table Create Table -innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3 -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -Level Code Message -show create table innodb_page_compressed4; -Table Create Table -innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4 -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -Level Code Message -show create table innodb_page_compressed5; -Table Create Table -innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5 -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -Level Code Message -show create table innodb_page_compressed6; -Table Create Table -innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6 -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -Level Code Message -show create table innodb_page_compressed7; -Table Create Table -innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7 -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_page_compressed8; -Table Create Table -innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -Level Code Message -show create table innodb_page_compressed9; -Table Create Table -innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9 -create procedure innodb_insert_proc (repeat_count int) -begin -declare current_num int; -set current_num = 0; -while current_num < repeat_count do -insert into innodb_normal values(current_num,'testing..'); -set current_num = current_num + 1; -end while; -end// -commit; -set autocommit=0; -call innodb_insert_proc(5000); -commit; -set autocommit=1; -select count(*) from innodb_normal; -count(*) -5000 -insert into innodb_compressed select * from innodb_normal; -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_compressed; -count(*) -5000 +create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; select count(*) from innodb_page_compressed1; count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -alter table innodb_normal page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_normal; -Table Create Table -innodb_normal CREATE TABLE `innodb_normal` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0; -show warnings; -Level Code Message -show create table innodb_compressed; -Table Create Table -innodb_compressed CREATE TABLE `innodb_compressed` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 +10000 +select count(*) from innodb_page_compressed3; +count(*) +10000 +select count(*) from innodb_page_compressed4; +count(*) +10000 +select count(*) from innodb_page_compressed5; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed7; +count(*) +10000 +select count(*) from innodb_page_compressed8; +count(*) +10000 +select count(*) from innodb_page_compressed9; +count(*) +10000 +# innodb_normal expected FOUND +FOUND /AaAaAaAa/ in innodb_normal.ibd +# innodb_page_compressed1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd +# innodb_page_compressed2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd +# innodb_page_compressed3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd +# innodb_page_compressed4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd +# innodb_page_compressed5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd +# innodb_page_compressed6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd +# innodb_page_compressed7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd +# innodb_page_compressed8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd +# innodb_page_compressed9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd select count(*) from innodb_page_compressed1; count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -set global innodb_compression_algorithm = 1; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -set global innodb_compression_algorithm = 0; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed3; count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed4; count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed5; count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed6; count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed6; count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed7; count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed8; count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed9; count(*) -5000 -drop procedure innodb_insert_proc; +10000 drop table innodb_normal; -drop table innodb_compressed; drop table innodb_page_compressed1; drop table innodb_page_compressed2; drop table innodb_page_compressed3; @@ -435,3 +95,4 @@ drop table innodb_page_compressed6; drop table innodb_page_compressed7; drop table innodb_page_compressed8; drop table innodb_page_compressed9; +#done diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result index fdbc99f60d9..b6c5bc32bb7 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result @@ -1,345 +1,91 @@ -set global innodb_file_format = `barracuda`; +set global innodb_compression_algorithm = lzo; +set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; -set global innodb_compression_algorithm = 3; -create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8; -show warnings; -Level Code Message -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -Level Code Message -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -Level Code Message -show create table innodb_page_compressed1; -Table Create Table -innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1 -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -Level Code Message -show create table innodb_page_compressed2; -Table Create Table -innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2 -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -Level Code Message -show create table innodb_page_compressed3; -Table Create Table -innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3 -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -Level Code Message -show create table innodb_page_compressed4; -Table Create Table -innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4 -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -Level Code Message -show create table innodb_page_compressed5; -Table Create Table -innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5 -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -Level Code Message -show create table innodb_page_compressed6; -Table Create Table -innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6 -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -Level Code Message -show create table innodb_page_compressed7; -Table Create Table -innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7 -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_page_compressed8; -Table Create Table -innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -Level Code Message -show create table innodb_page_compressed9; -Table Create Table -innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9 -create procedure innodb_insert_proc (repeat_count int) -begin -declare current_num int; -set current_num = 0; -while current_num < repeat_count do -insert into innodb_normal values(current_num,'testing..'); -set current_num = current_num + 1; -end while; -end// -commit; -set autocommit=0; -call innodb_insert_proc(5000); -commit; -set autocommit=1; -select count(*) from innodb_normal; -count(*) -5000 -insert into innodb_compressed select * from innodb_normal; -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_compressed; -count(*) -5000 +create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; select count(*) from innodb_page_compressed1; count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -alter table innodb_normal page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_normal; -Table Create Table -innodb_normal CREATE TABLE `innodb_normal` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0; -show warnings; -Level Code Message -show create table innodb_compressed; -Table Create Table -innodb_compressed CREATE TABLE `innodb_compressed` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 +10000 +select count(*) from innodb_page_compressed3; +count(*) +10000 +select count(*) from innodb_page_compressed4; +count(*) +10000 +select count(*) from innodb_page_compressed5; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed7; +count(*) +10000 +select count(*) from innodb_page_compressed8; +count(*) +10000 +select count(*) from innodb_page_compressed9; +count(*) +10000 +# innodb_normal expected FOUND +FOUND /AaAaAaAa/ in innodb_normal.ibd +# innodb_page_compressed1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd +# innodb_page_compressed2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd +# innodb_page_compressed3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd +# innodb_page_compressed4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd +# innodb_page_compressed5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd +# innodb_page_compressed6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd +# innodb_page_compressed7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd +# innodb_page_compressed8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd +# innodb_page_compressed9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd select count(*) from innodb_page_compressed1; count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -set global innodb_compression_algorithm = 1; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed3; count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed4; count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed5; count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed6; count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed6; count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed7; count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed8; count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed9; count(*) -5000 -drop procedure innodb_insert_proc; +10000 drop table innodb_normal; -drop table innodb_compressed; drop table innodb_page_compressed1; drop table innodb_page_compressed2; drop table innodb_page_compressed3; @@ -349,3 +95,4 @@ drop table innodb_page_compressed6; drop table innodb_page_compressed7; drop table innodb_page_compressed8; drop table innodb_page_compressed9; +#done diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_zip.result b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result index 4c3ab273b2e..3644890f921 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_zip.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result @@ -1,345 +1,91 @@ -SET GLOBAL innodb_file_format = `Barracuda`; -SET GLOBAL innodb_file_per_table = ON; -set global innodb_compression_algorithm = 1; -create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8; -show warnings; -Level Code Message -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -Level Code Message -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -Level Code Message -show create table innodb_page_compressed1; -Table Create Table -innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1 -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -Level Code Message -show create table innodb_page_compressed2; -Table Create Table -innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2 -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -Level Code Message -show create table innodb_page_compressed3; -Table Create Table -innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3 -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -Level Code Message -show create table innodb_page_compressed4; -Table Create Table -innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4 -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -Level Code Message -show create table innodb_page_compressed5; -Table Create Table -innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5 -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -Level Code Message -show create table innodb_page_compressed6; -Table Create Table -innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6 -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -Level Code Message -show create table innodb_page_compressed7; -Table Create Table -innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7 -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_page_compressed8; -Table Create Table -innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -Level Code Message -show create table innodb_page_compressed9; -Table Create Table -innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9 -create procedure innodb_insert_proc (repeat_count int) -begin -declare current_num int; -set current_num = 0; -while current_num < repeat_count do -insert into innodb_normal values(current_num,'testing..'); -set current_num = current_num + 1; -end while; -end// -commit; -set autocommit=0; -call innodb_insert_proc(5000); -commit; -set autocommit=1; -select count(*) from innodb_normal; -count(*) -5000 -insert into innodb_compressed select * from innodb_normal; -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_compressed; -count(*) -5000 +set global innodb_compression_algorithm = zlib; +set global innodb_file_format = `Barracuda`; +set global innodb_file_per_table = on; +create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; select count(*) from innodb_page_compressed1; count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -alter table innodb_normal page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_normal; -Table Create Table -innodb_normal CREATE TABLE `innodb_normal` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0; -show warnings; -Level Code Message -show create table innodb_compressed; -Table Create Table -innodb_compressed CREATE TABLE `innodb_compressed` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 +10000 +select count(*) from innodb_page_compressed3; +count(*) +10000 +select count(*) from innodb_page_compressed4; +count(*) +10000 +select count(*) from innodb_page_compressed5; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed7; +count(*) +10000 +select count(*) from innodb_page_compressed8; +count(*) +10000 +select count(*) from innodb_page_compressed9; +count(*) +10000 +# innodb_normal expected FOUND +FOUND /AaAaAaAa/ in innodb_normal.ibd +# innodb_page_compressed1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd +# innodb_page_compressed2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd +# innodb_page_compressed3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd +# innodb_page_compressed4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd +# innodb_page_compressed5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd +# innodb_page_compressed6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd +# innodb_page_compressed7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd +# innodb_page_compressed8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd +# innodb_page_compressed9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd select count(*) from innodb_page_compressed1; count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -set global innodb_compression_algorithm = 0; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed3; count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed4; count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed5; count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed6; count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed6; count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed7; count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed8; count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed9; count(*) -5000 -drop procedure innodb_insert_proc; +10000 drop table innodb_normal; -drop table innodb_compressed; drop table innodb_page_compressed1; drop table innodb_page_compressed2; drop table innodb_page_compressed3; @@ -349,3 +95,4 @@ drop table innodb_page_compressed6; drop table innodb_page_compressed7; drop table innodb_page_compressed8; drop table innodb_page_compressed9; +#done diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test index 51493266a60..8c4cee14453 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test @@ -2,251 +2,10 @@ -- source include/have_innodb_bzip2.inc -- source include/not_embedded.inc ---disable_query_log -let $innodb_compression_algorithm_orig=`select @@innodb_compression_algorithm`; -let $innodb_file_format_orig = `select @@innodb_file_format`; -let $innodb_file_per_table_orig = `select @@innodb_file_per_table`; ---enable_query_log - -set global innodb_file_format = `barracuda`; -set global innodb_file_per_table = on; - # bzip2 -set global innodb_compression_algorithm = 5; - -create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8; -show warnings; -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -show create table innodb_page_compressed1; -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -show create table innodb_page_compressed2; -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -show create table innodb_page_compressed3; -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -show create table innodb_page_compressed4; -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -show create table innodb_page_compressed5; -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -show create table innodb_page_compressed6; -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -show create table innodb_page_compressed7; -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_page_compressed8; -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -show create table innodb_page_compressed9; -delimiter //; -create procedure innodb_insert_proc (repeat_count int) -begin - declare current_num int; - set current_num = 0; - while current_num < repeat_count do - insert into innodb_normal values(current_num,'testing..'); - set current_num = current_num + 1; - end while; -end// -delimiter ;// -commit; - -set autocommit=0; -call innodb_insert_proc(5000); -commit; -set autocommit=1; -select count(*) from innodb_normal; -insert into innodb_compressed select * from innodb_normal; -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -alter table innodb_normal page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_normal; -alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0; -show warnings; -show create table innodb_compressed; - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -# zlib -set global innodb_compression_algorithm = 1; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -# none -set global innodb_compression_algorithm = 0; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; +set global innodb_compression_algorithm = bzip2; -drop procedure innodb_insert_proc; -drop table innodb_normal; -drop table innodb_compressed; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; +# All page compression test use the same +--source include/innodb-page-compression.inc -# reset system ---disable_query_log -EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; -EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; -EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; ---enable_query_log +-- echo #done diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_default.test b/mysql-test/suite/innodb/t/innodb-page_compression_default.test index 28f184c278c..1cc6c917548 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_default.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_default.test @@ -1,51 +1,10 @@ --source include/have_innodb.inc +--source include/not_embedded.inc ---disable_query_log -let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`; -let $innodb_file_format_orig = `SELECT @@innodb_file_format`; -let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; ---enable_query_log +call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+."); ---disable_warnings -SET GLOBAL innodb_file_format = `Barracuda`; -SET GLOBAL innodb_file_per_table = ON; ---enable_warnings +# All page compression test use the same +--source include/innodb-page-compression.inc -create table t1 (c1 int not null primary key auto_increment, b char(200)) engine=innodb page_compressed=1; -insert into t1 values(NULL,'compressed_text_aaaaaaaaabbbbbbbbbbbbbccccccccccccc'); -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; -insert into t1(b) select b from t1; +-- echo #done -let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_COMPRESSED'; ---source include/wait_condition.inc - ---let $MYSQLD_DATADIR=`select @@datadir` ---let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd ---let SEARCH_RANGE = 10000000 ---let SEARCH_PATTERN=compressed_text - ---echo # t1 compressed expected NOT FOUND --- let SEARCH_FILE=$t1_IBD --- source include/search_pattern_in_file.inc - -drop table t1; - -# reset system ---disable_query_log ---disable_warnings -EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; -EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; -EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; ---enable_warnings ---enable_query_log diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test index f36ea9684e9..9d6e2babbe7 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test @@ -1,253 +1,12 @@ -- source include/have_innodb.inc -- source include/have_innodb_lz4.inc +# disable embedded as it does not support restart -- source include/not_embedded.inc ---disable_query_log -let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`; -let $innodb_file_format_orig = `SELECT @@innodb_file_format`; -let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; ---enable_query_log - -set global innodb_file_format = `barracuda`; -set global innodb_file_per_table = on; - # lz4 -set global innodb_compression_algorithm = 2; - -create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8; -show warnings; -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -show create table innodb_page_compressed1; -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -show create table innodb_page_compressed2; -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -show create table innodb_page_compressed3; -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -show create table innodb_page_compressed4; -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -show create table innodb_page_compressed5; -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -show create table innodb_page_compressed6; -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -show create table innodb_page_compressed7; -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_page_compressed8; -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -show create table innodb_page_compressed9; -delimiter //; -create procedure innodb_insert_proc (repeat_count int) -begin - declare current_num int; - set current_num = 0; - while current_num < repeat_count do - insert into innodb_normal values(current_num,'testing..'); - set current_num = current_num + 1; - end while; -end// -delimiter ;// -commit; - -set autocommit=0; -call innodb_insert_proc(5000); -commit; -set autocommit=1; -select count(*) from innodb_normal; -insert into innodb_compressed select * from innodb_normal; -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -alter table innodb_normal page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_normal; -alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0; -show warnings; -show create table innodb_compressed; - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -# zlib -set global innodb_compression_algorithm = 1; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -# none -set global innodb_compression_algorithm = 0; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; +set global innodb_compression_algorithm = lz4; -drop procedure innodb_insert_proc; -drop table innodb_normal; -drop table innodb_compressed; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; +# All page compression test use the same +--source include/innodb-page-compression.inc -# reset system ---disable_query_log -EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; -EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; -EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; ---enable_query_log +-- echo #done diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test b/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test index 6ea686bca04..0b97c1578c6 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test @@ -2,251 +2,10 @@ -- source include/have_innodb_lzma.inc -- source include/not_embedded.inc ---disable_query_log -let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`; -let $innodb_file_format_orig = `SELECT @@innodb_file_format`; -let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; ---enable_query_log - -set global innodb_file_format = `barracuda`; -set global innodb_file_per_table = on; - # lzma -set global innodb_compression_algorithm = 4; - -create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8; -show warnings; -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -show create table innodb_page_compressed1; -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -show create table innodb_page_compressed2; -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -show create table innodb_page_compressed3; -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -show create table innodb_page_compressed4; -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -show create table innodb_page_compressed5; -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -show create table innodb_page_compressed6; -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -show create table innodb_page_compressed7; -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_page_compressed8; -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -show create table innodb_page_compressed9; -delimiter //; -create procedure innodb_insert_proc (repeat_count int) -begin - declare current_num int; - set current_num = 0; - while current_num < repeat_count do - insert into innodb_normal values(current_num,'testing..'); - set current_num = current_num + 1; - end while; -end// -delimiter ;// -commit; - -set autocommit=0; -call innodb_insert_proc(5000); -commit; -set autocommit=1; -select count(*) from innodb_normal; -insert into innodb_compressed select * from innodb_normal; -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -alter table innodb_normal page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_normal; -alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0; -show warnings; -show create table innodb_compressed; - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -# zlib -set global innodb_compression_algorithm = 1; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -# none -set global innodb_compression_algorithm = 0; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; +set global innodb_compression_algorithm = lzma; -drop procedure innodb_insert_proc; -drop table innodb_normal; -drop table innodb_compressed; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; +# All page compression test use the same +--source include/innodb-page-compression.inc -# reset system ---disable_query_log -EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; -EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; -EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; ---enable_query_log +-- echo #done diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test b/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test index 96ba18f5112..aec07beeca6 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test @@ -2,205 +2,10 @@ -- source include/have_innodb_lzo.inc -- source include/not_embedded.inc - ---disable_query_log -let $innodb_compression_algorithm_orig=`select @@innodb_compression_algorithm`; -let $innodb_file_format_orig = `select @@innodb_file_format`; -let $innodb_file_per_table_orig = `select @@innodb_file_per_table`; ---enable_query_log - -set global innodb_file_format = `barracuda`; -set global innodb_file_per_table = on; - # lzo -set global innodb_compression_algorithm = 3; - -create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8; -show warnings; -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -show create table innodb_page_compressed1; -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -show create table innodb_page_compressed2; -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -show create table innodb_page_compressed3; -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -show create table innodb_page_compressed4; -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -show create table innodb_page_compressed5; -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -show create table innodb_page_compressed6; -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -show create table innodb_page_compressed7; -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_page_compressed8; -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -show create table innodb_page_compressed9; -delimiter //; -create procedure innodb_insert_proc (repeat_count int) -begin - declare current_num int; - set current_num = 0; - while current_num < repeat_count do - insert into innodb_normal values(current_num,'testing..'); - set current_num = current_num + 1; - end while; -end// -delimiter ;// -commit; - -set autocommit=0; -call innodb_insert_proc(5000); -commit; -set autocommit=1; -select count(*) from innodb_normal; -insert into innodb_compressed select * from innodb_normal; -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -alter table innodb_normal page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_normal; -alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0; -show warnings; -show create table innodb_compressed; - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -# zlib -set global innodb_compression_algorithm = 1; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; +set global innodb_compression_algorithm = lzo; -drop procedure innodb_insert_proc; -drop table innodb_normal; -drop table innodb_compressed; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; +# All page compression test use the same +--source include/innodb-page-compression.inc -# reset system ---disable_query_log -eval set global innodb_compression_algorithm = $innodb_compression_algorithm_orig; -eval set global innodb_file_per_table = $innodb_file_per_table_orig; -eval set global innodb_file_format = $innodb_file_format_orig; ---enable_query_log +-- echo #done diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_zip.test b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test index 67fafdb9e83..ed3a27ada7b 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_zip.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test @@ -1,203 +1,10 @@ --source include/have_innodb.inc --source include/not_embedded.inc ---disable_query_log -let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`; -let $innodb_file_format_orig = `SELECT @@innodb_file_format`; -let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; ---enable_query_log +# lz4 +set global innodb_compression_algorithm = zlib; -SET GLOBAL innodb_file_format = `Barracuda`; -SET GLOBAL innodb_file_per_table = ON; +# All page compression test use the same +--source include/innodb-page-compression.inc -# zlib -set global innodb_compression_algorithm = 1; - -create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8; -show warnings; -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -show create table innodb_page_compressed1; -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -show create table innodb_page_compressed2; -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -show create table innodb_page_compressed3; -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -show create table innodb_page_compressed4; -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -show create table innodb_page_compressed5; -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -show create table innodb_page_compressed6; -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -show create table innodb_page_compressed7; -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_page_compressed8; -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -show create table innodb_page_compressed9; -delimiter //; -create procedure innodb_insert_proc (repeat_count int) -begin - declare current_num int; - set current_num = 0; - while current_num < repeat_count do - insert into innodb_normal values(current_num,'testing..'); - set current_num = current_num + 1; - end while; -end// -delimiter ;// -commit; - -set autocommit=0; -call innodb_insert_proc(5000); -commit; -set autocommit=1; -select count(*) from innodb_normal; -insert into innodb_compressed select * from innodb_normal; -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -alter table innodb_normal page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_normal; -alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0; -show warnings; -show create table innodb_compressed; - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -# none -set global innodb_compression_algorithm = 0; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -drop procedure innodb_insert_proc; -drop table innodb_normal; -drop table innodb_compressed; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; - -# reset system ---disable_query_log -EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; -EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; -EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; ---enable_query_log +-- echo #done -- cgit v1.2.1 From 40c7778e05120fe7972fdfea15fb2db5b98579c6 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 16 May 2017 17:11:25 +0000 Subject: MDEV-12814 mariabackup : don't try io throttling in copy-back Throttling only works with when creating backup. Attempt to use it with --copy-back results in crash, since throttle events are not initialized. Thus, ignore throttling unless --backup is given. --- mysql-test/suite/mariabackup/include/restart_and_restore.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/mariabackup/include/restart_and_restore.inc b/mysql-test/suite/mariabackup/include/restart_and_restore.inc index 39616cc6f15..7ee4a660b78 100644 --- a/mysql-test/suite/mariabackup/include/restart_and_restore.inc +++ b/mysql-test/suite/mariabackup/include/restart_and_restore.inc @@ -7,7 +7,7 @@ shutdown_server; echo # remove datadir; rmdir $_datadir; echo # xtrabackup move back; -exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir --parallel=2; +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir --parallel=2 --throttle=1; echo # restart server; exec echo "restart" > $_expect_file_name; enable_reconnect; -- cgit v1.2.1 From b5cdf01404dd352bb9aa7b58cad76f7a500b32d2 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Thu, 18 May 2017 17:13:37 +0530 Subject: MDEV-11092 Assertion `!writer.checksum_len || writer.remains == 0' failed Problem:- This crash happens because logged stmt is quite big and while writing Annotate_rows_log_event it throws EFBIG error but we ignore this error and do not call cache_data->set_incident(). Solution:- When we normally write Binlog_log_event we check for error EFBIG, but we did do this for Annotate_rows_log_event. We check for this error and call cache_data->set_incident() accordingly. # Conflicts: # sql/log.cc --- mysql-test/suite/rpl/r/rpl_mdev-11092.result | 17 +++++++++ mysql-test/suite/rpl/t/rpl_mdev-11092.test | 53 ++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 mysql-test/suite/rpl/r/rpl_mdev-11092.result create mode 100644 mysql-test/suite/rpl/t/rpl_mdev-11092.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/rpl/r/rpl_mdev-11092.result b/mysql-test/suite/rpl/r/rpl_mdev-11092.result new file mode 100644 index 00000000000..b2de9e5f573 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mdev-11092.result @@ -0,0 +1,17 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*"); +SET GLOBAL max_binlog_cache_size = 4096; +SET GLOBAL binlog_cache_size = 4096; +SET GLOBAL max_binlog_stmt_cache_size = 4096; +SET GLOBAL binlog_stmt_cache_size = 4096; +CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MYISAM; +ERROR HY000: Writing one row to the row-based binary log failed +include/wait_for_slave_sql_error_and_skip.inc [errno=1590] +SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; +SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; +SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; +SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_mdev-11092.test b/mysql-test/suite/rpl/t/rpl_mdev-11092.test new file mode 100644 index 00000000000..c8b2b7f2ad1 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mdev-11092.test @@ -0,0 +1,53 @@ +--source include/have_innodb.inc +--source include/master-slave.inc +--source include/not_embedded.inc +--source include/not_windows.inc +--source include/have_binlog_format_row.inc + +######################################################################################## +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*"); + +let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1); +let $old_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_cache_size", Value, 1); +let $old_max_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_stmt_cache_size", Value, 1); +let $old_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_stmt_cache_size", Value, 1); + +SET GLOBAL max_binlog_cache_size = 4096; +SET GLOBAL binlog_cache_size = 4096; +SET GLOBAL max_binlog_stmt_cache_size = 4096; +SET GLOBAL binlog_stmt_cache_size = 4096; +disconnect master; +connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); + +CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MYISAM; + +let $data = `select concat('"', repeat('a',2000), '"')`; + +connection master; + +--disable_query_log +--error ER_BINLOG_ROW_LOGGING_FAILED +eval INSERT INTO t1 (a, data) VALUES (2, + CONCAT($data, $data, $data, $data, $data, $data)); +--enable_query_log + +# Incident event +# 1590=ER_SLAVE_INCIDENT +--let $slave_sql_errno= 1590 +--source include/wait_for_slave_sql_error_and_skip.inc + +connection master; + +--replace_result $old_max_binlog_cache_size ORIGINAL_VALUE +--eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size +--replace_result $old_binlog_cache_size ORIGINAL_VALUE +--eval SET GLOBAL binlog_cache_size= $old_binlog_cache_size +--replace_result $old_max_binlog_stmt_cache_size ORIGINAL_VALUE +--eval SET GLOBAL max_binlog_stmt_cache_size= $old_max_binlog_stmt_cache_size +--replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE +--eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size + +DROP TABLE t1; + +--source include/rpl_end.inc -- cgit v1.2.1 From 4807df6f2007f5b73bd229777b1c3cd25a37c5fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 18 May 2017 16:58:02 +0300 Subject: MDEV-12794 innodb_zip.recover failed in buildbot Issue FLUSH TABLES to prevent unintended corruption of crash-unsafe tables when the server is killed. --- mysql-test/suite/innodb_zip/t/recover.test | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb_zip/t/recover.test b/mysql-test/suite/innodb_zip/t/recover.test index 3969cd2f44e..0cfc2b672fb 100644 --- a/mysql-test/suite/innodb_zip/t/recover.test +++ b/mysql-test/suite/innodb_zip/t/recover.test @@ -2,6 +2,13 @@ --source include/have_innodb_max_16k.inc --source include/not_embedded.inc +--disable_query_log +# This test kills the server, which could corrupt some mysql.* tables +# that are not created with ENGINE=InnoDB. +# Flush any non-InnoDB tables to prevent that from happening. +FLUSH TABLES; +--enable_query_log + --echo # --echo # MDEV-12720 recovery fails with "Generic error" --echo # for ROW_FORMAT=compressed -- cgit v1.2.1 From 7d57ba6e28f8dd5f6ab48b0b99d110c2363b576d Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Fri, 19 May 2017 13:02:45 +0530 Subject: MDEV-11092 :- Fix Previous commit of MDEV-11092 --- mysql-test/suite/rpl/t/rpl_mdev-11092.opt | 1 + 1 file changed, 1 insertion(+) create mode 100644 mysql-test/suite/rpl/t/rpl_mdev-11092.opt (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/rpl/t/rpl_mdev-11092.opt b/mysql-test/suite/rpl/t/rpl_mdev-11092.opt new file mode 100644 index 00000000000..7f1d270d29f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mdev-11092.opt @@ -0,0 +1 @@ +--binlog_checksum=1 --binlog-annotate-row-events=1 -- cgit v1.2.1 From 0bfa3dff8b95ed8b8bd133e434b47189857121ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 16 May 2017 12:07:26 +0300 Subject: MDEV-12698 innodb.innodb_stats_del_mark test failure In my merge of the MySQL fix for Oracle Bug#23333990 / WL#9513 I overlooked some subsequent revisions to the test, and I also failed to notice that the test is actually always failing. Oracle introduced the parameter innodb_stats_include_delete_marked but failed to consistently take it into account in FOREIGN KEY constraints that involve CASCADE or SET NULL. When innodb_stats_include_delete_marked=ON, obviously the purge of delete-marked records should update the statistics as well. One more omission was that statistics were never updated on ROLLBACK. We are fixing that as well, properly taking into account the parameter innodb_stats_include_delete_marked. dict_stats_analyze_index_level(): Simplify an expression. (Using the ternary operator with a constant operand is unnecessary obfuscation.) page_scan_method_t: Revert the change done by Oracle. Instead, examine srv_stats_include_delete_marked directly where it is needed. dict_stats_update_if_needed(): Renamed from row_update_statistics_if_needed(). row_update_for_mysql_using_upd_graph(): Assert that the table statistics are initialized, as guaranteed by ha_innobase::open(). Update the statistics in a consistent way, both for FOREIGN KEY triggers and for the main table. If FOREIGN KEY constraints exist, do not dereference a freed pointer, but cache the proper value of node->is_delete so that it matches prebuilt->table. row_purge_record_func(): Update statistics if innodb_stats_include_delete_marked=ON. row_undo_ins(): Update statistics (on ROLLBACK of a fresh INSERT). This is independent of the parameter; the record is not delete-marked. row_undo_mod(): Update statistics on the ROLLBACK of updating key columns, or (if innodb_stats_include_delete_marked=OFF) updating delete-marks. innodb.innodb_stats_persistent: Renamed and extended from innodb.innodb_stats_del_mark. Reduced the unnecessarily large dataset from 262,144 to 32 rows. Test both values of the configuration parameter innodb_stats_include_delete_marked. Test that purge is updating the statistics. innodb_fts.innodb_fts_multiple_index: Adjust the result. The test is performing a ROLLBACK of an INSERT, which now affects the statistics. include/wait_all_purged.inc: Moved from innodb.innodb_truncate_debug to its own file. --- .../suite/innodb/include/wait_all_purged.inc | 19 ++++ .../suite/innodb/r/innodb_stats_del_mark.result | 91 ---------------- .../suite/innodb/r/innodb_stats_persistent.result | 116 +++++++++++++++++++++ .../innodb/t/innodb_stats_del_mark-master.opt | 1 - .../suite/innodb/t/innodb_stats_del_mark.test | 113 -------------------- .../suite/innodb/t/innodb_stats_persistent.test | 95 +++++++++++++++++ .../suite/innodb/t/truncate_purge_debug.test | 19 +--- .../innodb_fts/r/innodb_fts_multiple_index.result | 12 +-- 8 files changed, 237 insertions(+), 229 deletions(-) create mode 100644 mysql-test/suite/innodb/include/wait_all_purged.inc delete mode 100644 mysql-test/suite/innodb/r/innodb_stats_del_mark.result create mode 100644 mysql-test/suite/innodb/r/innodb_stats_persistent.result delete mode 100644 mysql-test/suite/innodb/t/innodb_stats_del_mark-master.opt delete mode 100644 mysql-test/suite/innodb/t/innodb_stats_del_mark.test create mode 100644 mysql-test/suite/innodb/t/innodb_stats_persistent.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/include/wait_all_purged.inc b/mysql-test/suite/innodb/include/wait_all_purged.inc new file mode 100644 index 00000000000..7dbb59a5d32 --- /dev/null +++ b/mysql-test/suite/innodb/include/wait_all_purged.inc @@ -0,0 +1,19 @@ +# Wait for everything to be purged. +# The user should have set innodb_purge_rseg_truncate_frequency=1. + +let $wait_counter= 300; +while ($wait_counter) +{ + --replace_regex /.*History list length ([0-9]+).*/\1/ + let $remaining= `SHOW ENGINE INNODB STATUS`; + if ($remaining == 'InnoDB 0') + { + let $wait_counter= 0; + } + if ($wait_counter) + { + real_sleep 0.1; + dec $wait_counter; + } +} +echo $remaining transactions not purged; diff --git a/mysql-test/suite/innodb/r/innodb_stats_del_mark.result b/mysql-test/suite/innodb/r/innodb_stats_del_mark.result deleted file mode 100644 index 67538bf8eb3..00000000000 --- a/mysql-test/suite/innodb/r/innodb_stats_del_mark.result +++ /dev/null @@ -1,91 +0,0 @@ -# -# Bug 23333990 PERSISTENT INDEX STATISTICS UPDATE BEFORE -# TRANSACTION IS COMMITTED -# -"Test 1:- Uncommited delete test" -CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, -val INT UNSIGNED NOT NULL, -INDEX (val)) ENGINE=INNODB -STATS_PERSISTENT=1,STATS_AUTO_RECALC=1; -INSERT INTO t1 (val) VALUES (CEIL(RAND()*20)); -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -SELECT COUNT(*) FROM t1; -COUNT(*) -262144 -ANALYZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -connect con1, localhost, root,,; -START TRANSACTION; -DELETE FROM t1; -SELECT COUNT(*) FROM t1; -connection default; -Test correctly estimates the number of rows as > 20000 -even when in other uncommmited transaction -all rows have been deleted. -connection con1; -COUNT(*) -0 -commit; -connection default; -Test 2:- Insert and rollback test -CREATE TABLE t2 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, -val INT UNSIGNED NOT NULL, -INDEX (val)) ENGINE=INNODB -STATS_PERSISTENT=1,STATS_AUTO_RECALC=1; -connection con1; -START TRANSACTION; -INSERT INTO t2 (val) VALUES (CEIL(RAND()*20)); -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -SELECT COUNT(*) FROM t2; -connection default; -select count(*) from t2; -count(*) -0 -Test correctly estimates the number of rows as > 20000 -even when in other uncommited transaction -many rows are inserted. -connection con1; -COUNT(*) -262144 -Rollback the insert -rollback; -disconnect con1; -connection default; -Test correctly estimates the number of rows as 1 -after rollback. -DROP TABLE t1,t2; diff --git a/mysql-test/suite/innodb/r/innodb_stats_persistent.result b/mysql-test/suite/innodb/r/innodb_stats_persistent.result new file mode 100644 index 00000000000..f4de4b6b82e --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_stats_persistent.result @@ -0,0 +1,116 @@ +SET @saved_include_delete_marked = @@GLOBAL.innodb_stats_include_delete_marked; +SET GLOBAL innodb_stats_include_delete_marked = ON; +SET @saved_traditional = @@GLOBAL.innodb_stats_traditional; +SET GLOBAL innodb_stats_traditional=false; +SET @saved_modified_counter = @@GLOBAL.innodb_stats_modified_counter; +SET GLOBAL innodb_stats_modified_counter=1; +CREATE TABLE t0 (id SERIAL, val INT UNSIGNED NOT NULL, KEY(val)) +ENGINE=INNODB STATS_PERSISTENT=1,STATS_AUTO_RECALC=1; +CREATE TABLE t1 LIKE t0; +CREATE TABLE t2 LIKE t0; +INSERT INTO t0 (val) VALUES (4); +INSERT INTO t0 (val) SELECT 4 FROM t0; +INSERT INTO t0 (val) SELECT 4 FROM t0; +INSERT INTO t0 (val) SELECT 4 FROM t0; +INSERT INTO t0 (val) SELECT 4 FROM t0; +INSERT INTO t1 SELECT * FROM t0; +SELECT COUNT(*) FROM t1; +COUNT(*) +16 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +connect con1, localhost, root,,; +START TRANSACTION; +DELETE FROM t1; +SELECT COUNT(*) FROM t1; +connection default; +# With innodb_stats_include_delete_marked=ON, +# DELETE must not affect statistics before COMMIT. +EXPLAIN SELECT * FROM t1 WHERE val=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref val val 4 const 16 Using index +connection con1; +COUNT(*) +0 +ROLLBACK; +SELECT COUNT(*) FROM t1; +COUNT(*) +16 +EXPLAIN SELECT * FROM t1 WHERE val=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref val val 4 const 16 Using index +BEGIN; +DELETE FROM t1; +COMMIT; +SELECT COUNT(*) FROM t1; +COUNT(*) +0 +connection default; +BEGIN; +INSERT INTO t2 SELECT * FROM t0; +# The INSERT will show up before COMMIT. +EXPLAIN SELECT * FROM t2 WHERE val=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref val val 4 const 16 Using index +SELECT COUNT(*) FROM t2; +COUNT(*) +16 +# The ROLLBACK of the INSERT must affect the statistics. +ROLLBACK; +SELECT COUNT(*) FROM t2; +COUNT(*) +0 +connection con1; +EXPLAIN SELECT * FROM t2 WHERE val=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref val val 4 const 1 Using index +SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency; +SET GLOBAL innodb_purge_rseg_truncate_frequency = 1; +InnoDB 0 transactions not purged +SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; +# After COMMIT and purge, the DELETE must show up. +EXPLAIN SELECT * FROM t1 WHERE val=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref val val 4 const 1 Using index +SET GLOBAL innodb_stats_include_delete_marked = OFF; +BEGIN; +INSERT INTO t1 SELECT * FROM t0; +EXPLAIN SELECT * FROM t1 WHERE val=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref val val 4 const 16 Using index +ROLLBACK; +EXPLAIN SELECT * FROM t1 WHERE val=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref val val 4 const 1 Using index +BEGIN; +INSERT INTO t1 SELECT * FROM t0; +COMMIT; +EXPLAIN SELECT * FROM t1 WHERE val=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref val val 4 const 16 Using index +BEGIN; +DELETE FROM t1; +SELECT COUNT(*) FROM t1; +COUNT(*) +0 +# With innodb_stats_include_delete_marked=OFF, +# DELETE must affect statistics even before COMMIT. +# However, if there was a WHERE condition, +# ha_innobase::records_in_range() would count the delete-marked records. +EXPLAIN SELECT * FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL val 4 NULL 1 Using index +ROLLBACK; +EXPLAIN SELECT * FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL val 4 NULL 16 Using index +SELECT COUNT(*) FROM t1; +COUNT(*) +16 +disconnect con1; +connection default; +DROP TABLE t0,t1,t2; +SET GLOBAL innodb_stats_include_delete_marked = @saved_include_delete_marked; +SET GLOBAL innodb_stats_traditional = @saved_traditional; +SET GLOBAL innodb_stats_modified_counter = @saved_modified_counter; diff --git a/mysql-test/suite/innodb/t/innodb_stats_del_mark-master.opt b/mysql-test/suite/innodb/t/innodb_stats_del_mark-master.opt deleted file mode 100644 index 145ee2b4264..00000000000 --- a/mysql-test/suite/innodb/t/innodb_stats_del_mark-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb_stats_include_delete_marked=on diff --git a/mysql-test/suite/innodb/t/innodb_stats_del_mark.test b/mysql-test/suite/innodb/t/innodb_stats_del_mark.test deleted file mode 100644 index 36f7a2ea099..00000000000 --- a/mysql-test/suite/innodb/t/innodb_stats_del_mark.test +++ /dev/null @@ -1,113 +0,0 @@ ---source include/have_innodb.inc ---source include/big_test.inc - ---echo # ---echo # Bug 23333990 PERSISTENT INDEX STATISTICS UPDATE BEFORE ---echo # TRANSACTION IS COMMITTED ---echo # - ---echo "Test 1:- Uncommited delete test" -CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - val INT UNSIGNED NOT NULL, - INDEX (val)) ENGINE=INNODB - STATS_PERSISTENT=1,STATS_AUTO_RECALC=1; - - -INSERT INTO t1 (val) VALUES (CEIL(RAND()*20)); -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; -INSERT INTO t1 (val) SELECT CEIL(RAND()*20) FROM t1; - -SELECT COUNT(*) FROM t1; -ANALYZE TABLE t1; - -connect(con1, localhost, root,,); -START TRANSACTION; -DELETE FROM t1; -send SELECT COUNT(*) FROM t1; - -connection default; -let $row_count= query_get_value(EXPLAIN SELECT * FROM t1 WHERE val=4, rows,1); -if ($row_count > 20000) -{ ---echo Test correctly estimates the number of rows as > 20000 ---echo even when in other uncommmited transaction ---echo all rows have been deleted. -} - -connection con1; -reap; -commit; - -connection default; - ---echo Test 2:- Insert and rollback test -CREATE TABLE t2 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - val INT UNSIGNED NOT NULL, - INDEX (val)) ENGINE=INNODB - STATS_PERSISTENT=1,STATS_AUTO_RECALC=1; - -connection con1; - -START TRANSACTION; -INSERT INTO t2 (val) VALUES (CEIL(RAND()*20)); -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -INSERT INTO t2 (val) SELECT CEIL(RAND()*20) FROM t2; -send SELECT COUNT(*) FROM t2; - -connection default; -select count(*) from t2; -let $row_count= query_get_value(EXPLAIN SELECT * FROM t2 WHERE val=4, rows,1); -if ($row_count > 20000) -{ ---echo Test correctly estimates the number of rows as > 20000 ---echo even when in other uncommited transaction ---echo many rows are inserted. -} - -connection con1; -reap; ---echo Rollback the insert -rollback; -disconnect con1; - -connection default; -let $row_count= query_get_value(EXPLAIN SELECT * FROM t2 WHERE val=4, rows,1); -if ($row_count <= 1) -{ ---echo Test correctly estimates the number of rows as $row_count ---echo after rollback. -} - -DROP TABLE t1,t2; diff --git a/mysql-test/suite/innodb/t/innodb_stats_persistent.test b/mysql-test/suite/innodb/t/innodb_stats_persistent.test new file mode 100644 index 00000000000..652b201c4b4 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_stats_persistent.test @@ -0,0 +1,95 @@ +--source include/have_innodb.inc +--source include/big_test.inc + +SET @saved_include_delete_marked = @@GLOBAL.innodb_stats_include_delete_marked; +SET GLOBAL innodb_stats_include_delete_marked = ON; +SET @saved_traditional = @@GLOBAL.innodb_stats_traditional; +SET GLOBAL innodb_stats_traditional=false; +SET @saved_modified_counter = @@GLOBAL.innodb_stats_modified_counter; +SET GLOBAL innodb_stats_modified_counter=1; + +CREATE TABLE t0 (id SERIAL, val INT UNSIGNED NOT NULL, KEY(val)) +ENGINE=INNODB STATS_PERSISTENT=1,STATS_AUTO_RECALC=1; +CREATE TABLE t1 LIKE t0; +CREATE TABLE t2 LIKE t0; + +INSERT INTO t0 (val) VALUES (4); +INSERT INTO t0 (val) SELECT 4 FROM t0; +INSERT INTO t0 (val) SELECT 4 FROM t0; +INSERT INTO t0 (val) SELECT 4 FROM t0; +INSERT INTO t0 (val) SELECT 4 FROM t0; + +INSERT INTO t1 SELECT * FROM t0; +SELECT COUNT(*) FROM t1; +ANALYZE TABLE t1; + +connect(con1, localhost, root,,); +START TRANSACTION; +DELETE FROM t1; +send SELECT COUNT(*) FROM t1; + +connection default; +--echo # With innodb_stats_include_delete_marked=ON, +--echo # DELETE must not affect statistics before COMMIT. +EXPLAIN SELECT * FROM t1 WHERE val=4; + +connection con1; +reap; +ROLLBACK; +SELECT COUNT(*) FROM t1; +EXPLAIN SELECT * FROM t1 WHERE val=4; + +BEGIN; +DELETE FROM t1; +COMMIT; +SELECT COUNT(*) FROM t1; + +connection default; +BEGIN; +INSERT INTO t2 SELECT * FROM t0; + +--echo # The INSERT will show up before COMMIT. +EXPLAIN SELECT * FROM t2 WHERE val=4; +SELECT COUNT(*) FROM t2; +--echo # The ROLLBACK of the INSERT must affect the statistics. +ROLLBACK; +SELECT COUNT(*) FROM t2; + +connection con1; +EXPLAIN SELECT * FROM t2 WHERE val=4; +SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency; +SET GLOBAL innodb_purge_rseg_truncate_frequency = 1; +--source include/wait_all_purged.inc +SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; +--echo # After COMMIT and purge, the DELETE must show up. +EXPLAIN SELECT * FROM t1 WHERE val=4; + +SET GLOBAL innodb_stats_include_delete_marked = OFF; +BEGIN; +INSERT INTO t1 SELECT * FROM t0; +EXPLAIN SELECT * FROM t1 WHERE val=4; +ROLLBACK; +EXPLAIN SELECT * FROM t1 WHERE val=4; +BEGIN; +INSERT INTO t1 SELECT * FROM t0; +COMMIT; +EXPLAIN SELECT * FROM t1 WHERE val=4; +BEGIN; +DELETE FROM t1; +SELECT COUNT(*) FROM t1; +--echo # With innodb_stats_include_delete_marked=OFF, +--echo # DELETE must affect statistics even before COMMIT. +--echo # However, if there was a WHERE condition, +--echo # ha_innobase::records_in_range() would count the delete-marked records. +EXPLAIN SELECT * FROM t1; +ROLLBACK; +EXPLAIN SELECT * FROM t1; +SELECT COUNT(*) FROM t1; +disconnect con1; + +connection default; + +DROP TABLE t0,t1,t2; +SET GLOBAL innodb_stats_include_delete_marked = @saved_include_delete_marked; +SET GLOBAL innodb_stats_traditional = @saved_traditional; +SET GLOBAL innodb_stats_modified_counter = @saved_modified_counter; diff --git a/mysql-test/suite/innodb/t/truncate_purge_debug.test b/mysql-test/suite/innodb/t/truncate_purge_debug.test index 513c59e12c8..e8f5768f557 100644 --- a/mysql-test/suite/innodb/t/truncate_purge_debug.test +++ b/mysql-test/suite/innodb/t/truncate_purge_debug.test @@ -33,25 +33,8 @@ COMMIT; disconnect con2; connection default; +--source include/wait_all_purged.inc -# Wait for everything to be purged. - -let $wait_counter= 300; -while ($wait_counter) -{ - --replace_regex /.*History list length ([0-9]+).*/\1/ - let $remaining= `SHOW ENGINE INNODB STATUS`; - if ($remaining == 'InnoDB 0') - { - let $wait_counter= 0; - } - if ($wait_counter) - { - real_sleep 0.1; - dec $wait_counter; - } -} -echo $remaining transactions not purged; SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; SET DEBUG_SYNC = 'now SIGNAL finish_scan'; diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result b/mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result index 0b011639e2e..b0f7d7727d6 100644 --- a/mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result +++ b/mysql-test/suite/innodb_fts/r/innodb_fts_multiple_index.result @@ -46,9 +46,9 @@ id a b 1 MySQL Tutorial DBMS stands for DataBase ... select *, MATCH(a) AGAINST("Optimizing MySQL" IN BOOLEAN MODE) as x from t1; id a b x -1 MySQL Tutorial DBMS stands for DataBase ... 0.0906190574169159 -2 How To Use MySQL Well After you went through a ... 0.0906190574169159 -3 Optimizing MySQL In this tutorial we will show ... 0.6961383819580078 +1 MySQL Tutorial DBMS stands for DataBase ... 0.000000001885928302414186 +2 How To Use MySQL Well After you went through a ... 0.000000001885928302414186 +3 Optimizing MySQL In this tutorial we will show ... 0.22764469683170319 select *, MATCH(b) AGAINST("collections support" IN BOOLEAN MODE) as x from t1; id a b x 1 MySQL Tutorial DBMS stands for DataBase ... 0 @@ -90,9 +90,9 @@ id a b 1 MySQL Tutorial DBMS stands for DataBase ... select *, MATCH(a) AGAINST("Optimizing MySQL" IN BOOLEAN MODE) as x from t1; id a b x -1 MySQL Tutorial DBMS stands for DataBase ... 0.0906190574169159 -2 How To Use MySQL Well After you went through a ... 0.0906190574169159 -3 Optimizing MySQL In this tutorial we will show ... 0.6961383819580078 +1 MySQL Tutorial DBMS stands for DataBase ... 0.000000001885928302414186 +2 How To Use MySQL Well After you went through a ... 0.000000001885928302414186 +3 Optimizing MySQL In this tutorial we will show ... 0.22764469683170319 select *, MATCH(b) AGAINST("collections support" IN BOOLEAN MODE) as x from t1; id a b x 1 MySQL Tutorial DBMS stands for DataBase ... 0 -- cgit v1.2.1 From 45fe62b8d6d96cc8a1f4e4d55647336825cfae9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 19 May 2017 22:25:57 +0300 Subject: Clean up a test Changed global parameters will be reset by server restart. There is no need to save and restore the original values. --- .../suite/encryption/r/innodb-key-rotation-disable.result | 1 - .../suite/encryption/t/innodb-key-rotation-disable.test | 14 -------------- 2 files changed, 15 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result index eeb338cad61..89677490d92 100644 --- a/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result +++ b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result @@ -62,5 +62,4 @@ FOUND /public/ in t7.ibd FOUND /public/ in t8.ibd # t9 page compressed expecting NOT FOUND NOT FOUND /public/ in t9.ibd -use test; drop database enctests; diff --git a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test index fdbd6c8da7c..574e0c3becc 100644 --- a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test +++ b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test @@ -8,9 +8,6 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_ --disable_query_log --disable_warnings -let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`; -let $innodb_file_format_orig = `SELECT @@innodb_file_format`; -let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; let $encryption = `SELECT @@innodb_encrypt_tables`; SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; @@ -88,15 +85,4 @@ SET GLOBAL innodb_encrypt_tables=ON; -- source include/start_mysqld.inc -use test; drop database enctests; -# reset system - ---disable_query_log ---disable_warnings -EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; -EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; -EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; -set global innodb_compression_algorithm = DEFAULT; ---enable_warnings ---enable_query_log -- cgit v1.2.1 From fe291c687d7780e8689785062802c62fc9cff2c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Sat, 20 May 2017 08:43:25 +0300 Subject: After-merge fix: Correct the XtraDB result diff. --- mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff index 6712ce9c586..9199653b460 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff @@ -662,7 +662,7 @@ VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL -GLOBAL_VALUE 5.6.36 -+GLOBAL_VALUE 5.6.36-80.0 ++GLOBAL_VALUE 5.6.36-82.0 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL -- cgit v1.2.1 From f880200974ef757523d56af00c2c5ad23ddc6ff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Sat, 20 May 2017 17:47:07 +0300 Subject: After-merge fix: Correct the 32-bit XtraDB result diff. --- mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff index 858df585a7b..f5ce4d77c6b 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff @@ -1218,8 +1218,8 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL --GLOBAL_VALUE 5.6.35 -+GLOBAL_VALUE 5.6.35-80.0 +-GLOBAL_VALUE 5.6.36 ++GLOBAL_VALUE 5.6.36-82.0 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL -- cgit v1.2.1 From 90c52e5291b3ad0935df7da56ec0fcbf530733b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Sat, 20 May 2017 21:49:35 +0300 Subject: MDEV-12615: InnoDB page compression method snappy mostly does not compress pages Snappy compression method require that output buffer used for compression is bigger than input buffer. Similarly lzo require additional work memory buffer. Increase the allocated buffer accordingly. buf_tmp_buffer_t: removed unnecessary lzo_mem, crypt_buf_free and comp_buf_free. buf_pool_reserve_tmp_slot: use alligned_alloc and if snappy available allocate size based on snappy_max_compressed_length and if lzo is available increase buffer by LZO1X_1_15_MEM_COMPRESS. fil_compress_page: Remove unneeded lzo mem (we use same buffer) and if output buffer is not yet allocated allocate based similarly as above. Decompression does not require additional work area. Modify test to use same test as other compression method tests. --- .../innodb/r/innodb-page_compression_snappy.result | 491 ++++----------------- .../innodb/t/innodb-page_compression_snappy.test | 252 +---------- 2 files changed, 82 insertions(+), 661 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result index a0b2f947fd3..74cfa9bce3a 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result @@ -1,432 +1,92 @@ -call mtr.add_suppression("Compression failed for space*"); -set global innodb_file_format = `barracuda`; +call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+."); +set global innodb_compression_algorithm = snappy; +set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; -set global innodb_compression_algorithm = 6; -create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8; -show warnings; -Level Code Message -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -Level Code Message -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -Level Code Message -show create table innodb_page_compressed1; -Table Create Table -innodb_page_compressed1 CREATE TABLE `innodb_page_compressed1` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=1 -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -Level Code Message -show create table innodb_page_compressed2; -Table Create Table -innodb_page_compressed2 CREATE TABLE `innodb_page_compressed2` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=2 -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -Level Code Message -show create table innodb_page_compressed3; -Table Create Table -innodb_page_compressed3 CREATE TABLE `innodb_page_compressed3` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=3 -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -Level Code Message -show create table innodb_page_compressed4; -Table Create Table -innodb_page_compressed4 CREATE TABLE `innodb_page_compressed4` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=4 -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -Level Code Message -show create table innodb_page_compressed5; -Table Create Table -innodb_page_compressed5 CREATE TABLE `innodb_page_compressed5` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=5 -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -Level Code Message -show create table innodb_page_compressed6; -Table Create Table -innodb_page_compressed6 CREATE TABLE `innodb_page_compressed6` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=6 -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -Level Code Message -show create table innodb_page_compressed7; -Table Create Table -innodb_page_compressed7 CREATE TABLE `innodb_page_compressed7` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=7 -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_page_compressed8; -Table Create Table -innodb_page_compressed8 CREATE TABLE `innodb_page_compressed8` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -Level Code Message -show create table innodb_page_compressed9; -Table Create Table -innodb_page_compressed9 CREATE TABLE `innodb_page_compressed9` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=9 -create procedure innodb_insert_proc (repeat_count int) -begin -declare current_num int; -set current_num = 0; -while current_num < repeat_count do -insert into innodb_normal values(current_num,'testing..'); -set current_num = current_num + 1; -end while; -end// -commit; -set autocommit=0; -call innodb_insert_proc(5000); -commit; -set autocommit=1; -select count(*) from innodb_normal; -count(*) -5000 -insert into innodb_compressed select * from innodb_normal; -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_compressed; -count(*) -5000 +create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; +create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; +create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; +create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3; +create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4; +create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5; +create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6; +create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; +create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; +create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; select count(*) from innodb_page_compressed1; count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -alter table innodb_normal page_compressed=1 page_compression_level=8; -show warnings; -Level Code Message -show create table innodb_normal; -Table Create Table -innodb_normal CREATE TABLE `innodb_normal` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0; -show warnings; -Level Code Message -show create table innodb_compressed; -Table Create Table -innodb_compressed CREATE TABLE `innodb_compressed` ( - `c1` int(11) DEFAULT NULL, - `b` char(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 +10000 +select count(*) from innodb_page_compressed3; +count(*) +10000 +select count(*) from innodb_page_compressed4; +count(*) +10000 +select count(*) from innodb_page_compressed5; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed6; +count(*) +10000 +select count(*) from innodb_page_compressed7; +count(*) +10000 +select count(*) from innodb_page_compressed8; +count(*) +10000 +select count(*) from innodb_page_compressed9; +count(*) +10000 +# innodb_normal expected FOUND +FOUND /AaAaAaAa/ in innodb_normal.ibd +# innodb_page_compressed1 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd +# innodb_page_compressed2 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd +# innodb_page_compressed3 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd +# innodb_page_compressed4 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd +# innodb_page_compressed5 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd +# innodb_page_compressed6 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd +# innodb_page_compressed7 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd +# innodb_page_compressed8 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd +# innodb_page_compressed9 page compressed expected NOT FOUND +NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd select count(*) from innodb_page_compressed1; count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -set global innodb_compression_algorithm = 1; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -set global innodb_compression_algorithm = 0; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; -count(*) -5000 -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -count(*) -5000 -select count(*) from innodb_page_compressed1; -count(*) -5000 -select count(*) from innodb_page_compressed1 where c1 < 500000; -count(*) -5000 -select count(*) from innodb_page_compressed2 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed3; count(*) -5000 -select count(*) from innodb_page_compressed3 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed4; count(*) -5000 -select count(*) from innodb_page_compressed4 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed5; count(*) -5000 -select count(*) from innodb_page_compressed5 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed6; count(*) -5000 -select count(*) from innodb_page_compressed6 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed6; count(*) -5000 -select count(*) from innodb_page_compressed7 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed7; count(*) -5000 -select count(*) from innodb_page_compressed8 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed8; count(*) -5000 -select count(*) from innodb_page_compressed9 where c1 < 500000; +10000 +select count(*) from innodb_page_compressed9; count(*) -5000 -drop procedure innodb_insert_proc; +10000 drop table innodb_normal; -drop table innodb_compressed; drop table innodb_page_compressed1; drop table innodb_page_compressed2; drop table innodb_page_compressed3; @@ -436,3 +96,4 @@ drop table innodb_page_compressed6; drop table innodb_page_compressed7; drop table innodb_page_compressed8; drop table innodb_page_compressed9; +#done diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test b/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test index 929f547b6ac..532ec294d28 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test @@ -1,253 +1,13 @@ -- source include/have_innodb.inc -- source include/have_innodb_snappy.inc +--source include/not_embedded.inc -call mtr.add_suppression("Compression failed for space*"); - ---disable_query_log -let $innodb_compression_algorithm_orig=`select @@innodb_compression_algorithm`; -let $innodb_file_format_orig = `select @@innodb_file_format`; -let $innodb_file_per_table_orig = `select @@innodb_file_per_table`; ---enable_query_log - -set global innodb_file_format = `barracuda`; -set global innodb_file_per_table = on; +call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+."); # snappy -set global innodb_compression_algorithm = 6; - -create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8; -show warnings; -create table innodb_normal (c1 int, b char(20)) engine=innodb; -show warnings; -create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1; -show warnings; -show create table innodb_page_compressed1; -create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2; -show warnings; -show create table innodb_page_compressed2; -create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3; -show warnings; -show create table innodb_page_compressed3; -create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4; -show warnings; -show create table innodb_page_compressed4; -create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5; -show warnings; -show create table innodb_page_compressed5; -create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6; -show warnings; -show create table innodb_page_compressed6; -create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7; -show warnings; -show create table innodb_page_compressed7; -create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_page_compressed8; -create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9; -show warnings; -show create table innodb_page_compressed9; -delimiter //; -create procedure innodb_insert_proc (repeat_count int) -begin - declare current_num int; - set current_num = 0; - while current_num < repeat_count do - insert into innodb_normal values(current_num,'testing..'); - set current_num = current_num + 1; - end while; -end// -delimiter ;// -commit; - -set autocommit=0; -call innodb_insert_proc(5000); -commit; -set autocommit=1; -select count(*) from innodb_normal; -insert into innodb_compressed select * from innodb_normal; -insert into innodb_page_compressed1 select * from innodb_normal; -insert into innodb_page_compressed2 select * from innodb_normal; -insert into innodb_page_compressed3 select * from innodb_normal; -insert into innodb_page_compressed4 select * from innodb_normal; -insert into innodb_page_compressed5 select * from innodb_normal; -insert into innodb_page_compressed6 select * from innodb_normal; -insert into innodb_page_compressed7 select * from innodb_normal; -insert into innodb_page_compressed8 select * from innodb_normal; -insert into innodb_page_compressed9 select * from innodb_normal; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -alter table innodb_normal page_compressed=1 page_compression_level=8; -show warnings; -show create table innodb_normal; -alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0; -show warnings; -show create table innodb_compressed; - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -# zlib -set global innodb_compression_algorithm = 1; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - -# none -set global innodb_compression_algorithm = 0; -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -commit; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; - ---source include/restart_mysqld.inc - -update innodb_page_compressed1 set c1 = c1 + 1; -update innodb_page_compressed2 set c1 = c1 + 1; -update innodb_page_compressed3 set c1 = c1 + 1; -update innodb_page_compressed4 set c1 = c1 + 1; -update innodb_page_compressed5 set c1 = c1 + 1; -update innodb_page_compressed6 set c1 = c1 + 1; -update innodb_page_compressed7 set c1 = c1 + 1; -update innodb_page_compressed8 set c1 = c1 + 1; -update innodb_page_compressed9 set c1 = c1 + 1; -select count(*) from innodb_compressed; -select count(*) from innodb_page_compressed1; -select count(*) from innodb_page_compressed1 where c1 < 500000; -select count(*) from innodb_page_compressed2 where c1 < 500000; -select count(*) from innodb_page_compressed3 where c1 < 500000; -select count(*) from innodb_page_compressed4 where c1 < 500000; -select count(*) from innodb_page_compressed5 where c1 < 500000; -select count(*) from innodb_page_compressed6 where c1 < 500000; -select count(*) from innodb_page_compressed7 where c1 < 500000; -select count(*) from innodb_page_compressed8 where c1 < 500000; -select count(*) from innodb_page_compressed9 where c1 < 500000; +set global innodb_compression_algorithm = snappy; -drop procedure innodb_insert_proc; -drop table innodb_normal; -drop table innodb_compressed; -drop table innodb_page_compressed1; -drop table innodb_page_compressed2; -drop table innodb_page_compressed3; -drop table innodb_page_compressed4; -drop table innodb_page_compressed5; -drop table innodb_page_compressed6; -drop table innodb_page_compressed7; -drop table innodb_page_compressed8; -drop table innodb_page_compressed9; +# All page compression test use the same +--source include/innodb-page-compression.inc -# reset system ---disable_query_log -EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; -EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; -EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; ---enable_query_log +-- echo #done -- cgit v1.2.1 From ee4eda40b9b49376c32ede357af0e3c5721195f8 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sun, 21 May 2017 22:19:06 +0000 Subject: MDEV-12832 : remove libarchive support from mariabackup, due to different packaging issues. Also, Percona thinks that tar support has many limitations and should be removed as well( see discussion in https://bugs.launchpad.net/percona-xtrabackup/+bug/1681721) there is an alternative streaming format xbstream that is supported and does not have these limitations. --- mysql-test/suite/mariabackup/suite.pm | 5 ----- mysql-test/suite/mariabackup/tar.result | 12 ------------ mysql-test/suite/mariabackup/tar.test | 30 ------------------------------ mysql-test/suite/mariabackup/xbstream.test | 2 +- 4 files changed, 1 insertion(+), 48 deletions(-) delete mode 100644 mysql-test/suite/mariabackup/tar.result delete mode 100644 mysql-test/suite/mariabackup/tar.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/mariabackup/suite.pm b/mysql-test/suite/mariabackup/suite.pm index 8eecd4e8018..26d5c06cdad 100644 --- a/mysql-test/suite/mariabackup/suite.pm +++ b/mysql-test/suite/mariabackup/suite.pm @@ -21,11 +21,6 @@ $ENV{XBSTREAM}= ::mtr_exe_maybe_exists( "$::bindir/extra/mariabackup/$::opt_vs_config/mbstream", "$::path_client_bindir/mbstream"); -my $tar_version = `tar --version 2>&1`; -$ENV{HAVE_TAR} = $! ? 0: 1; -my $mariabackup_help=`$mariabackup_exe --help 2>&1`; -$ENV{HAVE_XTRABACKUP_TAR_SUPPORT} = (index($mariabackup_help,"'tar'") == -1) ? 0 : 1; - $ENV{INNOBACKUPEX}= "$mariabackup_exe --innobackupex"; sub skip_combinations { diff --git a/mysql-test/suite/mariabackup/tar.result b/mysql-test/suite/mariabackup/tar.result deleted file mode 100644 index bbb546d7add..00000000000 --- a/mysql-test/suite/mariabackup/tar.result +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE t(i INT) ENGINE INNODB; -INSERT INTO t VALUES(1); -# xtrabackup backup -# xtrabackup prepare -# shutdown server -# remove datadir -# xtrabackup move back -# restart server -SELECT * FROM t; -i -1 -DROP TABLE t; diff --git a/mysql-test/suite/mariabackup/tar.test b/mysql-test/suite/mariabackup/tar.test deleted file mode 100644 index 3938d597e05..00000000000 --- a/mysql-test/suite/mariabackup/tar.test +++ /dev/null @@ -1,30 +0,0 @@ -if (`select $HAVE_TAR = 0`) -{ - --skip No tar -} -if (`select $HAVE_XTRABACKUP_TAR_SUPPORT = 0`) -{ - --skip Compiled without libarchive -} - - -CREATE TABLE t(i INT) ENGINE INNODB; -INSERT INTO t VALUES(1); - -echo # xtrabackup backup; -let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; -let $streamfile=$MYSQLTEST_VARDIR/tmp/backup.tar; -mkdir $targetdir; - - -exec $XTRABACKUP "--defaults-file=$MYSQLTEST_VARDIR/my.cnf" --backup --stream=tar > $streamfile 2>$targetdir/backup_stream.log; ---disable_result_log -exec tar -C $targetdir -x < $streamfile; -echo # xtrabackup prepare; -exec $XTRABACKUP --prepare --target-dir=$targetdir; - --- source include/restart_and_restore.inc ---enable_result_log -SELECT * FROM t; -DROP TABLE t; -rmdir $targetdir; diff --git a/mysql-test/suite/mariabackup/xbstream.test b/mysql-test/suite/mariabackup/xbstream.test index 06e5685276c..f2b4704a87e 100644 --- a/mysql-test/suite/mariabackup/xbstream.test +++ b/mysql-test/suite/mariabackup/xbstream.test @@ -9,7 +9,7 @@ echo # xtrabackup backup to stream; exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --stream=xbstream > $streamfile 2>$targetdir/backup_stream.log; echo # xbstream extract; --disable_result_log -exec $XBSTREAM -x -C $targetdir --parallel=16 < $streamfile; +exec $XBSTREAM -x -C $targetdir < $streamfile; echo # xtrabackup prepare; exec $XTRABACKUP --prepare --target-dir=$targetdir; -- cgit v1.2.1 From fdc1fd6f49b43d1226785e71b3a2c851ac3bfb47 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 20 May 2017 14:04:03 +0200 Subject: MDEV-11311 Create federated table does not work as expected. FederatedX wasn't discovering prefix keys correctly. Of course, as it had the HA_NO_PREFIX_CHAR_KEYS table_flag set... --- .../suite/federated/assisted_discovery.result | 32 ++++++++++++++++++++++ mysql-test/suite/federated/assisted_discovery.test | 24 ++++++++++++++++ 2 files changed, 56 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/federated/assisted_discovery.result b/mysql-test/suite/federated/assisted_discovery.result index 7a351b9df6f..5ad37397b3c 100644 --- a/mysql-test/suite/federated/assisted_discovery.result +++ b/mysql-test/suite/federated/assisted_discovery.result @@ -31,6 +31,38 @@ id group a\\b a\\ name 1 1 2 NULL foo 2 1 2 NULL fee DROP TABLE t1; +create table t1 ( +a bigint(20) not null auto_increment, +b bigint(20) not null, +c tinyint(4) not null, +d varchar(4096) not null, +primary key (a), +key (b,c,d(255)) +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) NOT NULL AUTO_INCREMENT, + `b` bigint(20) NOT NULL, + `c` tinyint(4) NOT NULL, + `d` varchar(4096) NOT NULL, + PRIMARY KEY (`a`), + KEY `b` (`b`,`c`,`d`(255)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create table t1 engine=federated +connection='mysql://root@127.0.0.1:SLAVE_PORT/test/t1'; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) NOT NULL AUTO_INCREMENT, + `b` bigint(20) NOT NULL, + `c` tinyint(4) NOT NULL, + `d` varchar(4096) NOT NULL, + PRIMARY KEY (`a`), + KEY `b` (`b`,`c`,`d`(255)) +) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1' +drop table t1; +drop table t1; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; diff --git a/mysql-test/suite/federated/assisted_discovery.test b/mysql-test/suite/federated/assisted_discovery.test index 9f3abe74ecc..fa83a2a8e19 100644 --- a/mysql-test/suite/federated/assisted_discovery.test +++ b/mysql-test/suite/federated/assisted_discovery.test @@ -30,5 +30,29 @@ connection slave; SELECT * FROM t1; DROP TABLE t1; +# +# +# +create table t1 ( + a bigint(20) not null auto_increment, + b bigint(20) not null, + c tinyint(4) not null, + d varchar(4096) not null, + primary key (a), + key (b,c,d(255)) +); +show create table t1; + +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval create table t1 engine=federated + connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; +--replace_result $SLAVE_MYPORT SLAVE_PORT +show create table t1; +drop table t1; + +connection slave; +drop table t1; + source include/federated_cleanup.inc; -- cgit v1.2.1 From ad807aebdea8ca43c4c642505840c6b8da1c7114 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 21 May 2017 18:10:33 +0200 Subject: MDEV-12612 mysqladmin --local flush... to use FLUSH LOCAL Make `mysqladmin --local` use `FLUSH LOCAL` for all flush-* commands, and only do `SET SQL_LOG_BIN=OFF` for create/drop/old_password/password. Additionally, --local is ignored for all commands that never write to binlog, so e.g. `mysqladmin --local version` no longer needs SUPER --- mysql-test/suite/binlog/r/mysqladmin.result | 12 ++++++++++++ mysql-test/suite/binlog/t/mysqladmin.test | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 mysql-test/suite/binlog/r/mysqladmin.result create mode 100644 mysql-test/suite/binlog/t/mysqladmin.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/binlog/r/mysqladmin.result b/mysql-test/suite/binlog/r/mysqladmin.result new file mode 100644 index 00000000000..4be6c96d55b --- /dev/null +++ b/mysql-test/suite/binlog/r/mysqladmin.result @@ -0,0 +1,12 @@ +create user adm@localhost identified by 'foobar'; +grant reload on *.* to adm@localhost; +reset master; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # flush status +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # flush status +drop user adm@localhost; diff --git a/mysql-test/suite/binlog/t/mysqladmin.test b/mysql-test/suite/binlog/t/mysqladmin.test new file mode 100644 index 00000000000..3c2fbc0a708 --- /dev/null +++ b/mysql-test/suite/binlog/t/mysqladmin.test @@ -0,0 +1,12 @@ +source include/have_binlog_format_statement.inc; +# +# MDEV-12612 mysqladmin --local flush... to use FLUSH LOCAL +# +create user adm@localhost identified by 'foobar'; +grant reload on *.* to adm@localhost; +reset master; +exec $MYSQLADMIN -uadm -pfoobar flush-status; +source include/show_binlog_events.inc; +exec $MYSQLADMIN --local -uadm -pfoobar flush-status; +source include/show_binlog_events.inc; +drop user adm@localhost; -- cgit v1.2.1 From c65dd3668ba7146afdd1c0222555508c1b4aeecb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 22 May 2017 11:02:15 +0200 Subject: de-obfuscate sys_vars.delay_key_write_func test Test fails, because of a bug: global delay_key_write is cached in the THD and the cached value becomes out-of-date when the global value changes. This is fixed in MDEV-11335 --- .../suite/sys_vars/r/delay_key_write_func.result | 39 +++++++++++------- .../suite/sys_vars/t/delay_key_write_func.test | 46 +--------------------- 2 files changed, 26 insertions(+), 59 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/sys_vars/r/delay_key_write_func.result b/mysql-test/suite/sys_vars/r/delay_key_write_func.result index d55cca7ab8e..5cc4b2eaaad 100644 --- a/mysql-test/suite/sys_vars/r/delay_key_write_func.result +++ b/mysql-test/suite/sys_vars/r/delay_key_write_func.result @@ -1,23 +1,20 @@ '#--------------------FN_DYNVARS_023_01-------------------------#' SET @start_value= @@global.delay_key_write; -SET @@global.delay_key_write = ON; -SELECT @@global.delay_key_write; -@@global.delay_key_write -ON -'connect (user1,localhost,root,,,,)' -'connection user1' -SELECT @@global.delay_key_write AS res_is_ON; -res_is_ON -ON -SET @@global.delay_key_write = ALL; -'connect (user1,localhost,root,,,,)' -'connection user1' -SELECT @@global.delay_key_write AS res_is_ALL; -res_is_ALL -ALL '#--------------------FN_DYNVARS_023_02-------------------------#' +CREATE PROCEDURE sp_addRecords (IN var1 INT,IN var2 INT) +BEGIN +WHILE (var1 < var2) DO +INSERT INTO t1 VALUES(var1,REPEAT('MYSQL',10),100000.0/var1); +SET var1=var1+1; +END WHILE; +END// '---check when delay_key_write is OFF---' SET @@global.delay_key_write = OFF; +CREATE TABLE t1( +a INT PRIMARY KEY, +b VARCHAR(512), +c DOUBLE +) DELAY_KEY_WRITE = 1; FLUSH STATUS; CALL sp_addRecords(1,10); SHOW STATUS LIKE 'Key_reads'; @@ -32,8 +29,14 @@ Key_write_requests 9 SELECT COUNT(*) FROM t1; COUNT(*) 9 +DROP TABLE t1; '----check when delay_key_write is ON---' SET @@global.delay_key_write = ON; +CREATE TABLE t1( +a INT PRIMARY KEY, +b VARCHAR(512), +c DOUBLE +) DELAY_KEY_WRITE = 1; FLUSH STATUS; CALL sp_addRecords(1,10); SHOW STATUS LIKE 'Key_reads'; @@ -48,8 +51,14 @@ Key_write_requests 9 SELECT COUNT(*) FROM t1; COUNT(*) 9 +DROP TABLE t1; '----check when delay_key_write is ALL---' SET @@global.delay_key_write = ALL; +CREATE TABLE t1( +a INT PRIMARY KEY, +b VARCHAR(512), +c DOUBLE +) DELAY_KEY_WRITE = 0; FLUSH STATUS; CALL sp_addRecords(1,10); SHOW STATUS LIKE 'Key_reads'; diff --git a/mysql-test/suite/sys_vars/t/delay_key_write_func.test b/mysql-test/suite/sys_vars/t/delay_key_write_func.test index a44b37653d2..e823e51954c 100644 --- a/mysql-test/suite/sys_vars/t/delay_key_write_func.test +++ b/mysql-test/suite/sys_vars/t/delay_key_write_func.test @@ -20,36 +20,14 @@ ############################################################################### --echo '#--------------------FN_DYNVARS_023_01-------------------------#' -####################################################################### -# Check if setting delay_key_write is changed in every new connection # -####################################################################### - SET @start_value= @@global.delay_key_write; -SET @@global.delay_key_write = ON; -SELECT @@global.delay_key_write; - ---echo 'connect (user1,localhost,root,,,,)' -connect (user1,localhost,root,,,,); ---echo 'connection user1' -connection user1; -SELECT @@global.delay_key_write AS res_is_ON; -SET @@global.delay_key_write = ALL; -disconnect user1; - ---echo 'connect (user1,localhost,root,,,,)' -connect (user1,localhost,root,,,,); ---echo 'connection user1' -connection user1; -SELECT @@global.delay_key_write AS res_is_ALL; - --echo '#--------------------FN_DYNVARS_023_02-------------------------#' ###################################################### # Begin the functionality Testing of delay_key_write # ###################################################### # create procedure to add rows ---disable_query_log DELIMITER //; CREATE PROCEDURE sp_addRecords (IN var1 INT,IN var2 INT) BEGIN @@ -59,28 +37,19 @@ BEGIN END WHILE; END// DELIMITER ;// ---enable_query_log #============================================================================== --echo '---check when delay_key_write is OFF---' #============================================================================== - SET @@global.delay_key_write = OFF; - ---disable_query_log ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings # create a table with delay_key_write enabled CREATE TABLE t1( a INT PRIMARY KEY, b VARCHAR(512), c DOUBLE ) DELAY_KEY_WRITE = 1; ---enable_query_log - FLUSH STATUS; @@ -90,6 +59,7 @@ SHOW STATUS LIKE 'Key_reads'; SHOW STATUS LIKE 'Key_writes'; SHOW STATUS LIKE 'Key_write_requests'; SELECT COUNT(*) FROM t1; +DROP TABLE t1; #============================================================================== --echo '----check when delay_key_write is ON---' @@ -97,17 +67,12 @@ SELECT COUNT(*) FROM t1; SET @@global.delay_key_write = ON; ---disable_query_log ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings # create a table with delay_key_write enabled CREATE TABLE t1( a INT PRIMARY KEY, b VARCHAR(512), c DOUBLE ) DELAY_KEY_WRITE = 1; ---enable_query_log FLUSH STATUS; CALL sp_addRecords(1,10); @@ -116,23 +81,19 @@ SHOW STATUS LIKE 'Key_reads'; SHOW STATUS LIKE 'Key_writes'; SHOW STATUS LIKE 'Key_write_requests'; SELECT COUNT(*) FROM t1; +DROP TABLE t1; #============================================================================== --echo '----check when delay_key_write is ALL---' #============================================================================== SET @@global.delay_key_write = ALL; ---disable_query_log ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings # create a table with delay_key_write disabled CREATE TABLE t1( a INT PRIMARY KEY, b VARCHAR(512), c DOUBLE ) DELAY_KEY_WRITE = 0; ---enable_query_log FLUSH STATUS; CALL sp_addRecords(1,10); @@ -144,12 +105,9 @@ SELECT COUNT(*) FROM t1; DROP PROCEDURE sp_addRecords; DROP TABLE t1; -disconnect user1; -connection default; SET @@global.delay_key_write= @start_value; #################################################### # End of functionality testing for delay_key_write # #################################################### - -- cgit v1.2.1 From 449a88e1c629b742e8be152c896c65a8bda5c817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 23 May 2017 12:17:43 +0300 Subject: MDEV-12052 Shutdown crash presumably due to master thread activity InnoDB shutdown assumes that once the server has entered SRV_SHUTDOWN_FLUSH_PHASE, no change to persistent data is allowed. It was possible for the master thread to wake up while shutdown is executing in SRV_SHUTDOWN_FLUSH_PHASE or even in SRV_SHUTDOWN_LAST_PHASE. We do not yet know if further crashes at shutdown are possible. Also, we do not know if all the observed crashes could be explained by the race conditions that we are now fixing. srv_shutdown_print_master_pending(): Remove a redundant ut_time() call. srv_shutdown(): Renamed from srv_master_do_shutdown_tasks(). srv_master_thread(): Do not resume after shutdown has been initiated. --- .../suite/innodb/r/drop_table_background.result | 9 +++++++ .../suite/innodb/t/drop_table_background.test | 30 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 mysql-test/suite/innodb/r/drop_table_background.result create mode 100644 mysql-test/suite/innodb/t/drop_table_background.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/drop_table_background.result b/mysql-test/suite/innodb/r/drop_table_background.result new file mode 100644 index 00000000000..a6f5672ba7f --- /dev/null +++ b/mysql-test/suite/innodb/r/drop_table_background.result @@ -0,0 +1,9 @@ +CREATE TABLE t(c0 SERIAL, c1 INT, c2 INT, c3 INT, c4 INT, +KEY(c1), KEY(c2), KEY(c2,c1), +KEY(c3), KEY(c3,c1), KEY(c3,c2), KEY(c3,c2,c1), +KEY(c4), KEY(c4,c1), KEY(c4,c2), KEY(c4,c2,c1), +KEY(c4,c3), KEY(c4,c3,c1), KEY(c4,c3,c2), KEY(c4,c3,c2,c1)) ENGINE=InnoDB; +SET DEBUG_DBUG='+d,row_drop_table_add_to_background'; +DROP TABLE t; +CREATE TABLE t (a INT) ENGINE=InnoDB; +DROP TABLE t; diff --git a/mysql-test/suite/innodb/t/drop_table_background.test b/mysql-test/suite/innodb/t/drop_table_background.test new file mode 100644 index 00000000000..0f596dec574 --- /dev/null +++ b/mysql-test/suite/innodb/t/drop_table_background.test @@ -0,0 +1,30 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +# Embedded server does not support restarting +--source include/not_embedded.inc + +CREATE TABLE t(c0 SERIAL, c1 INT, c2 INT, c3 INT, c4 INT, +KEY(c1), KEY(c2), KEY(c2,c1), +KEY(c3), KEY(c3,c1), KEY(c3,c2), KEY(c3,c2,c1), +KEY(c4), KEY(c4,c1), KEY(c4,c2), KEY(c4,c2,c1), +KEY(c4,c3), KEY(c4,c3,c1), KEY(c4,c3,c2), KEY(c4,c3,c2,c1)) ENGINE=InnoDB; + +let $n= 10; + +SET DEBUG_DBUG='+d,row_drop_table_add_to_background'; +--disable_query_log +let $i= $n; +while ($i) { + eval CREATE TABLE t$i LIKE t; + dec $i; +} +let $i= $n; +while ($i) { + eval DROP TABLE t$i; + dec $i; +} +--enable_query_log +DROP TABLE t; +--source include/restart_mysqld.inc +CREATE TABLE t (a INT) ENGINE=InnoDB; +DROP TABLE t; -- cgit v1.2.1 From 994a5f29f104124c54f0e5995036d6d4f970a3ca Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Fri, 26 May 2017 19:53:29 +0300 Subject: On a build without performance schema the test failed performance-schema options in option files should be loose. The tests will be skipped after have_perfschema.inc check, but if options aren't loose, the failure happens on server startup, before the check --- mysql-test/suite/perfschema/t/start_server_1_digest-master.opt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt b/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt index e59be3eb02f..c3a6012fbac 100644 --- a/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt +++ b/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt @@ -1 +1 @@ ---performance-schema-digests-size=1 +--loose-performance-schema-digests-size=1 -- cgit v1.2.1 From 6b6987154a23a8eba72fd58cbff915ae6d17189f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 30 May 2017 12:02:42 +0300 Subject: MDEV-12114: install_db shows corruption for rest encryption and innodb_checksum_algorithm=strict_none Problem was that checksum check resulted false positives that page is both not encrypted and encryted when checksum_algorithm was strict_none. Encrypton checksum will use only crc32 regardless of setting. buf_zip_decompress: If compression fails report a error message containing the space name if available (not available during import). And note if space could be encrypted. buf_page_get_gen: Do not assert if decompression fails, instead unfix the page and return NULL to upper layer. fil_crypt_calculate_checksum: Use only crc32 method. fil_space_verify_crypt_checksum: Here we need to check crc32, innodb and none method for old datafiles. fil_space_release_for_io: Allow null space. encryption.innodb-compressed-blob is now run with crc32 and none combinations. Note that with none and strict_none method there is not really a way to detect page corruptions and page corruptions after decrypting the page with incorrect key. New test innodb-checksum-algorithm to test different checksum algorithms with encrypted, row compressed and page compressed tables. --- .../encryption/r/innodb-checksum-algorithm.result | 741 +++++++++++++++++++++ .../encryption/r/innodb-compressed-blob.result | 5 +- .../encryption/t/innodb-checksum-algorithm.opt | 4 + .../encryption/t/innodb-checksum-algorithm.test | 652 ++++++++++++++++++ .../t/innodb-compressed-blob.combinations | 12 + .../suite/encryption/t/innodb-compressed-blob.opt | 4 - .../suite/encryption/t/innodb-compressed-blob.test | 6 +- 7 files changed, 1413 insertions(+), 11 deletions(-) create mode 100644 mysql-test/suite/encryption/r/innodb-checksum-algorithm.result create mode 100644 mysql-test/suite/encryption/t/innodb-checksum-algorithm.opt create mode 100644 mysql-test/suite/encryption/t/innodb-checksum-algorithm.test create mode 100644 mysql-test/suite/encryption/t/innodb-compressed-blob.combinations delete mode 100644 mysql-test/suite/encryption/t/innodb-compressed-blob.opt (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result b/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result new file mode 100644 index 00000000000..09a61af2a2f --- /dev/null +++ b/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result @@ -0,0 +1,741 @@ +SET GLOBAL innodb_file_format = `Barracuda`; +SET GLOBAL innodb_file_per_table = ON; +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_crc32\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"innodb\". Accepting the page as valid. Change innodb_checksum_algorithm to \"crc32\" to silently accept such pages or rewrite all pages so that they contain \"crc32\" checksum."); +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_none\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"innodb\". Accepting the page as valid. Change innodb_checksum_algorithm to \"none\" to silently accept such pages or rewrite all pages so that they contain \"none\" checksum."); +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_crc32\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"none\". Accepting the page as valid. Change innodb_checksum_algorithm to \"crc32\" to silently accept such pages or rewrite all pages so that they contain \"crc32\" checksum."); +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_innodb\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"none\". Accepting the page as valid. Change innodb_checksum_algorithm to \"innodb\" to silently accept such pages or rewrite all pages so that they contain \"innodb\" checksum."); +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_innodb\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"crc32\". Accepting the page as valid. Change innodb_checksum_algorithm to \"innodb\" to silently accept such pages or rewrite all pages so that they contain \"innodb\" checksum."); +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_none\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"crc32\". Accepting the page as valid. Change innodb_checksum_algorithm to \"none\" to silently accept such pages or rewrite all pages so that they contain \"none\" checksum."); +set GLOBAL innodb_default_encryption_key_id=4; +create table t1(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes; +create table t2(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb encrypted=yes; +create table t3(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=no; +create table t4(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb encrypted=no; +create table t5(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb encrypted=yes page_compressed=yes; +begin; +insert into t1(b) values (repeat('secret',20)); +insert into t1(b) select b from t1; +insert into t1(b) select b from t1; +insert into t1(b) select b from t1; +insert into t1(b) select b from t1; +insert into t1(b) select b from t1; +insert into t2(b) select b from t1; +insert into t3(b) select b from t1; +insert into t4(b) select b from t1; +insert into t5(b) select b from t1; +commit; +# 1 Restart mysqld --innodb-checksum-algorithm=crc32 +select count(*) from t1; +count(*) +32 +select count(*) from t2; +count(*) +32 +select count(*) from t3; +count(*) +32 +select count(*) from t4; +count(*) +32 +select count(*) from t5; +count(*) +32 +insert into t1(b) select b from t1; +insert into t2(b) select b from t1; +insert into t3(b) select b from t1; +insert into t4(b) select b from t1; +insert into t5(b) select b from t1; +# 2 Restart mysqld --innodb-checksum-algorithm=innodb +select count(*) from t1; +count(*) +64 +select count(*) from t2; +count(*) +96 +select count(*) from t3; +count(*) +96 +select count(*) from t4; +count(*) +96 +select count(*) from t5; +count(*) +96 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 3 Restart mysqld --innodb-checksum-algorithm=none +select count(*) from t1; +count(*) +128 +select count(*) from t2; +count(*) +196 +select count(*) from t3; +count(*) +196 +select count(*) from t4; +count(*) +196 +select count(*) from t5; +count(*) +196 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 4 Restart mysqld --innodb-checksum-algorithm=innodb +select count(*) from t1; +count(*) +228 +select count(*) from t2; +count(*) +296 +select count(*) from t3; +count(*) +296 +select count(*) from t4; +count(*) +296 +select count(*) from t5; +count(*) +296 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 5 Restart mysqld --innodb-checksum-algorithm=strict_innodb +select count(*) from t1; +count(*) +328 +select count(*) from t2; +count(*) +396 +select count(*) from t3; +count(*) +396 +select count(*) from t4; +count(*) +396 +select count(*) from t5; +count(*) +396 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 6 Restart mysqld --innodb-checksum-algorithm=innodb +select count(*) from t1; +count(*) +428 +select count(*) from t2; +count(*) +496 +select count(*) from t3; +count(*) +496 +select count(*) from t4; +count(*) +496 +select count(*) from t5; +count(*) +496 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 7 Restart mysqld --innodb-checksum-algorithm=strict_none +select count(*) from t1; +count(*) +528 +select count(*) from t2; +count(*) +596 +select count(*) from t3; +count(*) +596 +select count(*) from t4; +count(*) +596 +select count(*) from t5; +count(*) +596 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 8 Restart mysqld --innodb-checksum-algorithm=innodb +select count(*) from t1; +count(*) +628 +select count(*) from t2; +count(*) +696 +select count(*) from t3; +count(*) +696 +select count(*) from t4; +count(*) +696 +select count(*) from t5; +count(*) +696 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 9 Restart mysqld --innodb-checksum-algorithm=strict_crc32 +select count(*) from t1; +count(*) +728 +select count(*) from t2; +count(*) +796 +select count(*) from t3; +count(*) +796 +select count(*) from t4; +count(*) +796 +select count(*) from t5; +count(*) +796 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 10 Restart mysqld --innodb-checksum-algorithm=innodb +select count(*) from t1; +count(*) +828 +select count(*) from t2; +count(*) +896 +select count(*) from t3; +count(*) +896 +select count(*) from t4; +count(*) +896 +select count(*) from t5; +count(*) +896 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# Restart mysqld --innodb-checksum-algorithm=crc32 +select count(*) from t1; +count(*) +928 +select count(*) from t2; +count(*) +996 +select count(*) from t3; +count(*) +996 +select count(*) from t4; +count(*) +996 +select count(*) from t5; +count(*) +996 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 11 Restart mysqld --innodb-checksum-algorithm=strict_crc32 +select count(*) from t1; +count(*) +1028 +select count(*) from t2; +count(*) +1096 +select count(*) from t3; +count(*) +1096 +select count(*) from t4; +count(*) +1096 +select count(*) from t5; +count(*) +1096 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 12 Restart mysqld --innodb-checksum-algorithm=crc32 +select count(*) from t1; +count(*) +1128 +select count(*) from t2; +count(*) +1196 +select count(*) from t3; +count(*) +1196 +select count(*) from t4; +count(*) +1196 +select count(*) from t5; +count(*) +1196 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 13 Restart mysqld --innodb-checksum-algorithm=strict_none +select count(*) from t1; +count(*) +1228 +select count(*) from t2; +count(*) +1296 +select count(*) from t3; +count(*) +1296 +select count(*) from t4; +count(*) +1296 +select count(*) from t5; +count(*) +1296 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 14 Restart mysqld --innodb-checksum-algorithm=crc32 +select count(*) from t1; +count(*) +1328 +select count(*) from t2; +count(*) +1396 +select count(*) from t3; +count(*) +1396 +select count(*) from t4; +count(*) +1396 +select count(*) from t5; +count(*) +1396 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 15 Restart mysqld --innodb-checksum-algorithm=strict_innodb +select count(*) from t1; +count(*) +1428 +select count(*) from t2; +count(*) +1496 +select count(*) from t3; +count(*) +1496 +select count(*) from t4; +count(*) +1496 +select count(*) from t5; +count(*) +1496 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 16 Restart mysqld --innodb-checksum-algorithm=crc32 +select count(*) from t1; +count(*) +1528 +select count(*) from t2; +count(*) +1596 +select count(*) from t3; +count(*) +1596 +select count(*) from t4; +count(*) +1596 +select count(*) from t5; +count(*) +1596 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 17 Restart mysqld --innodb-checksum-algorithm=none +select count(*) from t1; +count(*) +1628 +select count(*) from t2; +count(*) +1696 +select count(*) from t3; +count(*) +1696 +select count(*) from t4; +count(*) +1696 +select count(*) from t5; +count(*) +1696 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 18 Restart mysqld --innodb-checksum-algorithm=crc32 +select count(*) from t1; +count(*) +1728 +select count(*) from t2; +count(*) +1796 +select count(*) from t3; +count(*) +1796 +select count(*) from t4; +count(*) +1796 +select count(*) from t5; +count(*) +1796 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# Restart mysqld --innodb-checksum-algorithm=strict_crc32 +select count(*) from t1; +count(*) +1828 +select count(*) from t2; +count(*) +1896 +select count(*) from t3; +count(*) +1896 +select count(*) from t4; +count(*) +1896 +select count(*) from t5; +count(*) +1896 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 19 Restart mysqld --innodb-checksum-algorithm=strict_none +select count(*) from t1; +count(*) +1928 +select count(*) from t2; +count(*) +1996 +select count(*) from t3; +count(*) +1996 +select count(*) from t4; +count(*) +1996 +select count(*) from t5; +count(*) +1996 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 20 Restart mysqld --innodb-checksum-algorithm=strict_crc32 +select count(*) from t1; +count(*) +2028 +select count(*) from t2; +count(*) +2096 +select count(*) from t3; +count(*) +2096 +select count(*) from t4; +count(*) +2096 +select count(*) from t5; +count(*) +2096 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 21 Restart mysqld --innodb-checksum-algorithm=strict_innodb +select count(*) from t1; +count(*) +2128 +select count(*) from t2; +count(*) +2196 +select count(*) from t3; +count(*) +2196 +select count(*) from t4; +count(*) +2196 +select count(*) from t5; +count(*) +2196 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 22 Restart mysqld --innodb-checksum-algorithm=strict_crc32 +select count(*) from t1; +count(*) +2228 +select count(*) from t2; +count(*) +2296 +select count(*) from t3; +count(*) +2296 +select count(*) from t4; +count(*) +2296 +select count(*) from t5; +count(*) +2296 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 23 Restart mysqld --innodb-checksum-algorithm=none +select count(*) from t1; +count(*) +2328 +select count(*) from t2; +count(*) +2396 +select count(*) from t3; +count(*) +2396 +select count(*) from t4; +count(*) +2396 +select count(*) from t5; +count(*) +2396 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 24 Restart mysqld --innodb-checksum-algorithm=strict_crc32 +select count(*) from t1; +count(*) +2428 +select count(*) from t2; +count(*) +2496 +select count(*) from t3; +count(*) +2496 +select count(*) from t4; +count(*) +2496 +select count(*) from t5; +count(*) +2496 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# Restart mysqld --innodb-checksum-algorithm=strict_none +select count(*) from t1; +count(*) +2528 +select count(*) from t2; +count(*) +2596 +select count(*) from t3; +count(*) +2596 +select count(*) from t4; +count(*) +2596 +select count(*) from t5; +count(*) +2596 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 25 Restart mysqld --innodb-checksum-algorithm=none +select count(*) from t1; +count(*) +2628 +select count(*) from t2; +count(*) +2696 +select count(*) from t3; +count(*) +2696 +select count(*) from t4; +count(*) +2696 +select count(*) from t5; +count(*) +2696 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 26 Restart mysqld --innodb-checksum-algorithm=strict_none +select count(*) from t1; +count(*) +2728 +select count(*) from t2; +count(*) +2796 +select count(*) from t3; +count(*) +2796 +select count(*) from t4; +count(*) +2796 +select count(*) from t5; +count(*) +2796 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 27 Restart mysqld --innodb-checksum-algorithm=strict_innodb +select count(*) from t1; +count(*) +2828 +select count(*) from t2; +count(*) +2896 +select count(*) from t3; +count(*) +2896 +select count(*) from t4; +count(*) +2896 +select count(*) from t5; +count(*) +2896 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 28 Restart mysqld --innodb-checksum-algorithm=strict_none +select count(*) from t1; +count(*) +2928 +select count(*) from t2; +count(*) +2996 +select count(*) from t3; +count(*) +2996 +select count(*) from t4; +count(*) +2996 +select count(*) from t5; +count(*) +2996 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# Restart mysqld --innodb-checksum-algorithm=none +select count(*) from t1; +count(*) +3028 +select count(*) from t2; +count(*) +3096 +select count(*) from t3; +count(*) +3096 +select count(*) from t4; +count(*) +3096 +select count(*) from t5; +count(*) +3096 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 29 Restart mysqld --innodb-checksum-algorithm=strict_innodb +select count(*) from t1; +count(*) +3128 +select count(*) from t2; +count(*) +3196 +select count(*) from t3; +count(*) +3196 +select count(*) from t4; +count(*) +3196 +select count(*) from t5; +count(*) +3196 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +# 30 Restart mysqld --innodb-checksum-algorithm=none +select count(*) from t1; +count(*) +3228 +select count(*) from t2; +count(*) +3296 +select count(*) from t3; +count(*) +3296 +select count(*) from t4; +count(*) +3296 +select count(*) from t5; +count(*) +3296 +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; +drop table t1,t2,t3,t4,t5; diff --git a/mysql-test/suite/encryption/r/innodb-compressed-blob.result b/mysql-test/suite/encryption/r/innodb-compressed-blob.result index 43506092498..15c2a410948 100644 --- a/mysql-test/suite/encryption/r/innodb-compressed-blob.result +++ b/mysql-test/suite/encryption/r/innodb-compressed-blob.result @@ -1,7 +1,6 @@ call mtr.add_suppression("InnoDB: However key management plugin or used key_version .*"); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file test/t[1-3] cannot be decrypted."); +call mtr.add_suppression("Unable to decompress space ..test.t[1-3].ibd \\[[1-9][0-9]*:[0-9]+\\]"); # Restart mysqld --file-key-management-filename=keys2.txt SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; diff --git a/mysql-test/suite/encryption/t/innodb-checksum-algorithm.opt b/mysql-test/suite/encryption/t/innodb-checksum-algorithm.opt new file mode 100644 index 00000000000..8a13b909879 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-checksum-algorithm.opt @@ -0,0 +1,4 @@ +--innodb_checksum_algorithm=innodb +--innodb-tablespaces-encryption +--innodb-encrypt-tables=on +--innodb-encryption-threads=4 diff --git a/mysql-test/suite/encryption/t/innodb-checksum-algorithm.test b/mysql-test/suite/encryption/t/innodb-checksum-algorithm.test new file mode 100644 index 00000000000..baea1b8a3eb --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-checksum-algorithm.test @@ -0,0 +1,652 @@ +-- source include/have_innodb.inc +-- source include/have_file_key_management_plugin.inc + +# embedded does not support restart +-- source include/not_embedded.inc + +# +# Tests: +# +# innodb +# 1) innodb => crc32 +# 2) crc32 => innodb +# 3) innodb => none +# 4) none => innodb +# 5) innodb => strict_innodb +# 6) strict_innodb => innodb +# 7) innodb => strict_none +# 8) strict_none => innodb +# 9) innodb => strict_crc32 +# 10) strict_crc32 => innodb +# +# crc32 +# 11) crc32 => strict_crc32 +# 12) strict_crc32 => crc32 +# 13) crc32 => strict_none +# 14) strict_none => crc32 +# 15) crc32 => strict_innodb +# 16) strict_innodb => crc32 +# 17) crc32 => none +# 18) none => crc32 +# (note that innodb is handled on 1 and 2) +# +# strict_crc32 +# 19) strict_crc32 => strict_none +# 20) strict_none => strict_crc32 +# 21) strict_crc32 => strict_innodb +# 22) strict_innodb => strict_crc32 +# 23) strict_crc32 => none +# 24) none => strict_crc32 +# (note that innodb is handled on 9 and 10) +# (note that crc32 is handled on 11 and 12) +# +# strict_none +# 25) strict_none => none +# 26) none => strict_none +# 27) strict_none = strict_innodb +# 28) strict_innodb => strict_none +# (note that innodb is handled on 7 and 8) +# (note that crc32 is handled on 13 and 14) +# (note that strict_crc32 is handled 19 and 20) +# +# none +# 29) none => strict_innodb +# 30) strict_innodb => none +# (note that innodb is handled on 3 and 4) +# (note that crc32 is handled on 17 and 18) +# (note that strict_crc32 is handled on 23 and 24) +# (note that strict_none is handled on 25 and 26) +# +# strict_innodb +# (note that innodb is handled on 5 and 6) +# (note that crc32 is handled on 15 and 16) +# (note that strict_crc32 is handled on 21 and 22) +# (note that strict_none is handled on 27 and 28) +# (note that none is handled on 29 and 30) +# +--disable_warnings +SET GLOBAL innodb_file_format = `Barracuda`; +SET GLOBAL innodb_file_per_table = ON; + +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_crc32\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"innodb\". Accepting the page as valid. Change innodb_checksum_algorithm to \"crc32\" to silently accept such pages or rewrite all pages so that they contain \"crc32\" checksum."); + +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_none\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"innodb\". Accepting the page as valid. Change innodb_checksum_algorithm to \"none\" to silently accept such pages or rewrite all pages so that they contain \"none\" checksum."); + +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_crc32\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"none\". Accepting the page as valid. Change innodb_checksum_algorithm to \"crc32\" to silently accept such pages or rewrite all pages so that they contain \"crc32\" checksum."); + +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_innodb\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"none\". Accepting the page as valid. Change innodb_checksum_algorithm to \"innodb\" to silently accept such pages or rewrite all pages so that they contain \"innodb\" checksum."); + +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_innodb\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"crc32\". Accepting the page as valid. Change innodb_checksum_algorithm to \"innodb\" to silently accept such pages or rewrite all pages so that they contain \"innodb\" checksum."); + +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_none\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"crc32\". Accepting the page as valid. Change innodb_checksum_algorithm to \"none\" to silently accept such pages or rewrite all pages so that they contain \"none\" checksum."); + +--enable_warnings + +set GLOBAL innodb_default_encryption_key_id=4; +create table t1(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes; +create table t2(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb encrypted=yes; +create table t3(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=no; +create table t4(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb encrypted=no; +create table t5(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb encrypted=yes page_compressed=yes; + +begin; +insert into t1(b) values (repeat('secret',20)); +insert into t1(b) select b from t1; +insert into t1(b) select b from t1; +insert into t1(b) select b from t1; +insert into t1(b) select b from t1; +insert into t1(b) select b from t1; +insert into t2(b) select b from t1; +insert into t3(b) select b from t1; +insert into t4(b) select b from t1; +insert into t5(b) select b from t1; +commit; + +--echo # 1 Restart mysqld --innodb-checksum-algorithm=crc32 +-- let $restart_parameters=--innodb-checksum-algorithm=crc32 +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1; +insert into t2(b) select b from t1; +insert into t3(b) select b from t1; +insert into t4(b) select b from t1; +insert into t5(b) select b from t1; + +--echo # 2 Restart mysqld --innodb-checksum-algorithm=innodb +-- let $restart_parameters=--innodb-checksum-algorithm=innodb +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 3 Restart mysqld --innodb-checksum-algorithm=none +-- let $restart_parameters=--innodb-checksum-algorithm=none +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 4 Restart mysqld --innodb-checksum-algorithm=innodb +-- let $restart_parameters=--innodb-checksum-algorithm=innodb +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 5 Restart mysqld --innodb-checksum-algorithm=strict_innodb +-- let $restart_parameters=--innodb-checksum-algorithm=strict_innodb +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 6 Restart mysqld --innodb-checksum-algorithm=innodb +-- let $restart_parameters=--innodb-checksum-algorithm=innodb +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 7 Restart mysqld --innodb-checksum-algorithm=strict_none +-- let $restart_parameters=--innodb-checksum-algorithm=strict_none +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 8 Restart mysqld --innodb-checksum-algorithm=innodb +-- let $restart_parameters=--innodb-checksum-algorithm=innodb +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 9 Restart mysqld --innodb-checksum-algorithm=strict_crc32 +-- let $restart_parameters=--innodb-checksum-algorithm=strict_crc32 +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 10 Restart mysqld --innodb-checksum-algorithm=innodb +-- let $restart_parameters=--innodb-checksum-algorithm=innodb +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # Restart mysqld --innodb-checksum-algorithm=crc32 +-- let $restart_parameters=--innodb-checksum-algorithm=crc32 +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 11 Restart mysqld --innodb-checksum-algorithm=strict_crc32 +-- let $restart_parameters=--innodb-checksum-algorithm=strict_crc32 +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 12 Restart mysqld --innodb-checksum-algorithm=crc32 +-- let $restart_parameters=--innodb-checksum-algorithm=crc32 +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 13 Restart mysqld --innodb-checksum-algorithm=strict_none +-- let $restart_parameters=--innodb-checksum-algorithm=strict_none +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 14 Restart mysqld --innodb-checksum-algorithm=crc32 +-- let $restart_parameters=--innodb-checksum-algorithm=crc32 +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 15 Restart mysqld --innodb-checksum-algorithm=strict_innodb +-- let $restart_parameters=--innodb-checksum-algorithm=strict_innodb +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 16 Restart mysqld --innodb-checksum-algorithm=crc32 +-- let $restart_parameters=--innodb-checksum-algorithm=crc32 +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 17 Restart mysqld --innodb-checksum-algorithm=none +-- let $restart_parameters=--innodb-checksum-algorithm=none +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 18 Restart mysqld --innodb-checksum-algorithm=crc32 +-- let $restart_parameters=--innodb-checksum-algorithm=crc32 +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # Restart mysqld --innodb-checksum-algorithm=strict_crc32 +-- let $restart_parameters=--innodb-checksum-algorithm=strict_crc32 +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 19 Restart mysqld --innodb-checksum-algorithm=strict_none +-- let $restart_parameters=--innodb-checksum-algorithm=strict_none +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 20 Restart mysqld --innodb-checksum-algorithm=strict_crc32 +-- let $restart_parameters=--innodb-checksum-algorithm=strict_crc32 +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 21 Restart mysqld --innodb-checksum-algorithm=strict_innodb +-- let $restart_parameters=--innodb-checksum-algorithm=strict_innodb +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 22 Restart mysqld --innodb-checksum-algorithm=strict_crc32 +-- let $restart_parameters=--innodb-checksum-algorithm=strict_crc32 +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 23 Restart mysqld --innodb-checksum-algorithm=none +-- let $restart_parameters=--innodb-checksum-algorithm=none +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 24 Restart mysqld --innodb-checksum-algorithm=strict_crc32 +-- let $restart_parameters=--innodb-checksum-algorithm=strict_crc32 +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # Restart mysqld --innodb-checksum-algorithm=strict_none +-- let $restart_parameters=--innodb-checksum-algorithm=strict_none +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 25 Restart mysqld --innodb-checksum-algorithm=none +-- let $restart_parameters=--innodb-checksum-algorithm=none +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 26 Restart mysqld --innodb-checksum-algorithm=strict_none +-- let $restart_parameters=--innodb-checksum-algorithm=strict_none +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 27 Restart mysqld --innodb-checksum-algorithm=strict_innodb +-- let $restart_parameters=--innodb-checksum-algorithm=strict_innodb +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 28 Restart mysqld --innodb-checksum-algorithm=strict_none +-- let $restart_parameters=--innodb-checksum-algorithm=strict_none +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # Restart mysqld --innodb-checksum-algorithm=none +-- let $restart_parameters=--innodb-checksum-algorithm=none +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 29 Restart mysqld --innodb-checksum-algorithm=strict_innodb +-- let $restart_parameters=--innodb-checksum-algorithm=strict_innodb +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +--echo # 30 Restart mysqld --innodb-checksum-algorithm=none +-- let $restart_parameters=--innodb-checksum-algorithm=none +-- source include/restart_mysqld.inc + +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; + +insert into t1(b) select b from t1 limit 100; +insert into t2(b) select b from t1 limit 100; +insert into t3(b) select b from t1 limit 100; +insert into t4(b) select b from t1 limit 100; +insert into t5(b) select b from t1 limit 100; + +drop table t1,t2,t3,t4,t5; + + + diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations b/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations new file mode 100644 index 00000000000..e096b023b52 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.combinations @@ -0,0 +1,12 @@ +[crc32] +loose-innodb-tablespaces-encryption +loose-innodb-encrypt-tables=on +loose-innodb-encryption-threads=4 +max_allowed_packet=64K +loose-innodb-checksum-algorithm=crc32 +[none] +loose-innodb-tablespaces-encryption +loose-innodb-encrypt-tables=on +loose-innodb-encryption-threads=4 +max_allowed_packet=64K +loose-innodb-checksum-algorithm=none diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.opt b/mysql-test/suite/encryption/t/innodb-compressed-blob.opt deleted file mode 100644 index 36dcb6c6f26..00000000000 --- a/mysql-test/suite/encryption/t/innodb-compressed-blob.opt +++ /dev/null @@ -1,4 +0,0 @@ ---innodb-tablespaces-encryption ---innodb-encrypt-tables=on ---innodb-encryption-threads=2 ---max_allowed_packet=64K diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.test b/mysql-test/suite/encryption/t/innodb-compressed-blob.test index 4024c8fa641..cb69f22f745 100644 --- a/mysql-test/suite/encryption/t/innodb-compressed-blob.test +++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.test @@ -5,10 +5,8 @@ -- source include/not_embedded.inc call mtr.add_suppression("InnoDB: However key management plugin or used key_version .*"); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); - +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file test/t[1-3] cannot be decrypted."); +call mtr.add_suppression("Unable to decompress space ..test.t[1-3].ibd \\[[1-9][0-9]*:[0-9]+\\]"); --echo # Restart mysqld --file-key-management-filename=keys2.txt -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt -- cgit v1.2.1 From 112b21da37dad0fbb28bc65f9ab5a3ba6c0c2186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 30 May 2017 11:55:11 +0300 Subject: MDEV-12600: crash during install_db with innodb_page_size=32K and ibdata1=3M; Problem was that all doublewrite buffer pages must fit to first system datafile. Ported commit 27a34df7882b1f8ed283f22bf83e8bfc523cbfde Author: Shaohua Wang Date: Wed Aug 12 15:55:19 2015 +0800 BUG#21551464 - SEGFAULT WHILE INITIALIZING DATABASE WHEN INNODB_DATA_FILE SIZE IS SMALL To 10.1 (with extended error printout). btr_create(): If ibuf header page allocation fails report error and return FIL_NULL. Similarly if root page allocation fails return a error. dict_build_table_def_step: If fsp_header_init fails return error code. fsp_header_init: returns true if header initialization succeeds and false if not. fseg_create_general: report error if segment or page allocation fails. innobase_init: If first datafile is smaller than 3M and could not contain all doublewrite buffer pages report error and fail to initialize InnoDB plugin. row_truncate_table_for_mysql: report error if fsp header init fails. srv_init_abort: New function to report database initialization errors. srv_undo_tablespaces_init, innobase_start_or_create_for_mysql: If database initialization fails report error and abort. trx_rseg_create: If segment header creation fails return. --- mysql-test/suite/innodb/t/log_data_file_size.opt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/t/log_data_file_size.opt b/mysql-test/suite/innodb/t/log_data_file_size.opt index d9a364a3287..fe36abe4701 100644 --- a/mysql-test/suite/innodb/t/log_data_file_size.opt +++ b/mysql-test/suite/innodb/t/log_data_file_size.opt @@ -1,2 +1,2 @@ --loose-innodb-sys-indexes ---innodb-data-file-path=ibdata1:1M:autoextend +--innodb-data-file-path=ibdata1:3M:autoextend -- cgit v1.2.1 From aad8cefd2d0e49acb9f8ae3ebaa0e3b90f27b89c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 1 Jun 2017 14:08:41 +0300 Subject: Enable innodb_encryption-page-compression test. --- mysql-test/suite/encryption/disabled.def | 1 - mysql-test/suite/encryption/r/innodb_encryption-page-compression.result | 2 -- 2 files changed, 3 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/encryption/disabled.def b/mysql-test/suite/encryption/disabled.def index 8c263c6a458..d92d3495cb8 100644 --- a/mysql-test/suite/encryption/disabled.def +++ b/mysql-test/suite/encryption/disabled.def @@ -12,4 +12,3 @@ innodb_scrub : MDEV-8139 scrubbing does not work reliably innodb_scrub_background : MDEV-8139 scrubbing does not work reliably -innodb_encryption-page-compression : MDEV-11420 diff --git a/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result index ec92825ac8e..359f285901c 100644 --- a/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result +++ b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result @@ -1,5 +1,3 @@ -SET GLOBAL innodb_file_format = `Barracuda`; -SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_encryption_threads = 4; SET GLOBAL innodb_encrypt_tables = on; set global innodb_compression_algorithm = 1; -- cgit v1.2.1 From 3356e42d01dbef2bfa9a02ec08c7756760385e1e Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 2 Jun 2017 13:52:47 +0300 Subject: Improved warning "xxx is not BASE TABLE/SEQUENCE" - Changed warning to "'%-.192s.%-.192s' is not of type '%s'" to make the english a bit more correct --- mysql-test/suite/funcs_1/r/innodb_trig_0407.result | 2 +- mysql-test/suite/funcs_1/r/innodb_views.result | 12 ++++++------ mysql-test/suite/funcs_1/r/memory_trig_0407.result | 2 +- mysql-test/suite/funcs_1/r/memory_views.result | 12 ++++++------ mysql-test/suite/funcs_1/r/myisam_trig_0407.result | 2 +- mysql-test/suite/funcs_1/r/myisam_views-big.result | 18 +++++++++--------- mysql-test/suite/perfschema/r/view_table_io.result | 2 +- mysql-test/suite/sql_sequence/create.result | 2 +- mysql-test/suite/sql_sequence/replication.result | 2 +- 9 files changed, 27 insertions(+), 27 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result index b6a3a34207d..4753efd1794 100644 --- a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result +++ b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result @@ -245,7 +245,7 @@ Testcase 3.5.5.3: Create view vw3 as select f118 from tb3; Create trigger trg3 before INSERT on vw3 for each row set new.f118='s'; -ERROR HY000: 'test.vw3' is not BASE TABLE +ERROR HY000: 'test.vw3' is not of type 'BASE TABLE' drop view vw3; Testcase 3.5.5.4: diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result index dfe46bbf645..d81d09353e1 100644 --- a/mysql-test/suite/funcs_1/r/innodb_views.result +++ b/mysql-test/suite/funcs_1/r/innodb_views.result @@ -3520,12 +3520,12 @@ f1 DROP TRIGGER tr1 ; SET @a:=0 ; CREATE TRIGGER tr1 BEFORE INSERT ON v1 FOR EACH ROW SET @a:=1 ; -ERROR HY000: 'test.v1' is not BASE TABLE +ERROR HY000: 'test.v1' is not of type 'BASE TABLE' RENAME TABLE v1 TO v2; RENAME VIEW v2 TO v1; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'VIEW v2 TO v1' at line 1 ALTER TABLE v2 RENAME AS v1; -ERROR HY000: 'test.v2' is not BASE TABLE +ERROR HY000: 'test.v2' is not of type 'BASE TABLE' ALTER VIEW v1 RENAME AS v2; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'RENAME AS v2' at line 1 DROP TABLE IF EXISTS t1, t2 ; @@ -3535,12 +3535,12 @@ CREATE TABLE t1 ( f1 DATE, f2 BLOB, f3 DOUBLE ); CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1; ALTER TABLE t1 ADD PRIMARY KEY(f1); ALTER TABLE v1 ADD PRIMARY KEY(f1); -ERROR HY000: 'test.v1' is not BASE TABLE +ERROR HY000: 'test.v1' is not of type 'BASE TABLE' ALTER VIEW v1 ADD PRIMARY KEY(f1); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ADD PRIMARY KEY(f1)' at line 1 CREATE INDEX t1_idx ON t1(f3); CREATE INDEX v1_idx ON v1(f3); -ERROR HY000: 'test.v1' is not BASE TABLE +ERROR HY000: 'test.v1' is not of type 'BASE TABLE' DROP TABLE t1; DROP VIEW v1; @@ -4085,9 +4085,9 @@ Drop view test.v1 ; Testcase 3.3.1.14 -------------------------------------------------------------------------------- CREATE OR REPLACE VIEW test.tb2 AS SELECT * From tb2 LIMIT 2; -ERROR HY000: 'test.tb2' is not VIEW +ERROR HY000: 'test.tb2' is not of type 'VIEW' CREATE OR REPLACE VIEW tb2 AS SELECT * From tb2 LIMIT 2; -ERROR HY000: 'test.tb2' is not VIEW +ERROR HY000: 'test.tb2' is not of type 'VIEW' Testcase 3.3.1.15 -------------------------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/r/memory_trig_0407.result b/mysql-test/suite/funcs_1/r/memory_trig_0407.result index 57b14e49f72..c21c206f118 100644 --- a/mysql-test/suite/funcs_1/r/memory_trig_0407.result +++ b/mysql-test/suite/funcs_1/r/memory_trig_0407.result @@ -245,7 +245,7 @@ Testcase 3.5.5.3: Create view vw3 as select f118 from tb3; Create trigger trg3 before INSERT on vw3 for each row set new.f118='s'; -ERROR HY000: 'test.vw3' is not BASE TABLE +ERROR HY000: 'test.vw3' is not of type 'BASE TABLE' drop view vw3; Testcase 3.5.5.4: diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result index b81ea2f309b..ca24c73d933 100644 --- a/mysql-test/suite/funcs_1/r/memory_views.result +++ b/mysql-test/suite/funcs_1/r/memory_views.result @@ -3521,12 +3521,12 @@ f1 DROP TRIGGER tr1 ; SET @a:=0 ; CREATE TRIGGER tr1 BEFORE INSERT ON v1 FOR EACH ROW SET @a:=1 ; -ERROR HY000: 'test.v1' is not BASE TABLE +ERROR HY000: 'test.v1' is not of type 'BASE TABLE' RENAME TABLE v1 TO v2; RENAME VIEW v2 TO v1; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'VIEW v2 TO v1' at line 1 ALTER TABLE v2 RENAME AS v1; -ERROR HY000: 'test.v2' is not BASE TABLE +ERROR HY000: 'test.v2' is not of type 'BASE TABLE' ALTER VIEW v1 RENAME AS v2; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'RENAME AS v2' at line 1 DROP TABLE IF EXISTS t1, t2 ; @@ -3536,12 +3536,12 @@ CREATE TABLE t1 ( f1 DATE, f2 BLOB, f3 DOUBLE ); CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1; ALTER TABLE t1 ADD PRIMARY KEY(f1); ALTER TABLE v1 ADD PRIMARY KEY(f1); -ERROR HY000: 'test.v1' is not BASE TABLE +ERROR HY000: 'test.v1' is not of type 'BASE TABLE' ALTER VIEW v1 ADD PRIMARY KEY(f1); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ADD PRIMARY KEY(f1)' at line 1 CREATE INDEX t1_idx ON t1(f3); CREATE INDEX v1_idx ON v1(f3); -ERROR HY000: 'test.v1' is not BASE TABLE +ERROR HY000: 'test.v1' is not of type 'BASE TABLE' DROP TABLE t1; DROP VIEW v1; @@ -4086,9 +4086,9 @@ Drop view test.v1 ; Testcase 3.3.1.14 -------------------------------------------------------------------------------- CREATE OR REPLACE VIEW test.tb2 AS SELECT * From tb2 LIMIT 2; -ERROR HY000: 'test.tb2' is not VIEW +ERROR HY000: 'test.tb2' is not of type 'VIEW' CREATE OR REPLACE VIEW tb2 AS SELECT * From tb2 LIMIT 2; -ERROR HY000: 'test.tb2' is not VIEW +ERROR HY000: 'test.tb2' is not of type 'VIEW' Testcase 3.3.1.15 -------------------------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result index 57b14e49f72..c21c206f118 100644 --- a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result +++ b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result @@ -245,7 +245,7 @@ Testcase 3.5.5.3: Create view vw3 as select f118 from tb3; Create trigger trg3 before INSERT on vw3 for each row set new.f118='s'; -ERROR HY000: 'test.vw3' is not BASE TABLE +ERROR HY000: 'test.vw3' is not of type 'BASE TABLE' drop view vw3; Testcase 3.5.5.4: diff --git a/mysql-test/suite/funcs_1/r/myisam_views-big.result b/mysql-test/suite/funcs_1/r/myisam_views-big.result index 9296b9d98a2..feb67539cb9 100644 --- a/mysql-test/suite/funcs_1/r/myisam_views-big.result +++ b/mysql-test/suite/funcs_1/r/myisam_views-big.result @@ -4023,12 +4023,12 @@ f1 DROP TRIGGER tr1 ; SET @a:=0 ; CREATE TRIGGER tr1 BEFORE INSERT ON v1 FOR EACH ROW SET @a:=1 ; -ERROR HY000: 'test.v1' is not BASE TABLE +ERROR HY000: 'test.v1' is not of type 'BASE TABLE' RENAME TABLE v1 TO v2; RENAME VIEW v2 TO v1; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'VIEW v2 TO v1' at line 1 ALTER TABLE v2 RENAME AS v1; -ERROR HY000: 'test.v2' is not BASE TABLE +ERROR HY000: 'test.v2' is not of type 'BASE TABLE' ALTER VIEW v1 RENAME AS v2; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'RENAME AS v2' at line 1 DROP TABLE IF EXISTS t1, t2 ; @@ -4038,12 +4038,12 @@ CREATE TABLE t1 ( f1 DATE, f2 BLOB, f3 DOUBLE ); CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1; ALTER TABLE t1 ADD PRIMARY KEY(f1); ALTER TABLE v1 ADD PRIMARY KEY(f1); -ERROR HY000: 'test.v1' is not BASE TABLE +ERROR HY000: 'test.v1' is not of type 'BASE TABLE' ALTER VIEW v1 ADD PRIMARY KEY(f1); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ADD PRIMARY KEY(f1)' at line 1 CREATE INDEX t1_idx ON t1(f3); CREATE INDEX v1_idx ON v1(f3); -ERROR HY000: 'test.v1' is not BASE TABLE +ERROR HY000: 'test.v1' is not of type 'BASE TABLE' DROP TABLE t1; DROP VIEW v1; @@ -4604,9 +4604,9 @@ Drop view test.v1 ; Testcase 3.3.1.14 -------------------------------------------------------------------------------- CREATE OR REPLACE VIEW test.tb2 AS SELECT * From tb2 LIMIT 2; -ERROR HY000: 'test.tb2' is not VIEW +ERROR HY000: 'test.tb2' is not of type 'VIEW' CREATE OR REPLACE VIEW tb2 AS SELECT * From tb2 LIMIT 2; -ERROR HY000: 'test.tb2' is not VIEW +ERROR HY000: 'test.tb2' is not of type 'VIEW' Testcase 3.3.1.15 -------------------------------------------------------------------------------- @@ -4784,7 +4784,7 @@ CREATE VIEW v2 AS Select * from test.v1; ERROR 42S02: Table 'test.v1' doesn't exist DROP VIEW IF EXISTS v2; Warnings: -Note 4067 Unknown VIEW: 'test.v2' +Note 4068 Unknown VIEW: 'test.v2' Testcase 3.3.1.25 -------------------------------------------------------------------------------- @@ -8387,7 +8387,7 @@ Call sp1() ; ERROR 42000: PROCEDURE test.sp1 does not exist Drop view if exists test.v1 ; Warnings: -Note 4067 Unknown VIEW: 'test.v1' +Note 4068 Unknown VIEW: 'test.v1' Drop procedure sp1 ; ERROR 42000: PROCEDURE test.sp1 does not exist @@ -22989,7 +22989,7 @@ CREATE VIEW v1 AS SELECT f1 FROM t1; DROP VIEW IF EXISTS v1; DROP VIEW IF EXISTS v1; Warnings: -Note 4067 Unknown VIEW: 'test.v1' +Note 4068 Unknown VIEW: 'test.v1' Testcase 3.3.1.68 -------------------------------------------------------------------------------- diff --git a/mysql-test/suite/perfschema/r/view_table_io.result b/mysql-test/suite/perfschema/r/view_table_io.result index 5d8ad26ae77..2f9a70cdeaa 100644 --- a/mysql-test/suite/perfschema/r/view_table_io.result +++ b/mysql-test/suite/perfschema/r/view_table_io.result @@ -51,7 +51,7 @@ bar 2 insert into marker set a = 1; optimize table test.v1; Table Op Msg_type Msg_text -test.v1 optimize Error 'test.v1' is not BASE TABLE +test.v1 optimize Error 'test.v1' is not of type 'BASE TABLE' test.v1 optimize status Operation failed insert into marker set a = 1; select * from test.v1; diff --git a/mysql-test/suite/sql_sequence/create.result b/mysql-test/suite/sql_sequence/create.result index 4962752c7d9..71dba6c9227 100644 --- a/mysql-test/suite/sql_sequence/create.result +++ b/mysql-test/suite/sql_sequence/create.result @@ -160,7 +160,7 @@ next_value min_value max_value start increment cache cycle round drop sequence t1; create table t1 (a int); show create sequence t1; -ERROR HY000: 'test.t1' is not SEQUENCE +ERROR HY000: 'test.t1' is not of type 'SEQUENCE' drop sequence t1; ERROR 42S02: 'test.t1' is not a SEQUENCE drop sequence if exists t1; diff --git a/mysql-test/suite/sql_sequence/replication.result b/mysql-test/suite/sql_sequence/replication.result index 12355851f7b..30fa841b1f8 100644 --- a/mysql-test/suite/sql_sequence/replication.result +++ b/mysql-test/suite/sql_sequence/replication.result @@ -73,7 +73,7 @@ support create sequence connection master; create table t_1(id int); show create sequence t_1; -ERROR HY000: 's_db.t_1' is not SEQUENCE +ERROR HY000: 's_db.t_1' is not of type 'SEQUENCE' drop table t_1; CREATE SEQUENCE `s2` ( `currval` bigint(21) NOT NULL COMMENT 'current value', -- cgit v1.2.1 From 36e020a5d678103544b66dfaefe53c41b5af4af9 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Sat, 3 Jun 2017 02:47:52 +0300 Subject: Adjust storage_engine suite according to server changes in 10.2 --- mysql-test/suite/storage_engine/alter_table.result | 2 +- .../suite/storage_engine/alter_tablespace.result | 2 +- .../suite/storage_engine/create_table.result | 2 +- mysql-test/suite/storage_engine/disabled.def | 12 +++++ .../suite/storage_engine/insert_delayed.test | 2 +- mysql-test/suite/storage_engine/repair_table.inc | 3 ++ .../suite/storage_engine/repair_table.result | 3 +- .../suite/storage_engine/tbl_opt_data_dir.result | 19 ++++++++ .../suite/storage_engine/tbl_opt_data_dir.test | 52 ++++++++++++++++++++++ .../storage_engine/tbl_opt_data_index_dir.result | 16 ------- .../storage_engine/tbl_opt_data_index_dir.test | 52 ---------------------- .../suite/storage_engine/tbl_opt_index_dir.result | 19 ++++++++ .../suite/storage_engine/tbl_opt_index_dir.test | 52 ++++++++++++++++++++++ .../suite/storage_engine/tbl_opt_row_format.result | 20 +++++++-- .../suite/storage_engine/tbl_opt_row_format.test | 28 +++++++++++- .../suite/storage_engine/type_char_indexes.result | 2 +- .../suite/storage_engine/type_date_time.result | 2 +- mysql-test/suite/storage_engine/vcol.result | 24 +++++----- 18 files changed, 220 insertions(+), 92 deletions(-) create mode 100644 mysql-test/suite/storage_engine/tbl_opt_data_dir.result create mode 100644 mysql-test/suite/storage_engine/tbl_opt_data_dir.test delete mode 100644 mysql-test/suite/storage_engine/tbl_opt_data_index_dir.result delete mode 100644 mysql-test/suite/storage_engine/tbl_opt_data_index_dir.test create mode 100644 mysql-test/suite/storage_engine/tbl_opt_index_dir.result create mode 100644 mysql-test/suite/storage_engine/tbl_opt_index_dir.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/storage_engine/alter_table.result b/mysql-test/suite/storage_engine/alter_table.result index 09696e0e6b6..85db1514421 100644 --- a/mysql-test/suite/storage_engine/alter_table.result +++ b/mysql-test/suite/storage_engine/alter_table.result @@ -13,7 +13,7 @@ ALTER TABLE t1 ALTER COLUMN a SET DEFAULT '0'; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT '0', + `a` int(11) DEFAULT 0, `c` char(8) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 diff --git a/mysql-test/suite/storage_engine/alter_tablespace.result b/mysql-test/suite/storage_engine/alter_tablespace.result index b54d7c99e9e..ff3da9f68bb 100644 --- a/mysql-test/suite/storage_engine/alter_tablespace.result +++ b/mysql-test/suite/storage_engine/alter_tablespace.result @@ -10,7 +10,7 @@ a 2 ALTER TABLE t1 DISCARD TABLESPACE; SELECT a FROM t1; -ERROR HY000: Tablespace has been discarded for table 't1' +ERROR HY000: Tablespace has been discarded for table `t1` ALTER TABLE t1 IMPORT TABLESPACE; Warnings: Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t1.cfg', will attempt to import without schema verification diff --git a/mysql-test/suite/storage_engine/create_table.result b/mysql-test/suite/storage_engine/create_table.result index 87bf37046ba..6936854eb65 100644 --- a/mysql-test/suite/storage_engine/create_table.result +++ b/mysql-test/suite/storage_engine/create_table.result @@ -27,7 +27,7 @@ CREATE TABLE t1 ENGINE= AS SELECT 1 UNION SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `1` bigint(20) NOT NULL DEFAULT '0' + `1` bigint(20) NOT NULL DEFAULT 0 ) ENGINE= DEFAULT CHARSET=latin1 SELECT * FROM t1; 1 diff --git a/mysql-test/suite/storage_engine/disabled.def b/mysql-test/suite/storage_engine/disabled.def index e69de29bb2d..658d0c240db 100644 --- a/mysql-test/suite/storage_engine/disabled.def +++ b/mysql-test/suite/storage_engine/disabled.def @@ -0,0 +1,12 @@ +alter_table_online : MDEV-9705 - Field type conversion warnings have changed to worse +col_opt_null : MDEV-10252 - Row count in 'out of range' warnings is off +col_opt_not_null : MDEV-10252 - Row count in 'out of range' warnings is off +col_opt_unsigned : MDEV-10252 - Row count in 'out of range' warnings is off +col_opt_zerofill : MDEV-10252 - Row count in 'out of range' warnings is off +type_binary : MDEV-10252 - Row count in 'out of range' warnings is off +type_char : MDEV-10252 - Row count in 'out of range' warnings is off +type_fixed : MDEV-10252 - Row count in 'out of range' warnings is off +type_float : MDEV-10252 - Row count in 'out of range' warnings is off +type_int : MDEV-10252 - Row count in 'out of range' warnings is off +type_varbinary : MDEV-10252 - Row count in 'out of range' warnings is off +type_varchar : MDEV-10252 - Row count in 'out of range' warnings is off diff --git a/mysql-test/suite/storage_engine/insert_delayed.test b/mysql-test/suite/storage_engine/insert_delayed.test index 3ded1686714..ece0bf3cf68 100644 --- a/mysql-test/suite/storage_engine/insert_delayed.test +++ b/mysql-test/suite/storage_engine/insert_delayed.test @@ -1,4 +1,4 @@ -# +# # INSERT DELAYED # diff --git a/mysql-test/suite/storage_engine/repair_table.inc b/mysql-test/suite/storage_engine/repair_table.inc index aa3b4e6304d..a295b4c19f2 100644 --- a/mysql-test/suite/storage_engine/repair_table.inc +++ b/mysql-test/suite/storage_engine/repair_table.inc @@ -91,6 +91,9 @@ if ($have_default_index) call mtr.add_suppression(" '\..test.t1'"); call mtr.add_suppression("Couldn't repair table: test.t1"); + # In 10.2 with log_warnings=2 the error message is printed to the error log + call mtr.add_suppression("Table 't1' is marked as crashed.*"); + --let $create_definition = a $int_indexed_col, b $char_col, $default_index (a) --source create_table.inc REPAIR TABLE t1; diff --git a/mysql-test/suite/storage_engine/repair_table.result b/mysql-test/suite/storage_engine/repair_table.result index a20b9be3ba1..d518e47756f 100644 --- a/mysql-test/suite/storage_engine/repair_table.result +++ b/mysql-test/suite/storage_engine/repair_table.result @@ -59,6 +59,7 @@ call mtr.add_suppression("Got an error from thread_id=.*"); call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); call mtr.add_suppression(" '\..test.t1'"); call mtr.add_suppression("Couldn't repair table: test.t1"); +call mtr.add_suppression("Table 't1' is marked as crashed.*"); CREATE TABLE t1 (a , b , (a)) ENGINE= ; REPAIR TABLE t1; Table Op Msg_type Msg_text @@ -85,7 +86,7 @@ Table Op Msg_type Msg_text test.t1 check error Size of datafile is: 39 Should be: 65 test.t1 check error Corrupt SELECT a,b FROM t1; -ERROR HY000: Incorrect key file for table 't1'; try to repair it +ERROR HY000: Index for table 't1' is corrupt; try to repair it # Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). # If you got a difference in error message, just add it to rdiff file INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); diff --git a/mysql-test/suite/storage_engine/tbl_opt_data_dir.result b/mysql-test/suite/storage_engine/tbl_opt_data_dir.result new file mode 100644 index 00000000000..19b7d539b45 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_data_dir.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS t1; +# Running CREATE TABLE .. DATA DIRECTORY = <> +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE= DEFAULT CHARSET=latin1 DATA DIRECTORY='' +# For ALTER TABLE the option is ignored +# Running ALTER TABLE .. DATA DIRECTORY = <> +Warnings: +Warning 1618 option ignored +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE= DEFAULT CHARSET=latin1 DATA DIRECTORY='' +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_data_dir.test b/mysql-test/suite/storage_engine/tbl_opt_data_dir.test new file mode 100644 index 00000000000..434ca449125 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_data_dir.test @@ -0,0 +1,52 @@ +# +# Check whether DATA DIRECTORY is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only that it is accepted +# + +--source include/have_symlink.inc +--source have_engine.inc + +--let $data_dir1 = $MYSQLTEST_VARDIR/storage_engine_data_dir1/ +--let $data_dir2 = $MYSQLTEST_VARDIR/storage_engine_data_dir2/ +--mkdir $data_dir1 +--mkdir $data_dir2 + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = DATA DIRECTORY = '$data_dir1' +# We cannot mask the folder name here and further, but we can switch off query logging +--let $disable_query_log = 1 +--echo # Running CREATE TABLE .. DATA DIRECTORY = <> +--source create_table.inc + +--source mask_engine.inc +--replace_result $data_dir1 +SHOW CREATE TABLE t1; + +--echo # For ALTER TABLE the option is ignored + +--let $alter_definition = DATA DIRECTORY = '$data_dir2' +--disable_query_log +--echo # Running ALTER TABLE .. DATA DIRECTORY = <> +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--enable_query_log +--source mask_engine.inc +--replace_result $data_dir1 +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + +--rmdir $data_dir1 +--rmdir $data_dir2 diff --git a/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.result b/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.result deleted file mode 100644 index b8c5e75c88c..00000000000 --- a/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.result +++ /dev/null @@ -1,16 +0,0 @@ -DROP TABLE IF EXISTS t1; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` char(8) DEFAULT NULL -) ENGINE= DEFAULT CHARSET=latin1 DATA DIRECTORY='' INDEX DIRECTORY='' -Warnings: -Warning 1618 option ignored -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` char(8) DEFAULT NULL -) ENGINE= DEFAULT CHARSET=latin1 DATA DIRECTORY='' INDEX DIRECTORY='' -DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.test b/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.test deleted file mode 100644 index 4a83cc46b84..00000000000 --- a/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.test +++ /dev/null @@ -1,52 +0,0 @@ -# -# Check whether DATA DIRECTORY and INDEX DIRECTORY -# are supported in CREATE and ALTER TABLE -# -# Note: the test does not check whether the options -# have any real effect on the table, only -# that they are accepted -# - ---source include/have_symlink.inc ---source have_engine.inc - ---let $data_dir = $MYSQLTEST_VARDIR/storage_engine_data_dir/ ---let $index_dir = $MYSQLTEST_VARDIR/storage_engine_index_dir/ ---mkdir $data_dir ---mkdir $index_dir - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - ---let $table_options = DATA DIRECTORY = '$data_dir' INDEX DIRECTORY = '$index_dir' -# We cannot mask the folders name here, but we can switch off query logging ---let $disable_query_log = 1 ---source create_table.inc - ---source mask_engine.inc ---replace_result $data_dir $index_dir -SHOW CREATE TABLE t1; - ---let $alter_definition = INDEX DIRECTORY = '$data_dir' ---disable_query_log ---source alter_table.inc -if ($mysql_errname) -{ - --let $my_last_stmt = $alter_statement - --let $functionality = ALTER TABLE - --source unexpected_result.inc -} ---enable_query_log ---source mask_engine.inc ---replace_result $data_dir $index_dir -SHOW CREATE TABLE t1; - -DROP TABLE t1; - ---source cleanup_engine.inc - ---rmdir $data_dir ---rmdir $index_dir - - diff --git a/mysql-test/suite/storage_engine/tbl_opt_index_dir.result b/mysql-test/suite/storage_engine/tbl_opt_index_dir.result new file mode 100644 index 00000000000..c7368e9a84a --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_index_dir.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS t1; +# Running CREATE TABLE .. INDEX DIRECTORY = <> +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE= DEFAULT CHARSET=latin1 INDEX DIRECTORY='' +# For ALTER TABLE the option is ignored +# Running ALTER TABLE .. INDEX DIRECTORY = <> +Warnings: +Warning 1618 option ignored +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE= DEFAULT CHARSET=latin1 INDEX DIRECTORY='' +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_index_dir.test b/mysql-test/suite/storage_engine/tbl_opt_index_dir.test new file mode 100644 index 00000000000..03d2ef2bf82 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_index_dir.test @@ -0,0 +1,52 @@ +# +# Check whether INDEX DIRECTORY is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only that it is accepted +# + +--source include/have_symlink.inc +--source have_engine.inc + +--let $index_dir1 = $MYSQLTEST_VARDIR/storage_engine_index_dir1/ +--let $index_dir2 = $MYSQLTEST_VARDIR/storage_engine_index_dir2/ +--mkdir $index_dir1 +--mkdir $index_dir2 + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = INDEX DIRECTORY = '$index_dir1' +# We cannot mask the folder name here and further, but we can switch off query logging +--let $disable_query_log = 1 +--echo # Running CREATE TABLE .. INDEX DIRECTORY = <> +--source create_table.inc + +--source mask_engine.inc +--replace_result $index_dir1 +SHOW CREATE TABLE t1; + +--echo # For ALTER TABLE the option is ignored + +--let $alter_definition = INDEX DIRECTORY = '$index_dir2' +--disable_query_log +--echo # Running ALTER TABLE .. INDEX DIRECTORY = <> +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--enable_query_log +--source mask_engine.inc +--replace_result $index_dir1 +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + +--rmdir $index_dir1 +--rmdir $index_dir2 diff --git a/mysql-test/suite/storage_engine/tbl_opt_row_format.result b/mysql-test/suite/storage_engine/tbl_opt_row_format.result index 5f1cf713bb6..57000e295f7 100644 --- a/mysql-test/suite/storage_engine/tbl_opt_row_format.result +++ b/mysql-test/suite/storage_engine/tbl_opt_row_format.result @@ -1,16 +1,30 @@ DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (a , b ) ENGINE= ROW_FORMAT=FIXED; +CREATE TABLE t1 (a , b ) ENGINE= ROW_FORMAT=DYNAMIC; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE= DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +ALTER TABLE t1 ROW_FORMAT=FIXED; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` char(8) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED -ALTER TABLE t1 ROW_FORMAT=DYNAMIC; +ALTER TABLE t1 ROW_FORMAT=PAGE; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` char(8) DEFAULT NULL -) ENGINE= DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +) ENGINE= DEFAULT CHARSET=latin1 ROW_FORMAT=PAGE +ALTER TABLE t1 ROW_FORMAT=COMPACT; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE= DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_row_format.test b/mysql-test/suite/storage_engine/tbl_opt_row_format.test index d6347551da0..17fe2f36429 100644 --- a/mysql-test/suite/storage_engine/tbl_opt_row_format.test +++ b/mysql-test/suite/storage_engine/tbl_opt_row_format.test @@ -13,12 +13,12 @@ DROP TABLE IF EXISTS t1; --enable_warnings ---let $table_options = ROW_FORMAT=FIXED +--let $table_options = ROW_FORMAT=DYNAMIC --source create_table.inc --source mask_engine.inc SHOW CREATE TABLE t1; ---let $alter_definition = ROW_FORMAT=DYNAMIC +--let $alter_definition = ROW_FORMAT=FIXED --source alter_table.inc if ($mysql_errname) { @@ -29,6 +29,30 @@ if ($mysql_errname) --source mask_engine.inc SHOW CREATE TABLE t1; +--let $alter_definition = ROW_FORMAT=PAGE +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + + +--let $alter_definition = ROW_FORMAT=COMPACT +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + + DROP TABLE t1; --source cleanup_engine.inc diff --git a/mysql-test/suite/storage_engine/type_char_indexes.result b/mysql-test/suite/storage_engine/type_char_indexes.result index 5be07bdf53f..73c076863ab 100644 --- a/mysql-test/suite/storage_engine/type_char_indexes.result +++ b/mysql-test/suite/storage_engine/type_char_indexes.result @@ -97,7 +97,7 @@ varchar2b 1 varchar3b 1 SET SESSION optimizer_switch = 'engine_condition_pushdown=on'; Warnings: -Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release. +Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a'; id select_type table type possible_keys key key_len ref rows Extra # # # range c_v c_v # # # Using index condition diff --git a/mysql-test/suite/storage_engine/type_date_time.result b/mysql-test/suite/storage_engine/type_date_time.result index 473a7e67494..f136dd93f34 100644 --- a/mysql-test/suite/storage_engine/type_date_time.result +++ b/mysql-test/suite/storage_engine/type_date_time.result @@ -13,7 +13,7 @@ SHOW COLUMNS IN t1; Field Type Null Key Default Extra d date # # # dt datetime # # # -ts timestamp # # # on update CURRENT_TIMESTAMP +ts timestamp # # # on update current_timestamp() t time # # # y year(4) # # # y4 year(4) # # # diff --git a/mysql-test/suite/storage_engine/vcol.result b/mysql-test/suite/storage_engine/vcol.result index d51ab038576..e56a1b0543d 100644 --- a/mysql-test/suite/storage_engine/vcol.result +++ b/mysql-test/suite/storage_engine/vcol.result @@ -3,12 +3,12 @@ CREATE TABLE t1 (a , b GENERATED ALWAYS AS (a+1)) ENGIN SHOW COLUMNS IN t1; Field Type Null Key Default Extra a int(11) # # -b int(11) # # VIRTUAL +b int(11) # # VIRTUAL GENERATED INSERT INTO t1 (a) VALUES (1),(2); INSERT INTO t1 (a,b) VALUES (3,3),(4,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored SELECT a,b FROM t1; a b 1 2 @@ -20,12 +20,12 @@ CREATE TABLE t1 (a , b GENERATED ALWAYS AS (a+1) PERSIS SHOW COLUMNS IN t1; Field Type Null Key Default Extra a int(11) # # -b int(11) # # PERSISTENT +b int(11) # # STORED GENERATED INSERT INTO t1 (a) VALUES (1),(2); INSERT INTO t1 (a,b) VALUES (3,3),(4,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored SELECT a,b FROM t1; a b 1 2 @@ -37,12 +37,12 @@ CREATE TABLE t1 (a , b GENERATED ALWAYS AS (a+1) VIRTUA SHOW COLUMNS IN t1; Field Type Null Key Default Extra a int(11) # # -b int(11) # # VIRTUAL +b int(11) # # VIRTUAL GENERATED INSERT INTO t1 (a) VALUES (1),(2); INSERT INTO t1 (a,b) VALUES (3,3),(4,4); Warnings: -Warning 1906 The value specified for computed column 'b' in table 't1' ignored -Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored +Warning 1906 The value specified for generated column 'b' in table 't1' ignored SELECT a,b FROM t1; a b 1 2 @@ -54,12 +54,12 @@ CREATE TABLE t1 (a , b AS (a+1) PERSISTENT) ENGINE= Date: Sat, 3 Jun 2017 16:08:23 +0300 Subject: Fixed sequences based on comments from Peter Gulutzan and Andrii Nikitin - Changed names of SEQUENCE table columns to be more close to ANSI - Fixed error message for SHOW SEQUENCE non_existing_sequence - Allow syntax CACHE +1 - Fixed ALTER TABLE for TEMPORARY sequences. --- mysql-test/suite/sql_sequence/alter.result | 30 +-- mysql-test/suite/sql_sequence/alter.test | 2 +- mysql-test/suite/sql_sequence/aria.result | 2 +- mysql-test/suite/sql_sequence/binlog.result | 20 +- mysql-test/suite/sql_sequence/binlog.test | 8 +- mysql-test/suite/sql_sequence/create.result | 293 ++++++++++++----------- mysql-test/suite/sql_sequence/create.test | 115 ++++----- mysql-test/suite/sql_sequence/gtid.result | 68 +++--- mysql-test/suite/sql_sequence/gtid.test | 4 +- mysql-test/suite/sql_sequence/mysqldump.result | 28 +-- mysql-test/suite/sql_sequence/next.result | 172 ++++++------- mysql-test/suite/sql_sequence/next.test | 66 ++--- mysql-test/suite/sql_sequence/other.result | 26 +- mysql-test/suite/sql_sequence/other.test | 22 +- mysql-test/suite/sql_sequence/replication.result | 243 ++++++++++--------- mysql-test/suite/sql_sequence/replication.test | 105 ++++---- mysql-test/suite/sql_sequence/setval.result | 96 ++++---- mysql-test/suite/sql_sequence/setval.test | 48 ++-- mysql-test/suite/sql_sequence/temporary.result | 12 + mysql-test/suite/sql_sequence/temporary.test | 16 ++ 20 files changed, 709 insertions(+), 667 deletions(-) create mode 100644 mysql-test/suite/sql_sequence/temporary.result create mode 100644 mysql-test/suite/sql_sequence/temporary.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/sql_sequence/alter.result b/mysql-test/suite/sql_sequence/alter.result index bb57a704c11..76ebdeda0f7 100644 --- a/mysql-test/suite/sql_sequence/alter.result +++ b/mysql-test/suite/sql_sequence/alter.result @@ -6,7 +6,7 @@ Note 1051 Unknown table 'test.t1' # CREATE SEQUENCE t1 nocache engine=myisam; select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 0 0 0 select next value for t1; next value for t1 @@ -16,7 +16,7 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 50 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 2 1 9223372036854775806 50 1 0 0 0 select next value for t1; next value for t1 @@ -26,7 +26,7 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 50 minvalue -100 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 3 -100 9223372036854775806 50 1 0 0 0 alter sequence t1 minvalue=100 start=100; ERROR HY000: Sequence 'test.t1' values are conflicting @@ -35,14 +35,14 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 100 minvalue 100 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 100 100 9223372036854775806 100 1 0 0 0 alter sequence t1 maxvalue=500; show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 100 minvalue 100 maxvalue 500 increment by 1 nocache nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 100 100 500 100 1 0 0 0 drop sequence t1; CREATE SEQUENCE t1 engine=myisam; @@ -64,7 +64,7 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 0 0 0 select next value for t1; next value for t1 @@ -75,8 +75,8 @@ next value for t1 select next value for t1; next value for t1 3 -select next_value, round from t1; -next_value round +select next_not_cached_value, cycle_count from t1; +next_not_cached_value cycle_count 4 0 drop sequence t1; CREATE SEQUENCE t1 maxvalue=100 engine=myisam; @@ -85,7 +85,7 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 0 0 alter sequence t1 cycle; show create sequence t1; @@ -97,7 +97,7 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 15 minvalue 10 maxvalue 20 increment by 1 cache 1000 cycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 15 10 20 15 1 1000 1 0 select NEXT VALUE for t1 from seq_1_to_10; NEXT VALUE for t1 @@ -131,7 +131,7 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 50 minvalue -100 maxvalue 100 increment by -2 cache 1000 nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 -100 100 50 -2 1000 0 0 select NEXT VALUE for t1 from seq_1_to_10; NEXT VALUE for t1 @@ -151,7 +151,7 @@ drop sequence t1; CREATE SEQUENCE t1 cache 10 engine=innodb; select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 10 0 0 select next value for t1; next value for t1 @@ -161,7 +161,7 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 100 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 10 nocycle ENGINE=InnoDB select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 11 1 9223372036854775806 100 1 10 0 0 select next value for t1; next value for t1 @@ -195,7 +195,7 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB COMMENT='foo' select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 3001 1 9223372036854775806 1 1 1000 0 0 drop sequence t1; CREATE SEQUENCE t1 engine=myisam; @@ -227,7 +227,7 @@ next value for t1 select next value for t1; ERROR HY000: Sequence 'test.t1' has run out select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 0 1 100 50 -2 1000 0 0 alter sequence t1 restart; select next value for t1; diff --git a/mysql-test/suite/sql_sequence/alter.test b/mysql-test/suite/sql_sequence/alter.test index 584bb6f19aa..fd1809ccd2f 100644 --- a/mysql-test/suite/sql_sequence/alter.test +++ b/mysql-test/suite/sql_sequence/alter.test @@ -43,7 +43,7 @@ select * from t1; select next value for t1; select next value for t1; select next value for t1; -select next_value, round from t1; +select next_not_cached_value, cycle_count from t1; drop sequence t1; CREATE SEQUENCE t1 maxvalue=100 engine=myisam; diff --git a/mysql-test/suite/sql_sequence/aria.result b/mysql-test/suite/sql_sequence/aria.result index 8bf45563a6f..b39d85d58ca 100644 --- a/mysql-test/suite/sql_sequence/aria.result +++ b/mysql-test/suite/sql_sequence/aria.result @@ -26,7 +26,7 @@ NEXT VALUE for t1 seq 19 19 20 20 select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 21 1 9223372036854775806 1 1 10 0 0 drop sequence t1; create sequence s1; diff --git a/mysql-test/suite/sql_sequence/binlog.result b/mysql-test/suite/sql_sequence/binlog.result index b4f772a204b..f01b3234e96 100644 --- a/mysql-test/suite/sql_sequence/binlog.result +++ b/mysql-test/suite/sql_sequence/binlog.result @@ -1,15 +1,15 @@ create or replace sequence s1 cache 3; -select next value for s1, min_value from s1 where max_value> 1; -next value for s1 min_value +select next value for s1, minimum_value from s1 where maximum_value> 1; +next value for s1 minimum_value 1 1 -select next value for s1, min_value from s1 where max_value> 2; -next value for s1 min_value +select next value for s1, minimum_value from s1 where maximum_value> 2; +next value for s1 minimum_value 2 1 -select next value for s1, min_value from s1 where max_value> 3; -next value for s1 min_value +select next value for s1, minimum_value from s1 where maximum_value> 3; +next value for s1 minimum_value 3 1 -select next value for s1, min_value from s1 where max_value> 4; -next value for s1 min_value +select next value for s1, minimum_value from s1 where maximum_value> 4; +next value for s1 minimum_value 4 1 alter sequence s1 maxvalue 1000; drop sequence s1; @@ -18,12 +18,12 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create or replace sequence s1 cache 3 master-bin.000001 # Gtid # # BEGIN GTID #-#-# -master-bin.000001 # Annotate_rows # # select next value for s1, min_value from s1 where max_value> 1 +master-bin.000001 # Annotate_rows # # select next value for s1, minimum_value from s1 where maximum_value> 1 master-bin.000001 # Table_map # # table_id: # (test.s1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Gtid # # BEGIN GTID #-#-# -master-bin.000001 # Annotate_rows # # select next value for s1, min_value from s1 where max_value> 4 +master-bin.000001 # Annotate_rows # # select next value for s1, minimum_value from s1 where maximum_value> 4 master-bin.000001 # Table_map # # table_id: # (test.s1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT diff --git a/mysql-test/suite/sql_sequence/binlog.test b/mysql-test/suite/sql_sequence/binlog.test index 56d835f05ca..5f2d52d7864 100644 --- a/mysql-test/suite/sql_sequence/binlog.test +++ b/mysql-test/suite/sql_sequence/binlog.test @@ -11,10 +11,10 @@ reset master; # get rid of previous tests binlog --enable_query_log create or replace sequence s1 cache 3; -select next value for s1, min_value from s1 where max_value> 1; -select next value for s1, min_value from s1 where max_value> 2; -select next value for s1, min_value from s1 where max_value> 3; -select next value for s1, min_value from s1 where max_value> 4; +select next value for s1, minimum_value from s1 where maximum_value> 1; +select next value for s1, minimum_value from s1 where maximum_value> 2; +select next value for s1, minimum_value from s1 where maximum_value> 3; +select next value for s1, minimum_value from s1 where maximum_value> 4; # # Alter sequence diff --git a/mysql-test/suite/sql_sequence/create.result b/mysql-test/suite/sql_sequence/create.result index 71dba6c9227..d7492f9a22b 100644 --- a/mysql-test/suite/sql_sequence/create.result +++ b/mysql-test/suite/sql_sequence/create.result @@ -8,17 +8,17 @@ t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 inc show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=MyISAM SEQUENCE=1 select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 0 0 create or replace sequence t1 engine=innodb; show create sequence t1; @@ -27,17 +27,17 @@ t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 inc show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=InnoDB SEQUENCE=1 select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 0 0 create or replace sequence t1 engine=maria; show create sequence t1; @@ -46,17 +46,17 @@ t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 inc show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=Aria SEQUENCE=1 select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 0 0 create or replace sequence t1 engine=archive; ERROR HY000: Table storage engine 'ARCHIVE' does not support the create option 'SEQUENCE' @@ -67,42 +67,42 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 10 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 10 1 9223372036854775806 10 1 1000 0 0 create or replace sequence t1 minvalue=11; show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 11 minvalue 11 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 11 11 9223372036854775806 11 1 1000 0 0 create or replace sequence t1 maxvalue=13 increment by -1; show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 13 minvalue -9223372036854775807 maxvalue 13 increment by -1 cache 1000 nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 13 -9223372036854775807 13 13 -1 1000 0 0 create or replace sequence t1 increment by -1 cache 100; show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with -1 minvalue -9223372036854775807 maxvalue -1 increment by -1 cache 100 nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count -1 -9223372036854775807 -1 -1 -1 100 0 0 create or replace sequence t1 cycle; show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 cycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 1 0 create or replace sequence t1 nocycle; show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 0 0 show create sequence t1; Table Create Table @@ -112,7 +112,7 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 14 minvalue 14 maxvalue 9223372036854775806 increment by 1 cache 1000 cycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 14 14 9223372036854775806 14 1 1000 1 0 create or replace sequence t1 cycle increment by -1; show create sequence t1; @@ -124,7 +124,7 @@ create sequence if not exists t1 start with 10; Warnings: Note 1050 Table 't1' already exists select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 0 0 show create sequence t1; Table Create Table @@ -134,14 +134,14 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 10 minvalue 10 maxvalue 11 increment by 1 nocache cycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 10 10 11 10 1 0 1 0 create or replace sequence t1 start with 10 minvalue=-10 maxvalue=11 cache=10 cycle increment by 10; show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 10 minvalue -10 maxvalue 11 increment by 10 cache 10 cycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 10 -10 11 10 10 10 1 0 create or replace sequence t1 start with 10 NO MAXVALUE NO MINVALUE; create or replace sequence t1 start with 10 maxvalue 10; @@ -155,12 +155,12 @@ show create sequence t1; Table Create Table t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 0 cache 1000 nocycle ENGINE=MyISAM select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 0 1000 0 0 drop sequence t1; create table t1 (a int); show create sequence t1; -ERROR HY000: 'test.t1' is not of type 'SEQUENCE' +ERROR 42S02: 'test.t1' is not a SEQUENCE drop sequence t1; ERROR 42S02: 'test.t1' is not a SEQUENCE drop sequence if exists t1; @@ -193,46 +193,46 @@ drop sequence t1; create sequence t1; show fields from t1; Field Type Null Key Default Extra -next_value bigint(21) NO NULL -min_value bigint(21) NO NULL -max_value bigint(21) NO NULL -start bigint(21) NO NULL +next_not_cached_value bigint(21) NO NULL +minimum_value bigint(21) NO NULL +maximum_value bigint(21) NO NULL +start_value bigint(21) NO NULL increment bigint(21) NO NULL -cache bigint(21) NO NULL -cycle tinyint(1) unsigned NO NULL -round bigint(21) NO NULL +cache_size bigint(21) unsigned NO NULL +cycle_option tinyint(1) unsigned NO NULL +cycle_count bigint(21) NO NULL flush tables; show fields from t1; Field Type Null Key Default Extra -next_value bigint(21) NO NULL -min_value bigint(21) NO NULL -max_value bigint(21) NO NULL -start bigint(21) NO NULL +next_not_cached_value bigint(21) NO NULL +minimum_value bigint(21) NO NULL +maximum_value bigint(21) NO NULL +start_value bigint(21) NO NULL increment bigint(21) NO NULL -cache bigint(21) NO NULL -cycle tinyint(1) unsigned NO NULL -round bigint(21) NO NULL +cache_size bigint(21) unsigned NO NULL +cycle_option tinyint(1) unsigned NO NULL +cycle_count bigint(21) NO NULL create or replace sequence t1 engine=aria; show fields from t1; Field Type Null Key Default Extra -next_value bigint(21) NO NULL -min_value bigint(21) NO NULL -max_value bigint(21) NO NULL -start bigint(21) NO NULL +next_not_cached_value bigint(21) NO NULL +minimum_value bigint(21) NO NULL +maximum_value bigint(21) NO NULL +start_value bigint(21) NO NULL increment bigint(21) NO NULL -cache bigint(21) NO NULL -cycle tinyint(1) unsigned NO NULL -round bigint(21) NO NULL +cache_size bigint(21) unsigned NO NULL +cycle_option tinyint(1) unsigned NO NULL +cycle_count bigint(21) NO NULL show fields from t1; Field Type Null Key Default Extra -next_value bigint(21) NO NULL -min_value bigint(21) NO NULL -max_value bigint(21) NO NULL -start bigint(21) NO NULL +next_not_cached_value bigint(21) NO NULL +minimum_value bigint(21) NO NULL +maximum_value bigint(21) NO NULL +start_value bigint(21) NO NULL increment bigint(21) NO NULL -cache bigint(21) NO NULL -cycle tinyint(1) unsigned NO NULL -round bigint(21) NO NULL +cache_size bigint(21) unsigned NO NULL +cycle_option tinyint(1) unsigned NO NULL +cycle_count bigint(21) NO NULL flush tables; create or replace sequence t1 comment= "test 1"; show create sequence t1; @@ -241,14 +241,14 @@ t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 inc show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=MyISAM SEQUENCE=1 COMMENT='test 1' create or replace sequence t1 comment= "test 2" min_rows=1 max_rows=2; show create sequence t1; @@ -257,27 +257,28 @@ t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 inc show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=MyISAM MIN_ROWS=1 MAX_ROWS=2 SEQUENCE=1 COMMENT='test 2' create or replace sequence t1 start=1 increment= 2; create or replace sequence t1 start 1 increment 2; +create or replace sequence t1 cache +1; drop sequence t1; CREATE TABLE t1 ( -`next_value` bigint(21) NOT NULL, -`min_value` bigint(21) NOT NULL, -`max_value` bigint(21) NOT NULL, -`start` bigint(21) NOT NULL, +`next_not_cached_value` bigint(21) NOT NULL, +`minimum_value` bigint(21) NOT NULL, +`maximum_value` bigint(21) NOT NULL, +`start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, -`cache` bigint(21) NOT NULL, -`cycle` tinyint(1) unsigned NOT NULL, -`round` bigint(21) NOT NULL +`cache_size` bigint(21) unsigned NOT NULL, +`cycle_option` tinyint(1) unsigned NOT NULL, +`cycle_count` bigint(21) NOT NULL ) sequence=1; show create sequence t1; Table Create Table @@ -285,93 +286,93 @@ t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 inc show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `next_value` bigint(21) NOT NULL, - `min_value` bigint(21) NOT NULL, - `max_value` bigint(21) NOT NULL, - `start` bigint(21) NOT NULL, + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, - `cache` bigint(21) NOT NULL, - `cycle` tinyint(1) unsigned NOT NULL, - `round` bigint(21) NOT NULL + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL, + `cycle_count` bigint(21) NOT NULL ) ENGINE=MyISAM SEQUENCE=1 drop sequence t1; CREATE OR REPLACE TABLE t1 ( -`next_val` bigint(21) NOT NULL, -`min_value` bigint(21) NOT NULL, -`max_value` bigint(21) NOT NULL, -`start` bigint(21) NOT NULL, +`next_not_cached_value` bigint(21) NOT NULL, +`minimum_value` bigint(21) NOT NULL, +`maximum_value` bigint(21) NOT NULL, +`start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, -`cache` bigint(21) NOT NULL, -`cycle` tinyint(1) unsigned NOT NULL, -`round` bigint(21) NOT NULL +`cache_size` bigint(21) unsigned NOT NULL, +`cycle_option` tinyint(1) unsigned NOT NULL, +`cycle_count_not_exists` bigint(21) NOT NULL ) sequence=1; -ERROR HY000: Sequence 'test.t1' table structure is invalid (next_val) +ERROR HY000: Sequence 'test.t1' table structure is invalid (cycle_count_not_exists) CREATE OR REPLACE TABLE t1 ( -`next_value` int(21) NOT NULL, -`min_value` bigint(21) NOT NULL, -`max_value` bigint(21) NOT NULL, -`start` bigint(21) NOT NULL, +`next_not_cached_value` int(21) NOT NULL, +`minimum_value` bigint(21) NOT NULL, +`maximum_value` bigint(21) NOT NULL, +`start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, -`cache` bigint(21) NOT NULL, -`cycle` tinyint(1) unsigned NOT NULL, -`round` bigint(21) NOT NULL +`cache_size` bigint(21) unsigned NOT NULL, +`cycle_option` tinyint(1) unsigned NOT NULL, +`cycle_count` bigint(21) NOT NULL ) sequence=1; -ERROR HY000: Sequence 'test.t1' table structure is invalid (next_value) +ERROR HY000: Sequence 'test.t1' table structure is invalid (next_not_cached_value) CREATE OR REPLACE TABLE t1 ( -`next_val` bigint(21) NOT NULL, -`min_value` bigint(21) NOT NULL, -`max_value` bigint(21) NOT NULL, -`start` bigint(21) NOT NULL, +`next_not_cached_value` bigint(21) NOT NULL, +`minimum_value` bigint(21) NOT NULL, +`maximum_value` bigint(21) NOT NULL, +`start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, -`cache` bigint(21) NOT NULL, +`cache_size` bigint(21) unsigned NOT NULL, `cycle` bigint(21) unsigned NOT NULL, /* error */ -`round` bigint(21) NOT NULL +`cycle_count` bigint(21) NOT NULL ) sequence=1; -ERROR HY000: Sequence 'test.t1' table structure is invalid (next_val) +ERROR HY000: Sequence 'test.t1' table structure is invalid (cycle) CREATE OR REPLACE TABLE t1 ( -`next_value` bigint(21), -`min_value` bigint(21) NOT NULL, -`max_value` bigint(21) NOT NULL, -`start` bigint(21) NOT NULL, +`next_not_cached_value` bigint(21), /* error */ +`minimum_value` bigint(21) NOT NULL, +`maximum_value` bigint(21) NOT NULL, +`start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, -`cache` bigint(21) NOT NULL, -`cycle` tinyint(1) unsigned NOT NULL, -`round` bigint(21) NOT NULL +`cache_size` bigint(21) unsigned NOT NULL, +`cycle_option` tinyint(1) unsigned NOT NULL, +`cycle_count` bigint(21) NOT NULL ) sequence=1; -ERROR HY000: Sequence 'test.t1' table structure is invalid (next_value) +ERROR HY000: Sequence 'test.t1' table structure is invalid (next_not_cached_value) CREATE OR REPLACE TABLE t1 ( -`next_value` bigint(21) NOT NULL, -`min_value` bigint(21) NOT NULL, -`max_value` bigint(21) NOT NULL, -`start` bigint(21) NOT NULL, +`next_not_cached_value` bigint(21) NOT NULL, +`minimum_value` bigint(21) NOT NULL, +`maximum_value` bigint(21) NOT NULL, +`start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, -`cache` bigint(21) NOT NULL, -`cycle` tinyint(1) unsigned NOT NULL, -`round` bigint(21) NOT NULL, +`cache_size` bigint(21) unsigned NOT NULL, +`cycle_option` tinyint(1) unsigned NOT NULL, +`cycle_count` bigint(21) NOT NULL, extra_field bigint(21) ) sequence=1; ERROR HY000: Sequence 'test.t1' table structure is invalid (Wrong number of columns) CREATE OR REPLACE TABLE t1 ( -`min_value` bigint(21) NOT NULL, -`max_value` bigint(21) NOT NULL, -`next_value` bigint(21) NOT NULL, -`start` bigint(21) NOT NULL, +`minimum_value` bigint(21) NOT NULL, +`next_not_cached_value` bigint(21) NOT NULL, +`maximum_value` bigint(21) NOT NULL, +`start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, -`cache` bigint(21) NOT NULL, -`cycle` tinyint(1) unsigned NOT NULL, -`round` bigint(21) NOT NULL +`cache_size` bigint(21) unsigned NOT NULL, +`cycle_option` tinyint(1) unsigned NOT NULL, +`cycle_count` bigint(21) NOT NULL ) sequence=1; -ERROR HY000: Sequence 'test.t1' table structure is invalid (min_value) +ERROR HY000: Sequence 'test.t1' table structure is invalid (minimum_value) CREATE OR REPLACE TABLE t1 ( -`next_value` bigint(21) NOT NULL, -`min_value` bigint(21) NOT NULL, -`max_value` bigint(21) NOT NULL, -`start` bigint(21) NOT NULL, +`next_not_cached_value` bigint(21) NOT NULL, +`minimum_value` bigint(21) NOT NULL, +`maximum_value` bigint(21) NOT NULL, +`start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, -`cache` bigint(21) NOT NULL, -`cycle` tinyint(1) unsigned NOT NULL, -`round` bigint(21) NOT NULL, -key key1 (next_value) +`cache_size` bigint(21) unsigned NOT NULL, +`cycle_option` tinyint(1) unsigned NOT NULL, +`cycle_count` bigint(21) NOT NULL, +key key1 (next_not_cached_value) ) sequence=1; ERROR HY000: Sequence 'test.t1' table structure is invalid (Sequence tables cannot have any keys) drop sequence if exists t1; diff --git a/mysql-test/suite/sql_sequence/create.test b/mysql-test/suite/sql_sequence/create.test index cf094c2cedd..23c32939efc 100644 --- a/mysql-test/suite/sql_sequence/create.test +++ b/mysql-test/suite/sql_sequence/create.test @@ -92,7 +92,7 @@ drop sequence t1; # create table t1 (a int); ---error ER_WRONG_OBJECT +--error ER_NOT_SEQUENCE show create sequence t1; --error ER_NOT_SEQUENCE2 drop sequence t1; @@ -149,6 +149,7 @@ show create sequence t1; show create table t1; create or replace sequence t1 start=1 increment= 2; create or replace sequence t1 start 1 increment 2; +create or replace sequence t1 cache +1; drop sequence t1; # @@ -156,14 +157,14 @@ drop sequence t1; # CREATE TABLE t1 ( - `next_value` bigint(21) NOT NULL, - `min_value` bigint(21) NOT NULL, - `max_value` bigint(21) NOT NULL, - `start` bigint(21) NOT NULL, + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, - `cache` bigint(21) NOT NULL, - `cycle` tinyint(1) unsigned NOT NULL, - `round` bigint(21) NOT NULL + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL, + `cycle_count` bigint(21) NOT NULL ) sequence=1; show create sequence t1; @@ -174,40 +175,40 @@ drop sequence t1; --error ER_SEQUENCE_INVALID_TABLE_STRUCTURE CREATE OR REPLACE TABLE t1 ( - `next_val` bigint(21) NOT NULL, - `min_value` bigint(21) NOT NULL, - `max_value` bigint(21) NOT NULL, - `start` bigint(21) NOT NULL, + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, - `cache` bigint(21) NOT NULL, - `cycle` tinyint(1) unsigned NOT NULL, - `round` bigint(21) NOT NULL + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL, + `cycle_count_not_exists` bigint(21) NOT NULL ) sequence=1; # Wrong type --error ER_SEQUENCE_INVALID_TABLE_STRUCTURE CREATE OR REPLACE TABLE t1 ( - `next_value` int(21) NOT NULL, - `min_value` bigint(21) NOT NULL, - `max_value` bigint(21) NOT NULL, - `start` bigint(21) NOT NULL, + `next_not_cached_value` int(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, - `cache` bigint(21) NOT NULL, - `cycle` tinyint(1) unsigned NOT NULL, - `round` bigint(21) NOT NULL + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL, + `cycle_count` bigint(21) NOT NULL ) sequence=1; --error ER_SEQUENCE_INVALID_TABLE_STRUCTURE CREATE OR REPLACE TABLE t1 ( - `next_val` bigint(21) NOT NULL, - `min_value` bigint(21) NOT NULL, - `max_value` bigint(21) NOT NULL, - `start` bigint(21) NOT NULL, + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, - `cache` bigint(21) NOT NULL, + `cache_size` bigint(21) unsigned NOT NULL, `cycle` bigint(21) unsigned NOT NULL, /* error */ - `round` bigint(21) NOT NULL + `cycle_count` bigint(21) NOT NULL ) sequence=1; @@ -215,28 +216,28 @@ CREATE OR REPLACE TABLE t1 ( --error ER_SEQUENCE_INVALID_TABLE_STRUCTURE CREATE OR REPLACE TABLE t1 ( - `next_value` bigint(21), - `min_value` bigint(21) NOT NULL, - `max_value` bigint(21) NOT NULL, - `start` bigint(21) NOT NULL, + `next_not_cached_value` bigint(21), /* error */ + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, - `cache` bigint(21) NOT NULL, - `cycle` tinyint(1) unsigned NOT NULL, - `round` bigint(21) NOT NULL + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL, + `cycle_count` bigint(21) NOT NULL ) sequence=1; # Extra field --error ER_SEQUENCE_INVALID_TABLE_STRUCTURE CREATE OR REPLACE TABLE t1 ( - `next_value` bigint(21) NOT NULL, - `min_value` bigint(21) NOT NULL, - `max_value` bigint(21) NOT NULL, - `start` bigint(21) NOT NULL, + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, - `cache` bigint(21) NOT NULL, - `cycle` tinyint(1) unsigned NOT NULL, - `round` bigint(21) NOT NULL, + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL, + `cycle_count` bigint(21) NOT NULL, extra_field bigint(21) ) sequence=1; @@ -244,29 +245,29 @@ CREATE OR REPLACE TABLE t1 ( --error ER_SEQUENCE_INVALID_TABLE_STRUCTURE CREATE OR REPLACE TABLE t1 ( - `min_value` bigint(21) NOT NULL, - `max_value` bigint(21) NOT NULL, - `next_value` bigint(21) NOT NULL, - `start` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `next_not_cached_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, - `cache` bigint(21) NOT NULL, - `cycle` tinyint(1) unsigned NOT NULL, - `round` bigint(21) NOT NULL + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL, + `cycle_count` bigint(21) NOT NULL ) sequence=1; # key --error ER_SEQUENCE_INVALID_TABLE_STRUCTURE CREATE OR REPLACE TABLE t1 ( - `next_value` bigint(21) NOT NULL, - `min_value` bigint(21) NOT NULL, - `max_value` bigint(21) NOT NULL, - `start` bigint(21) NOT NULL, + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL, `increment` bigint(21) NOT NULL, - `cache` bigint(21) NOT NULL, - `cycle` tinyint(1) unsigned NOT NULL, - `round` bigint(21) NOT NULL, - key key1 (next_value) + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL, + `cycle_count` bigint(21) NOT NULL, + key key1 (next_not_cached_value) ) sequence=1; drop sequence if exists t1; diff --git a/mysql-test/suite/sql_sequence/gtid.result b/mysql-test/suite/sql_sequence/gtid.result index ce8e8b7bb80..4c0a4e0e8fc 100644 --- a/mysql-test/suite/sql_sequence/gtid.result +++ b/mysql-test/suite/sql_sequence/gtid.result @@ -24,28 +24,28 @@ create sequence s1; show create table s1; Table Create Table s1 CREATE TABLE `s1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=MyISAM SEQUENCE=1 connection slave; use s_db; show create table s1; Table Create Table s1 CREATE TABLE `s1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=MyISAM SEQUENCE=1 connection master; use s_db; @@ -161,13 +161,13 @@ priv test connection m_normal_1; create sequence s_db.s1; select * from s_db.s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 0 0 select next value for s_db.s1; next value for s_db.s1 1 select * from s_db.s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1001 1 9223372036854775806 1 1 1000 0 0 create sequence s_db.s2; drop sequence s_db.s2; @@ -250,20 +250,20 @@ connection slave; connection s_normal_3; use s_db; select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 20 1 1 5 1 0 connection m_normal_1; select next value for s_t; next value for s_t 1 select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 6 1 20 1 1 5 1 0 connection master; connection slave; connection s_normal_3; select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 6 1 20 1 1 5 1 0 ------------------------------------------ master update nextval; @@ -272,12 +272,12 @@ connection m_normal_1; select next value for s_t; next value for s_t 2 -update s_t set next_value= 11; +update s_t set next_not_cached_value= 11; ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s_t` doesn't have this option alter sequence s_t restart=11; commit; select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 11 1 20 1 1 5 1 0 connection master; connection slave; @@ -286,29 +286,29 @@ show slave nextval; ------------------------------------------ connection s_normal_3; select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 11 1 20 1 1 5 1 0 connection m_normal_1; select next value for s_t; next value for s_t 11 select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 16 1 20 1 1 5 1 0 connection master; connection slave; connection s_normal_3; select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 16 1 20 1 1 5 1 0 ------------------------------------------ update into invalid sequence ------------------------------------------ connection m_normal_1; select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 16 1 20 1 1 5 1 0 -update s_t set next_value= 11,start=10, min_value=11; +update s_t set next_not_cached_value= 11,start_value=10, minimum_value=11; ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s_t` doesn't have this option ALTER SEQUENCE s_t restart with 11 start=10 minvalue=11; ERROR HY000: Sequence 's_db.s_t' values are conflicting @@ -549,14 +549,14 @@ next value for s1 4 commit; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 5 1 9223372036854775806 1 1 2 0 0 connection master; connection slave; connection slave; use s_db; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 5 1 9223372036854775806 1 1 2 0 0 ------------------------------------------ close session binlog. @@ -577,14 +577,14 @@ next value for s1 8 set session sql_log_bin=on; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 9 1 9223372036854775806 1 1 2 0 0 connection master; connection slave; connection slave; use s_db; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 5 1 9223372036854775806 1 1 2 0 0 connection m_normal_1; use s_db; @@ -609,13 +609,13 @@ select next value for s1; next value for s1 1 select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 3 1 9223372036854775806 1 1 2 0 0 connection master; connection slave; use s_db; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 3 1 9223372036854775806 1 1 2 0 0 connection m_normal_1; use s_db; @@ -788,7 +788,7 @@ select * from t1; a 1 select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1001 1 9223372036854775806 1 1 1000 0 0 select previous value for s1; previous value for s1 @@ -810,7 +810,7 @@ a (next value for s1) 2 3 do setval(s1,10000,0); select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 10000 1 9223372036854775806 1 1 1000 0 0 connection m_normal_2; drop table t1; diff --git a/mysql-test/suite/sql_sequence/gtid.test b/mysql-test/suite/sql_sequence/gtid.test index 98760119b53..a354062a05c 100644 --- a/mysql-test/suite/sql_sequence/gtid.test +++ b/mysql-test/suite/sql_sequence/gtid.test @@ -263,7 +263,7 @@ select * from s_t; connection m_normal_1; select next value for s_t; --error ER_ILLEGAL_HA -update s_t set next_value= 11; +update s_t set next_not_cached_value= 11; alter sequence s_t restart=11; commit; @@ -295,7 +295,7 @@ select * from s_t; connection m_normal_1; select * from s_t; --error ER_ILLEGAL_HA -update s_t set next_value= 11,start=10, min_value=11; +update s_t set next_not_cached_value= 11,start_value=10, minimum_value=11; --error ER_SEQUENCE_INVALID_DATA ALTER SEQUENCE s_t restart with 11 start=10 minvalue=11; commit; diff --git a/mysql-test/suite/sql_sequence/mysqldump.result b/mysql-test/suite/sql_sequence/mysqldump.result index 30f0719f16e..0067709db54 100644 --- a/mysql-test/suite/sql_sequence/mysqldump.result +++ b/mysql-test/suite/sql_sequence/mysqldump.result @@ -5,14 +5,14 @@ CREATE SEQUENCE x1 engine=innodb; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `a1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=Aria SEQUENCE=1; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `a1` VALUES (1,1,9223372036854775806,1,1,1000,0,0); @@ -27,14 +27,14 @@ INSERT INTO `t1` VALUES (1),(2); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `x1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=InnoDB SEQUENCE=1; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `x1` VALUES (1,1,9223372036854775806,1,1,1000,0,0); diff --git a/mysql-test/suite/sql_sequence/next.result b/mysql-test/suite/sql_sequence/next.result index b7d3a8ff26d..a10c131e0e1 100644 --- a/mysql-test/suite/sql_sequence/next.result +++ b/mysql-test/suite/sql_sequence/next.result @@ -2,80 +2,80 @@ CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 2 cy show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=MyISAM SEQUENCE=1 select next value for t1; next value for t1 1 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 3 0 select next value for t1; next value for t1 2 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 3 0 select next value for t1; next value for t1 3 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 5 0 select next value for t1; next value for t1 4 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 5 0 select next value for t1; next value for t1 5 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 7 0 select next value for t1; next value for t1 6 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 7 0 select next value for t1; next value for t1 7 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 9 0 select next value for t1; next value for t1 8 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 9 0 select next value for t1; next value for t1 9 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 11 0 select next value for t1; next value for t1 10 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 11 0 select next value for t1; next value for t1 1 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 3 1 select NEXT VALUE for t1,seq from seq_1_to_20; NEXT VALUE for t1 seq @@ -104,68 +104,68 @@ CREATE SEQUENCE t1 minvalue 1 maxvalue 10 increment by -1 cache 2 cycle engine=a select next value for t1; next value for t1 10 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 8 0 select next value for t1; next value for t1 9 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 8 0 select next value for t1; next value for t1 8 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 6 0 select next value for t1; next value for t1 7 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 6 0 select next value for t1; next value for t1 6 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 4 0 select next value for t1; next value for t1 5 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 4 0 select next value for t1; next value for t1 4 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 2 0 select next value for t1; next value for t1 3 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 2 0 select next value for t1; next value for t1 2 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 0 0 select next value for t1; next value for t1 1 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 0 0 select next value for t1; next value for t1 10 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 8 1 select NEXT VALUE for t1,seq from seq_1_to_20; NEXT VALUE for t1 seq @@ -235,7 +235,7 @@ select next value for t1; next value for t1 1 select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 11 1 100 1 1 10 0 0 flush tables; select next value for t1; @@ -284,58 +284,58 @@ seq previous value for t9 NEXT VALUE for t9 previous value for t9 19 10 1 1 20 1 2 2 select * from t9; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 6 1 10 1 1 5 1 2 drop sequence t9; CREATE SEQUENCE s1 cache=0; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 0 0 0 select next value for s1; next value for s1 1 -select next_value from s1; -next_value +select next_not_cached_value from s1; +next_not_cached_value 2 select next value for s1; next value for s1 2 -select next_value from s1; -next_value +select next_not_cached_value from s1; +next_not_cached_value 3 DROP SEQUENCE s1; CREATE SEQUENCE s1 cache=1; -select next_value from s1; -next_value +select next_not_cached_value from s1; +next_not_cached_value 1 select next value for s1; next value for s1 1 -select next_value from s1; -next_value +select next_not_cached_value from s1; +next_not_cached_value 2 select next value for s1; next value for s1 2 -select next_value from s1; -next_value +select next_not_cached_value from s1; +next_not_cached_value 3 DROP SEQUENCE s1; CREATE SEQUENCE s1 cache=2; -select next_value from s1; -next_value +select next_not_cached_value from s1; +next_not_cached_value 1 select next value for s1; next value for s1 1 -select next_value from s1; -next_value +select next_not_cached_value from s1; +next_not_cached_value 3 select next value for s1; next value for s1 2 -select next_value from s1; -next_value +select next_not_cached_value from s1; +next_not_cached_value 3 DROP SEQUENCE s1; CREATE SEQUENCE s1; @@ -353,7 +353,7 @@ next value for s1 4 alter sequence s1 increment -2; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1001 1 9223372036854775806 1 -2 1000 0 0 select next value for s1; next value for s1 @@ -404,17 +404,17 @@ INCREMENT BY 1 START WITH 3984356 CACHE 20 CYCLE engine=innodb; show create table s1; Table Create Table s1 CREATE TABLE `s1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=InnoDB SEQUENCE=1 select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 3984356 1 9999999999 3984356 1 20 1 0 select NEXT VALUE FOR s1; NEXT VALUE FOR s1 @@ -426,24 +426,24 @@ select NEXT VALUE FOR s1; NEXT VALUE FOR s1 3984358 select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 3984376 1 9999999999 3984356 1 20 1 0 FLUSH TABLES; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 3984376 1 9999999999 3984356 1 20 1 0 select NEXT VALUE FOR s1; NEXT VALUE FOR s1 3984376 select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 3984396 1 9999999999 3984356 1 20 1 0 drop sequence s1; CREATE SEQUENCE t1 start with 5 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle; explain select next value for t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used -explain select next value for t1, min_value from t1; +explain select next value for t1, minimum_value from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 drop table t1; @@ -472,7 +472,7 @@ a b drop table t1,s1; CREATE OR REPLACE SEQUENCE s1 MINVALUE 1 MAXVALUE 9999999999 INCREMENT BY 1 START WITH 3984356 nocache CYCLE engine='innodb'; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 3984356 1 9999999999 3984356 1 0 1 0 select next value for s1; next value for s1 @@ -496,8 +496,8 @@ create sequence t1; select next value for t1; next value for t1 1 -select next value for t1, min_value; -ERROR 42S22: Unknown column 'min_value' in 'field list' +select next value for t1, minimum_value; +ERROR 42S22: Unknown column 'minimum_value' in 'field list' drop sequence t1; # # MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions diff --git a/mysql-test/suite/sql_sequence/next.test b/mysql-test/suite/sql_sequence/next.test index cf67b7a2752..271c4a6558a 100644 --- a/mysql-test/suite/sql_sequence/next.test +++ b/mysql-test/suite/sql_sequence/next.test @@ -8,27 +8,27 @@ CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 2 cycle; show create table t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select NEXT VALUE for t1,seq from seq_1_to_20; @@ -36,27 +36,27 @@ drop sequence t1; CREATE SEQUENCE t1 minvalue 1 maxvalue 10 increment by -1 cache 2 cycle engine=aria; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select NEXT VALUE for t1,seq from seq_1_to_20; @@ -85,7 +85,7 @@ select next value for s1; drop sequence s1; # -# Test that flush tables jumps to next next_value +# Test that flush tables jumps to next next_not_cached_value # CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 100 increment by 1 cache 10; @@ -116,23 +116,23 @@ drop sequence t9; CREATE SEQUENCE s1 cache=0; select * from s1; select next value for s1; -select next_value from s1; +select next_not_cached_value from s1; select next value for s1; -select next_value from s1; +select next_not_cached_value from s1; DROP SEQUENCE s1; CREATE SEQUENCE s1 cache=1; -select next_value from s1; +select next_not_cached_value from s1; select next value for s1; -select next_value from s1; +select next_not_cached_value from s1; select next value for s1; -select next_value from s1; +select next_not_cached_value from s1; DROP SEQUENCE s1; CREATE SEQUENCE s1 cache=2; -select next_value from s1; +select next_not_cached_value from s1; select next value for s1; -select next_value from s1; +select next_not_cached_value from s1; select next value for s1; -select next_value from s1; +select next_not_cached_value from s1; DROP SEQUENCE s1; # @@ -196,7 +196,7 @@ drop sequence s1; CREATE SEQUENCE t1 start with 5 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle; explain select next value for t1; -explain select next value for t1, min_value from t1; +explain select next value for t1, minimum_value from t1; drop table t1; # @@ -244,7 +244,7 @@ drop table t1; create sequence t1; select next value for t1; --error ER_BAD_FIELD_ERROR -select next value for t1, min_value; +select next value for t1, minimum_value; drop sequence t1; --echo # diff --git a/mysql-test/suite/sql_sequence/other.result b/mysql-test/suite/sql_sequence/other.result index ea72e264b34..c415ac38064 100644 --- a/mysql-test/suite/sql_sequence/other.result +++ b/mysql-test/suite/sql_sequence/other.result @@ -37,16 +37,16 @@ select next value for s1; next value for s1 1001 select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 2001 1 9223372036854775806 1 1 1000 0 0 drop sequence s1; # -# ÌNSERT +# INSERT # create sequence s1; create sequence s2; -insert into s1 (next_value, min_value) values (100,1000); -ERROR HY000: Field 'max_value' doesn't have a default value +insert into s1 (next_not_cached_value, minimum_value) values (100,1000); +ERROR HY000: Field 'maximum_value' doesn't have a default value insert into s1 values (next value for s1, 1,9223372036854775806,1,1,1000,0,0); ERROR HY000: Table 's1' is specified twice, both as a target for 'INSERT' and as a separate source for data insert into s1 values (next value for s2, 1,9223372036854775806,1,1,1000,0,0); @@ -58,17 +58,17 @@ ERROR HY000: Sequence 'test.s1' values are conflicting insert into s1 values(0,9223372036854775806,1,1,1,1000,0,0); ERROR HY000: Sequence 'test.s1' values are conflicting select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 0 0 insert into s1 values(1000,1,9223372036854775806,1,1,1000,0,0); select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1000 1 9223372036854775806 1 1 1000 0 0 select next value for s1; next value for s1 1000 select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 2000 1 9223372036854775806 1 1 1000 0 0 insert into s2 values(0, 1, 10, 1, 2, 1, 1, 0); ERROR HY000: Sequence 'test.s2' values are conflicting @@ -77,9 +77,9 @@ drop sequence s1,s2; # UPDATE and DELETE # create sequence s1; -update s1 set next_value=100; +update s1 set next_not_cached_value=100; ERROR HY000: Storage engine SEQUENCE of the table `test`.`s1` doesn't have this option -delete from s1 where next_value > 0; +delete from s1 where next_not_cached_value > 0; ERROR HY000: Storage engine SEQUENCE of the table `test`.`s1` doesn't have this option drop sequence s1; # @@ -106,7 +106,7 @@ drop view v1; create sequence s1 engine=innodb; LOCK TABLES s1 READ; SELECT * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 0 0 UNLOCK TABLES; LOCK TABLES s1 WRITE; @@ -123,7 +123,7 @@ count(nextval(s1)) 2000 commit; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 2001 1 9223372036854775806 1 1 1000 0 0 drop sequence s1; create sequence s1 cache=1000 engine=innodb; @@ -138,13 +138,13 @@ select count(nextval(s1)) from seq_1_to_2000; count(nextval(s1)) 2000 select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 4001 1 9223372036854775806 1 1 1000 0 0 commit; disconnect addconroot; connection default; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 4001 1 9223372036854775806 1 1 1000 0 0 commit; drop sequence s1; diff --git a/mysql-test/suite/sql_sequence/other.test b/mysql-test/suite/sql_sequence/other.test index 0caeb342bc9..d816ec7c108 100644 --- a/mysql-test/suite/sql_sequence/other.test +++ b/mysql-test/suite/sql_sequence/other.test @@ -29,13 +29,13 @@ select * from s1; drop sequence s1; --echo # ---echo # ÌNSERT +--echo # INSERT --echo # create sequence s1; create sequence s2; --error ER_NO_DEFAULT_FOR_FIELD -insert into s1 (next_value, min_value) values (100,1000); +insert into s1 (next_not_cached_value, minimum_value) values (100,1000); --error ER_UPDATE_TABLE_USED insert into s1 values (next value for s1, 1,9223372036854775806,1,1,1000,0,0); --error ER_WRONG_INSERT_INTO_SEQUENCE @@ -61,9 +61,9 @@ drop sequence s1,s2; create sequence s1; --error ER_ILLEGAL_HA -update s1 set next_value=100; +update s1 set next_not_cached_value=100; --error ER_ILLEGAL_HA -delete from s1 where next_value > 0; +delete from s1 where next_not_cached_value > 0; drop sequence s1; --echo # @@ -117,3 +117,17 @@ connection default; select * from s1; commit; drop sequence s1; + +--echo # +--echo # Flush tables with read lock +--echo # + +create sequence s1; +select next value for s1; +flush tables with read lock; +--error 1223 +create sequence s2; +--error 1223 +select next value for s1; +unlock tables; +drop sequence s1; diff --git a/mysql-test/suite/sql_sequence/replication.result b/mysql-test/suite/sql_sequence/replication.result index 30fa841b1f8..5c7d45614e9 100644 --- a/mysql-test/suite/sql_sequence/replication.result +++ b/mysql-test/suite/sql_sequence/replication.result @@ -23,27 +23,27 @@ create sequence s1; show create table s1; Table Create Table s1 CREATE TABLE `s1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=MyISAM SEQUENCE=1 connection slave; show create table s1; Table Create Table s1 CREATE TABLE `s1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=MyISAM SEQUENCE=1 connection master; drop sequence s1; @@ -73,38 +73,37 @@ support create sequence connection master; create table t_1(id int); show create sequence t_1; -ERROR HY000: 's_db.t_1' is not of type 'SEQUENCE' +ERROR 42S02: 's_db.t_1' is not a SEQUENCE drop table t_1; CREATE SEQUENCE `s2` ( -`currval` bigint(21) NOT NULL COMMENT 'current value', -`nextval` bigint(21) NOT NULL COMMENT 'next value', -`minvalue` bigint(21) NOT NULL COMMENT 'min value', -`maxvalue` bigint(21) NOT NULL COMMENT 'max value', -`start` bigint(21) NOT NULL COMMENT 'start value', -`increment` bigint(21) NOT NULL COMMENT 'increment value', -`cache` bigint(21) NOT NULL COMMENT 'cache size', -`cycle` bigint(21) NOT NULL COMMENT 'cycle state', -`round` bigint(21) NOT NULL COMMENT 'already how many round' +`next_not_cached_value` bigint(21) NOT NULL, +`minimum_value` bigint(21) NOT NULL, +`maximum_value` bigint(21) NOT NULL, +`start_value` bigint(21) NOT NULL, +`increment` bigint(21) NOT NULL, +`cache_size` bigint(21) unsigned NOT NULL, +`cycle_option` tinyint(1) unsigned NOT NULL, +`cycle_count` bigint(21) NOT NULL ) ENGINE=InnoDB sequence=1; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '( -`currval` bigint(21) NOT NULL COMMENT 'current value', -`nextval` bigint(21) NO' at line 1 +`next_not_cached_value` bigint(21) NOT NULL, +`minimum_value` bigint(21) NOT NU' at line 1 CREATE TABLE `s2` ( -`next_value` bigint(21) NOT NULL COMMENT 'next value', -`min_value` bigint(21) NOT NULL COMMENT 'min value', -`max_value` bigint(21) NOT NULL COMMENT 'max value', -`start` bigint(21) NOT NULL COMMENT 'start value', -`increment` bigint(21) NOT NULL COMMENT 'increment value', -`cache` bigint(21) NOT NULL COMMENT 'cache size', -`cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', -`round` bigint(21) NOT NULL COMMENT 'already how many round' +`next_not_cached_value` bigint(21) NOT NULL, +`minimum_value` bigint(21) NOT NULL, +`maximum_value` bigint(21) NOT NULL, +`start_value` bigint(21) NOT NULL, +`increment` bigint(21) NOT NULL, +`cache_size` bigint(21) unsigned NOT NULL, +`cycle_option` tinyint(1) unsigned NOT NULL, +`cycle_count` bigint(21) NOT NULL ) ENGINE=InnoDB sequence=1; insert into s2 values(1, 1, 10, 1, 2, 1, 1, 0); commit; select * for s2; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's2' at line 1 select * from s2; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 10 1 2 1 1 0 select NEXT VALUE for s2; NEXT VALUE for s2 @@ -128,25 +127,25 @@ select NEXT VALUE for s2; NEXT VALUE for s2 3 select * from s2; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 5 1 10 1 2 1 1 1 commit; connection master; connection slave; select * from s2; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 5 1 10 1 2 1 1 1 connection master; drop sequence s2; CREATE TABLE `s2` ( -`next_value` bigint(21) NOT NULL COMMENT 'next value', -`min_value` bigint(21) NOT NULL COMMENT 'min value', -`max_value` bigint(21) NOT NULL COMMENT 'max value', -`start` bigint(21) NOT NULL COMMENT 'start value', -`increment` bigint(21) NOT NULL COMMENT 'increment value', -`cache` bigint(21) NOT NULL COMMENT 'cache size', -`cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', -`round` bigint(21) NOT NULL COMMENT 'already how many round' +`next_not_cached_value` bigint(21) NOT NULL, +`minimum_value` bigint(21) NOT NULL, +`maximum_value` bigint(21) NOT NULL, +`start_value` bigint(21) NOT NULL, +`increment` bigint(21) NOT NULL, +`cache_size` bigint(21) unsigned NOT NULL, +`cycle_option` tinyint(1) unsigned NOT NULL, +`cycle_count` bigint(21) NOT NULL ) ENGINE=myisam DEFAULT CHARSET=latin1 sequence=1; show create sequence s2; Table Create Table @@ -159,7 +158,7 @@ connection master; create sequence s2; create table t2 (id int); select * from s2; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 0 0 select * from t2; id @@ -171,7 +170,7 @@ NEXT VALUE for s2 select NEXT VALUE for t2; ERROR 42S02: 's_db.t2' is not a SEQUENCE select * from s2, t2; -next_value min_value max_value start increment cache cycle round id +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count id 1001 1 9223372036854775806 1 1 1000 0 0 1 select * for s2; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's2' at line 1 @@ -191,7 +190,7 @@ show create sequence s2_2; Table Create Table s2_2 CREATE SEQUENCE `s2_2` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM select * from s2_2; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 0 0 truncate table s2_2; ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s2_2` doesn't have this option @@ -339,7 +338,7 @@ show global variables like 'read_only'; Variable_name Value read_only OFF select * from s_db.s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 1000 0 0 connection master; connection slave; @@ -360,7 +359,7 @@ connection master; connection slave; connection s_normal_3; select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 20 1 1 5 1 0 connection m_normal_1; select next value for s_t; @@ -369,8 +368,8 @@ next value for s_t connection master; connection slave; connection s_normal_3; -select next_value from s_t; -next_value +select next_not_cached_value from s_t; +next_not_cached_value 6 ------------------------------------------ master ALTER SEQUENCE @@ -381,7 +380,7 @@ next value for s_t 2 alter sequence s_t restart= 11; select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 11 1 20 1 1 5 1 0 connection master; connection slave; @@ -390,7 +389,7 @@ show slave nextval; ------------------------------------------ connection s_normal_3; select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 11 1 20 1 1 5 1 0 connection m_normal_1; select next value for s_t; @@ -400,7 +399,7 @@ connection master; connection slave; connection s_normal_3; select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 16 1 20 1 1 5 1 0 ------------------------------------------ update into invalid sequence @@ -410,17 +409,17 @@ select next value for s_t; next value for s_t 12 select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 16 1 20 1 1 5 1 0 alter sequence s_t minvalue=11 maxvalue=9; ERROR HY000: Sequence 's_db.s_t' values are conflicting select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 16 1 20 1 1 5 1 0 alter sequence s_t restart= 12 start=10 minvalue=11 maxvalue=20; ERROR HY000: Sequence 's_db.s_t' values are conflicting select * from s_t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 16 1 20 1 1 5 1 0 ------------------------------------------ delete sequence row @@ -457,7 +456,7 @@ id 2 2222 select * from s_1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 6 1 9223372036854775806 1 1 5 0 0 connection master; connection slave; @@ -505,7 +504,7 @@ id 2 2222 select * from s_1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 11 1 9223372036854775806 1 1 5 0 0 select next value for s_1; next value for s_1 @@ -643,12 +642,12 @@ next value for s1 4 commit; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 5 1 9223372036854775806 1 1 2 0 0 connection master; connection slave; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 5 1 9223372036854775806 1 1 2 0 0 ------------------------------------------ close session binlog. @@ -669,23 +668,23 @@ next value for s1 8 set session sql_log_bin=on; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 9 1 9223372036854775806 1 1 2 0 0 connection master; connection slave; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 5 1 9223372036854775806 1 1 2 0 0 connection master; select next value for s1; next value for s1 9 select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 11 1 9223372036854775806 1 1 2 0 0 connection slave; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 11 1 9223372036854775806 1 1 2 0 0 connection master; drop sequence s1; @@ -711,7 +710,7 @@ next value for s1 connection master; connection slave; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 3 1 9223372036854775806 1 1 2 0 0 connection m_normal_1; drop sequence s1; @@ -733,12 +732,12 @@ select next value for s1; next value for s1 2 select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 3 1 9223372036854775806 1 1 2 0 0 connection master; connection slave; select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 3 1 9223372036854775806 1 1 2 0 0 connection m_normal_1; drop sequence s1; @@ -784,7 +783,7 @@ connection m_normal_1; create sequence s1 cache 2; create table t as select * from s1; select * from t; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 2 0 0 drop table t; create table t as select next value for s1; @@ -918,7 +917,7 @@ test value boundary ########################################### connection m_normal_1; ------------------------------------------ -round increment by round +cycle_count increment by cycle_count ------------------------------------------ create sequence s1 start with 5 minvalue 2 maxvalue 7 cache 1 cycle; select next value for s1; @@ -950,39 +949,39 @@ next value for s1 select next value for s1; ERROR HY000: Sequence 's_db.s1' has run out select * from s1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 8 2 7 5 1 10 0 0 drop sequence s1; create sequence s1 start with 2 minvalue 1 maxvalue 3 increment by 3 nocache cycle; select next value for s1; next value for s1 2 -select next_value,round from s1; -next_value round +select next_not_cached_value,cycle_count from s1; +next_not_cached_value cycle_count 4 0 select next value for s1; next value for s1 1 -select next_value,round from s1; -next_value round +select next_not_cached_value,cycle_count from s1; +next_not_cached_value cycle_count 4 1 select next value for s1; next value for s1 1 -select next_value,round from s1; -next_value round +select next_not_cached_value,cycle_count from s1; +next_not_cached_value cycle_count 4 2 select next value for s1; next value for s1 1 -select next_value,round from s1; -next_value round +select next_not_cached_value,cycle_count from s1; +next_not_cached_value cycle_count 4 3 select next value for s1; next value for s1 1 -select next_value,round from s1; -next_value round +select next_not_cached_value,cycle_count from s1; +next_not_cached_value cycle_count 4 4 drop sequence s1; create sequence s1 start with 2 minvalue 1 maxvalue 3 increment by 3 cache 2 nocycle; @@ -996,67 +995,67 @@ drop sequence s1; beyond ulonglong maxvalue ------------------------------------------ create sequence s1 start with 9223372036854775805 minvalue 9223372036854775804 maxvalue 9223372036854775806 cache 1 cycle; -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775805 0 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775806 0 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775804 0 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775805 1 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775806 1 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775804 1 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775805 2 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775806 2 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775804 2 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775805 3 drop sequence s1; create sequence s1 start with 9223372036854775805 minvalue 9223372036854775804 maxvalue 9223372036854775806 cache 10 cycle; -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775805 0 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775806 0 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775804 0 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775805 1 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775806 1 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775804 1 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775805 2 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775806 2 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775804 2 -select next value for s1, round from s1; -next value for s1 round +select next value for s1, cycle_count from s1; +next value for s1 cycle_count 9223372036854775805 3 drop sequence s1; connection master; diff --git a/mysql-test/suite/sql_sequence/replication.test b/mysql-test/suite/sql_sequence/replication.test index c1a28a9b5c4..7bd6f00e2ed 100644 --- a/mysql-test/suite/sql_sequence/replication.test +++ b/mysql-test/suite/sql_sequence/replication.test @@ -79,33 +79,32 @@ drop sequence s2; connection master; create table t_1(id int); ---error ER_WRONG_OBJECT +--error ER_NOT_SEQUENCE show create sequence t_1; drop table t_1; --error ER_PARSE_ERROR CREATE SEQUENCE `s2` ( - `currval` bigint(21) NOT NULL COMMENT 'current value', - `nextval` bigint(21) NOT NULL COMMENT 'next value', - `minvalue` bigint(21) NOT NULL COMMENT 'min value', - `maxvalue` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', - `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` bigint(21) NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'already how many round' + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL, + `increment` bigint(21) NOT NULL, + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL, + `cycle_count` bigint(21) NOT NULL ) ENGINE=InnoDB sequence=1; CREATE TABLE `s2` ( - `next_value` bigint(21) NOT NULL COMMENT 'next value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', - `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'already how many round' + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL, + `increment` bigint(21) NOT NULL, + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL, + `cycle_count` bigint(21) NOT NULL ) ENGINE=InnoDB sequence=1; insert into s2 values(1, 1, 10, 1, 2, 1, 1, 0); @@ -131,14 +130,14 @@ connection master; drop sequence s2; CREATE TABLE `s2` ( - `next_value` bigint(21) NOT NULL COMMENT 'next value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', - `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'already how many round' + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL, + `increment` bigint(21) NOT NULL, + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL, + `cycle_count` bigint(21) NOT NULL ) ENGINE=myisam DEFAULT CHARSET=latin1 sequence=1; show create sequence s2; @@ -355,7 +354,7 @@ connection master; --sync_slave_with_master connection s_normal_3; -select next_value from s_t; +select next_not_cached_value from s_t; --echo ------------------------------------------ --echo master ALTER SEQUENCE @@ -785,7 +784,7 @@ drop sequence s1; connection m_normal_1; --echo ------------------------------------------ ---echo round increment by round +--echo cycle_count increment by cycle_count --echo ------------------------------------------ create sequence s1 start with 5 minvalue 2 maxvalue 7 cache 1 cycle; select next value for s1; @@ -806,15 +805,15 @@ drop sequence s1; create sequence s1 start with 2 minvalue 1 maxvalue 3 increment by 3 nocache cycle; select next value for s1; -select next_value,round from s1; +select next_not_cached_value,cycle_count from s1; select next value for s1; -select next_value,round from s1; +select next_not_cached_value,cycle_count from s1; select next value for s1; -select next_value,round from s1; +select next_not_cached_value,cycle_count from s1; select next value for s1; -select next_value,round from s1; +select next_not_cached_value,cycle_count from s1; select next value for s1; -select next_value,round from s1; +select next_not_cached_value,cycle_count from s1; drop sequence s1; create sequence s1 start with 2 minvalue 1 maxvalue 3 increment by 3 cache 2 nocycle; @@ -827,29 +826,29 @@ drop sequence s1; --echo beyond ulonglong maxvalue --echo ------------------------------------------ create sequence s1 start with 9223372036854775805 minvalue 9223372036854775804 maxvalue 9223372036854775806 cache 1 cycle; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; drop sequence s1; create sequence s1 start with 9223372036854775805 minvalue 9223372036854775804 maxvalue 9223372036854775806 cache 10 cycle; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; -select next value for s1, round from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; +select next value for s1, cycle_count from s1; drop sequence s1; connection master; diff --git a/mysql-test/suite/sql_sequence/setval.result b/mysql-test/suite/sql_sequence/setval.result index 8e68a717cbf..b7cda27cf96 100644 --- a/mysql-test/suite/sql_sequence/setval.result +++ b/mysql-test/suite/sql_sequence/setval.result @@ -5,26 +5,26 @@ Note 1051 Unknown table 'test.t1' # Test setval function # CREATE SEQUENCE t1 cache 10 engine=myisam; -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 1 0 do setval(t1,10); -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 11 0 select next value for t1; next value for t1 11 do setval(t1,12,1); -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 21 0 select next value for t1; next value for t1 13 do setval(t1,15,0); -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 21 0 select next value for t1; next value for t1 @@ -39,15 +39,15 @@ do setval(t1,1000,0); select next value for t1; next value for t1 1000 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 1010 0 do setval(t1,2000,0); select next value for t1; next value for t1 2000 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 2010 0 select setval(t1,1000,0); setval(t1,1000,0) @@ -61,8 +61,8 @@ NULL select next value for t1; next value for t1 2002 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 2010 0 select setval(t1,2002,0); setval(t1,2002,0) @@ -76,40 +76,40 @@ setval(t1,2010,0) select next value for t1; next value for t1 2010 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 2020 0 drop sequence t1; # # Testing with cycle # CREATE SEQUENCE t1 cache=10 maxvalue=100 cycle engine=innodb; -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 1 0 select setval(t1,100,0); setval(t1,100,0) 100 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 100 0 select next value for t1; next value for t1 100 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 101 0 select setval(t1,100,0); setval(t1,100,0) NULL -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 101 0 select next value for t1; next value for t1 1 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 11 1 select next value for t1; next value for t1 @@ -117,8 +117,8 @@ next value for t1 select setval(t1,100,0,1); setval(t1,100,0,1) 100 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 100 1 select next value for t1; next value for t1 @@ -126,8 +126,8 @@ next value for t1 select setval(t1,100,1,2); setval(t1,100,1,2) 100 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 101 2 select next value for t1; next value for t1 @@ -135,8 +135,8 @@ next value for t1 select setval(t1,100,0,3); setval(t1,100,0,3) 100 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 100 3 select next value for t1; next value for t1 @@ -146,27 +146,27 @@ drop sequence t1; # Testing extreme values # CREATE SEQUENCE t1 cache=10 maxvalue=100 engine=innodb; -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 1 0 select setval(t1,200); setval(t1,200) 200 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 101 0 select next value for t1; ERROR HY000: Sequence 'test.t1' has run out drop sequence t1; CREATE SEQUENCE t1 cache=10 maxvalue=100 cycle engine=innodb; -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 1 0 select setval(t1,200); setval(t1,200) 200 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 101 0 select next value for t1; next value for t1 @@ -176,8 +176,8 @@ CREATE SEQUENCE t1 cache=10 maxvalue=0 increment=-10; select setval(t1,-10); setval(t1,-10) -10 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count -20 0 select next value for t1; next value for t1 @@ -185,8 +185,8 @@ next value for t1 select setval(t1,-15); setval(t1,-15) NULL -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count -120 0 select next value for t1; next value for t1 @@ -214,8 +214,8 @@ CREATE SEQUENCE t1 cache=10 maxvalue=0 increment=-10; select setval(t1,-10,0); setval(t1,-10,0) -10 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count -10 0 select next value for t1; next value for t1 @@ -231,8 +231,8 @@ setval(t1,10,0) setval(t1,15,1) setval(t1,5,1) select next value for t1; next value for t1 16 -select next_value,round from t1; -next_value round +select next_not_cached_value,cycle_count from t1; +next_not_cached_value cycle_count 1016 0 explain extended select setval(t1,100),setval(t1,100,TRUE),setval(t1,100,FALSE,50); id select_type table type possible_keys key key_len ref rows filtered Extra diff --git a/mysql-test/suite/sql_sequence/setval.test b/mysql-test/suite/sql_sequence/setval.test index dbb2620d4e4..8f8059fdcae 100644 --- a/mysql-test/suite/sql_sequence/setval.test +++ b/mysql-test/suite/sql_sequence/setval.test @@ -8,35 +8,35 @@ drop table if exists t1; --echo # CREATE SEQUENCE t1 cache 10 engine=myisam; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; do setval(t1,10); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; do setval(t1,12,1); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; do setval(t1,15,0); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; select setval(t1,16,0); select next value for t1; do setval(t1,1000,0); select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; do setval(t1,2000,0); select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; # Set smaller value select setval(t1,1000,0); select next value for t1; select setval(t1,1000,TRUE); select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select setval(t1,2002,0); select next value for t1; select setval(t1,2010,0); select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; drop sequence t1; --echo # @@ -44,24 +44,24 @@ drop sequence t1; --echo # CREATE SEQUENCE t1 cache=10 maxvalue=100 cycle engine=innodb; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select setval(t1,100,0); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select setval(t1,100,0); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; select setval(t1,100,0,1); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; select setval(t1,100,1,2); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; select setval(t1,100,0,3); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; drop sequence t1; @@ -70,26 +70,26 @@ drop sequence t1; --echo # CREATE SEQUENCE t1 cache=10 maxvalue=100 engine=innodb; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select setval(t1,200); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; --error ER_SEQUENCE_RUN_OUT select next value for t1; drop sequence t1; CREATE SEQUENCE t1 cache=10 maxvalue=100 cycle engine=innodb; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select setval(t1,200); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; drop sequence t1; CREATE SEQUENCE t1 cache=10 maxvalue=0 increment=-10; select setval(t1,-10); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; select setval(t1,-15); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; select setval(t1,-500,FALSE); select next value for t1; @@ -101,7 +101,7 @@ drop sequence t1; CREATE SEQUENCE t1 cache=10 maxvalue=0 increment=-10; select setval(t1,-10,0); -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; select next value for t1; drop sequence t1; @@ -112,7 +112,7 @@ drop sequence t1; CREATE SEQUENCE t1; select setval(t1,10,0),setval(t1,15,1),setval(t1,5,1); select next value for t1; -select next_value,round from t1; +select next_not_cached_value,cycle_count from t1; explain extended select setval(t1,100),setval(t1,100,TRUE),setval(t1,100,FALSE,50); drop sequence t1; diff --git a/mysql-test/suite/sql_sequence/temporary.result b/mysql-test/suite/sql_sequence/temporary.result new file mode 100644 index 00000000000..4885b5f8a26 --- /dev/null +++ b/mysql-test/suite/sql_sequence/temporary.result @@ -0,0 +1,12 @@ +# +# Create +# +create temporary sequence s1 engine=innodb; +alter table s1 engine myisam; +select nextval(s1); +nextval(s1) +1 +select * from s1; +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count +1001 1 9223372036854775806 1 1 1000 0 0 +drop temporary sequence s1; diff --git a/mysql-test/suite/sql_sequence/temporary.test b/mysql-test/suite/sql_sequence/temporary.test new file mode 100644 index 00000000000..158f6b4961e --- /dev/null +++ b/mysql-test/suite/sql_sequence/temporary.test @@ -0,0 +1,16 @@ +--source include/have_sequence.inc +--source include/have_innodb.inc + +# +# Test temporary sequences +# + +--echo # +--echo # Create +--echo # + +create temporary sequence s1 engine=innodb; +alter table s1 engine myisam; +select nextval(s1); +select * from s1; +drop temporary sequence s1; -- cgit v1.2.1 From da61107fc8481b03ae858188dd03b3114e7aa084 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Mon, 5 Jun 2017 13:10:24 +0530 Subject: MDEV-9544 FLUSH [RELAY] LOGS does not rotate logs for a named slave Problem:- In the case of multisource replication/named slave when we run "FLUSH LOGS" , it does not flush logs. Solution:- A new function Master_info_index->flush_all_relay_logs() is created which will rotate relay logs for all named slave. This will be called in reload_acl_and_cache function when connection_name.length == 0 --- mysql-test/suite/multi_source/mdev-9544.cnf | 22 +++++ mysql-test/suite/multi_source/mdev-9544.result | 78 +++++++++++++++++ mysql-test/suite/multi_source/mdev-9544.test | 116 +++++++++++++++++++++++++ 3 files changed, 216 insertions(+) create mode 100644 mysql-test/suite/multi_source/mdev-9544.cnf create mode 100644 mysql-test/suite/multi_source/mdev-9544.result create mode 100644 mysql-test/suite/multi_source/mdev-9544.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/multi_source/mdev-9544.cnf b/mysql-test/suite/multi_source/mdev-9544.cnf new file mode 100644 index 00000000000..b43aca5370d --- /dev/null +++ b/mysql-test/suite/multi_source/mdev-9544.cnf @@ -0,0 +1,22 @@ +!include my.cnf + +[mysqld.1] +log-bin +log-slave-updates + +[mysqld.2] +log-bin +log-slave-updates + +[mysqld.3] +log-bin +log-slave-updates + +[mysqld.4] +server-id=4 +log-bin=server4-bin +log-slave-updates + +[ENV] +SERVER_MYPORT_4= @mysqld.4.port +SERVER_MYSOCK_4= @mysqld.4.socket diff --git a/mysql-test/suite/multi_source/mdev-9544.result b/mysql-test/suite/multi_source/mdev-9544.result new file mode 100644 index 00000000000..e7e4bcda8ff --- /dev/null +++ b/mysql-test/suite/multi_source/mdev-9544.result @@ -0,0 +1,78 @@ +create database a; +use a; +create table t1(a int); +insert into t1 values(1); +create table t2(a int); +insert into t2 values(1); +create database b; +use b; +create table t1(a int); +insert into t1 values(1); +create table t2(a int); +insert into t2 values(1); +create database c; +use c; +create table t1(a int); +insert into t1 values(1); +create table t2(a int); +insert into t2 values(1); +change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root'; +change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root'; +change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root'; +start all slaves; +set default_master_connection = 'm1'; +include/wait_for_slave_to_start.inc +set default_master_connection = 'm2'; +include/wait_for_slave_to_start.inc +set default_master_connection = ''; +include/wait_for_slave_to_start.inc +use a; +show tables; +Tables_in_a +t1 +t2 +use b; +show tables; +Tables_in_b +t1 +t2 +use c; +show tables; +Tables_in_c +t1 +t2 +#TEST +SET default_master_connection = "m1"; +SET default_master_connection = "m2"; +SET default_master_connection = ""; +flush logs; +SET default_master_connection = "m1"; +#log Rotated +mysqld-relay-bin.000002 +mysqld-relay-bin.000003 +mysqld-relay-bin.index +SET default_master_connection = "m2"; +#log Rotated +mysqld-relay-bin-m1.000002 +mysqld-relay-bin-m1.000003 +mysqld-relay-bin-m1.index +SET default_master_connection = ""; +#log Rotated +mysqld-relay-bin-m2.000002 +mysqld-relay-bin-m2.000003 +mysqld-relay-bin-m2.index +#CleanUp +drop database a; +drop database b; +drop database c; +stop all slaves; +Warnings: +Note 1938 SLAVE 'm2' stopped +Note 1938 SLAVE '' stopped +Note 1938 SLAVE 'm1' stopped +SET default_master_connection = "m1"; +include/wait_for_slave_to_stop.inc +SET default_master_connection = "m2"; +include/wait_for_slave_to_stop.inc +SET default_master_connection = ""; +include/wait_for_slave_to_stop.inc diff --git a/mysql-test/suite/multi_source/mdev-9544.test b/mysql-test/suite/multi_source/mdev-9544.test new file mode 100644 index 00000000000..f532a63a585 --- /dev/null +++ b/mysql-test/suite/multi_source/mdev-9544.test @@ -0,0 +1,116 @@ +--source include/not_embedded.inc +--source include/have_innodb.inc +--source include/have_debug.inc + +--connect (server_1,127.0.0.1,root,,,$SERVER_MYPORT_1) +--connect (server_2,127.0.0.1,root,,,$SERVER_MYPORT_2) +--connect (server_3,127.0.0.1,root,,,$SERVER_MYPORT_3) +--connect (server_4,127.0.0.1,root,,,$SERVER_MYPORT_4) + +--connection server_1 +create database a; +use a; +create table t1(a int); +insert into t1 values(1); +create table t2(a int); +insert into t2 values(1); +--save_master_pos + +--connection server_2 +create database b; +use b; +create table t1(a int); +insert into t1 values(1); +create table t2(a int); +insert into t2 values(1); +--save_master_pos + +--connection server_3 +create database c; +use c; +create table t1(a int); +insert into t1 values(1); +create table t2(a int); +insert into t2 values(1); +--save_master_pos + +--connection server_4 +--disable_warnings +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root'; +--replace_result $SERVER_MYPORT_2 MYPORT_2 +eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root'; +--replace_result $SERVER_MYPORT_3 MYPORT_3 +eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root'; +start all slaves; +set default_master_connection = 'm1'; +--source include/wait_for_slave_to_start.inc +set default_master_connection = 'm2'; +--source include/wait_for_slave_to_start.inc +set default_master_connection = ''; +--source include/wait_for_slave_to_start.inc + +--enable_warnings +--sync_with_master 0,'m1' +--sync_with_master 0,'m2' +--sync_with_master 0,'' +use a; +show tables; +use b; +show tables; +use c; +show tables; +--echo #TEST +SET default_master_connection = "m1"; +--let $old_m1 = query_get_value("show relaylog events;", "Log_name",1) +SET default_master_connection = "m2"; +--let $old_m2 = query_get_value("show relaylog events;", "Log_name",1) +SET default_master_connection = ""; +--let $old__ = query_get_value("show relaylog events;", "Log_name",1) +flush logs; +--sleep 2 +--let $MYSQLD_DATADIR = `select @@datadir` +SET default_master_connection = "m1"; +--let $new_m1 = query_get_value("show relaylog events;", "Log_name",1) +--if ($new_m1 != $old_m1) { + --echo #log Rotated + --exec ls $MYSQLD_DATADIR | grep "mysqld-relay-bin\." +} +SET default_master_connection = "m2"; +--let $new_m2 = query_get_value("show relaylog events;", "Log_name",1) +--if ($new_m2 != $old_m2) { + --echo #log Rotated + --exec ls $MYSQLD_DATADIR | grep "mysqld-relay-bin-m1" +} +SET default_master_connection = ""; +--let $new__ = query_get_value("show relaylog events;", "Log_name",1) +--if ($new__ != $old__) { + --echo #log Rotated + --exec ls $MYSQLD_DATADIR | grep "mysqld-relay-bin-m2" +} + +--echo #CleanUp +--connection server_1 +drop database a; +--save_master_pos + +--connection server_2 +drop database b; +--save_master_pos + +--connection server_3 +drop database c; +--save_master_pos + +--connection server_4 +--sync_with_master 0,'m1' +--sync_with_master 0,'m2' +--sync_with_master 0,'' +stop all slaves; +SET default_master_connection = "m1"; +--source include/wait_for_slave_to_stop.inc +SET default_master_connection = "m2"; +--source include/wait_for_slave_to_stop.inc +SET default_master_connection = ""; +--source include/wait_for_slave_to_stop.inc + -- cgit v1.2.1 From d8d39721dfef6b965d782e6099493c36150585cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 6 Jun 2017 09:34:09 +0300 Subject: Follow-up to MDEV-12042 (test innodb_page_size variants) innodb_page_size_small: A new set of combinations, for innodb_page_size up to 16k. In MariaDB 10.0, this does not make a difference, but in 10.1 and later, innodb_page_size would cover 32k and 64k, for which ROW_FORMAT=COMPRESSED is not available. Enable these combinations in a few InnoDB tests. --- mysql-test/suite/innodb/t/innodb-alter-debug.test | 2 +- mysql-test/suite/innodb/t/innodb-alter-discard.test | 2 +- mysql-test/suite/innodb/t/innodb-alter-nullable.test | 2 +- mysql-test/suite/innodb/t/innodb-alter-table.test | 2 +- mysql-test/suite/innodb/t/innodb-alter-tempfile.test | 3 +-- mysql-test/suite/innodb_zip/r/innodb-zip.result | 2 -- mysql-test/suite/innodb_zip/t/innodb-create-options.test | 2 +- mysql-test/suite/innodb_zip/t/innodb-zip.test | 11 +---------- mysql-test/suite/innodb_zip/t/innodb_bug36169.test | 2 +- mysql-test/suite/innodb_zip/t/innodb_bug36172.test | 2 +- mysql-test/suite/innodb_zip/t/innodb_bug52745.test | 2 +- mysql-test/suite/innodb_zip/t/innodb_bug53591.test | 2 +- mysql-test/suite/innodb_zip/t/innodb_bug56680.test | 2 +- 13 files changed, 12 insertions(+), 24 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/t/innodb-alter-debug.test b/mysql-test/suite/innodb/t/innodb-alter-debug.test index 70017ffba35..f4996916e9f 100644 --- a/mysql-test/suite/innodb/t/innodb-alter-debug.test +++ b/mysql-test/suite/innodb/t/innodb-alter-debug.test @@ -1,4 +1,4 @@ ---source include/have_innodb.inc +--source include/innodb_page_size.inc --source include/have_debug.inc --source include/have_debug_sync.inc diff --git a/mysql-test/suite/innodb/t/innodb-alter-discard.test b/mysql-test/suite/innodb/t/innodb-alter-discard.test index 80678cef0a6..c90992e58a3 100644 --- a/mysql-test/suite/innodb/t/innodb-alter-discard.test +++ b/mysql-test/suite/innodb/t/innodb-alter-discard.test @@ -1,7 +1,7 @@ #Bug#13955083 ALLOW IN-PLACE DDL OPERATIONS ON MISSING OR DISCARDED TABLESPACES --source include/not_embedded.inc ---source include/have_innodb.inc +--source include/innodb_page_size.inc let $MYSQLD_DATADIR=`select @@datadir`; SET GLOBAL innodb_file_per_table=1; diff --git a/mysql-test/suite/innodb/t/innodb-alter-nullable.test b/mysql-test/suite/innodb/t/innodb-alter-nullable.test index 3f1e82b3183..bb5cdee000a 100644 --- a/mysql-test/suite/innodb/t/innodb-alter-nullable.test +++ b/mysql-test/suite/innodb/t/innodb-alter-nullable.test @@ -1,4 +1,4 @@ ---source include/have_innodb.inc +--source include/innodb_page_size.inc # Save the initial number of concurrent sessions. --source include/count_sessions.inc diff --git a/mysql-test/suite/innodb/t/innodb-alter-table.test b/mysql-test/suite/innodb/t/innodb-alter-table.test index 45342b4a218..97f0075f344 100644 --- a/mysql-test/suite/innodb/t/innodb-alter-table.test +++ b/mysql-test/suite/innodb/t/innodb-alter-table.test @@ -1,4 +1,4 @@ ---source include/have_innodb.inc +--source include/innodb_page_size.inc # # MMDEV-8386: MariaDB creates very big tmp file and hangs on xtradb diff --git a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test index e1e736fc678..8813e50f24a 100644 --- a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test +++ b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test @@ -10,8 +10,7 @@ # Avoid CrashReporter popup on Mac --source include/not_crashrep.inc -# InnoDB is required ---source include/have_innodb.inc +--source include/innodb_page_size.inc --echo # --echo # Bug #18734396 INNODB IN-PLACE ALTER FAILURES BLOCK FUTURE ALTERS diff --git a/mysql-test/suite/innodb_zip/r/innodb-zip.result b/mysql-test/suite/innodb_zip/r/innodb-zip.result index dbfae3c0630..584a8a5d647 100644 --- a/mysql-test/suite/innodb_zip/r/innodb-zip.result +++ b/mysql-test/suite/innodb_zip/r/innodb-zip.result @@ -1,4 +1,3 @@ -DROP DATABASE IF EXISTS mysqltest_innodb_zip; CREATE DATABASE mysqltest_innodb_zip; USE mysqltest_innodb_zip; SELECT table_name, row_format, data_length, index_length @@ -379,5 +378,4 @@ select @@innodb_file_format_max; @@innodb_file_format_max Barracuda drop table normal_table, zip_table; -USE test; DROP DATABASE mysqltest_innodb_zip; diff --git a/mysql-test/suite/innodb_zip/t/innodb-create-options.test b/mysql-test/suite/innodb_zip/t/innodb-create-options.test index aeb22514bf6..53d739feccb 100644 --- a/mysql-test/suite/innodb_zip/t/innodb-create-options.test +++ b/mysql-test/suite/innodb_zip/t/innodb-create-options.test @@ -1,4 +1,4 @@ ---source include/have_innodb.inc +--source include/innodb_page_size_small.inc # Tests for various combinations of ROW_FORMAT and KEY_BLOCK_SIZE # Related bugs; # Bug#54679: ALTER TABLE causes compressed row_format to revert to compact diff --git a/mysql-test/suite/innodb_zip/t/innodb-zip.test b/mysql-test/suite/innodb_zip/t/innodb-zip.test index 1c7c7c8c419..e8ba98f14ce 100644 --- a/mysql-test/suite/innodb_zip/t/innodb-zip.test +++ b/mysql-test/suite/innodb_zip/t/innodb-zip.test @@ -1,9 +1,4 @@ --- source include/have_innodb.inc - - ---disable_warnings -DROP DATABASE IF EXISTS mysqltest_innodb_zip; ---enable_warnings +--source include/innodb_page_size_small.inc CREATE DATABASE mysqltest_innodb_zip; USE mysqltest_innodb_zip; @@ -13,7 +8,6 @@ SELECT table_name, row_format, data_length, index_length let $per_table=`select @@innodb_file_per_table`; let $format=`select @@innodb_file_format`; -let $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`; let $innodb_file_format_orig=`select @@innodb_file_format`; let $innodb_file_format_max_orig=`select @@innodb_file_format_max`; SET @save_innodb_stats_on_metadata=@@global.innodb_stats_on_metadata; @@ -363,12 +357,9 @@ drop table normal_table, zip_table; -- disable_query_log eval set global innodb_file_format=$format; eval set global innodb_file_per_table=$per_table; -eval set session innodb_strict_mode=$innodb_strict_mode_orig; eval SET GLOBAL innodb_file_format=$innodb_file_format_orig; eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig; SET @@global.innodb_stats_on_metadata=@save_innodb_stats_on_metadata; --enable_query_log -USE test; DROP DATABASE mysqltest_innodb_zip; - diff --git a/mysql-test/suite/innodb_zip/t/innodb_bug36169.test b/mysql-test/suite/innodb_zip/t/innodb_bug36169.test index 6426bd683ae..ac1f0a3fe57 100644 --- a/mysql-test/suite/innodb_zip/t/innodb_bug36169.test +++ b/mysql-test/suite/innodb_zip/t/innodb_bug36169.test @@ -1,4 +1,4 @@ ---source include/have_innodb.inc +--source include/innodb_page_size_small.inc # # Bug#36169 create innodb compressed table with too large row size crashed # http://bugs.mysql.com/36169 diff --git a/mysql-test/suite/innodb_zip/t/innodb_bug36172.test b/mysql-test/suite/innodb_zip/t/innodb_bug36172.test index 015f461e532..7b82a7aba33 100644 --- a/mysql-test/suite/innodb_zip/t/innodb_bug36172.test +++ b/mysql-test/suite/innodb_zip/t/innodb_bug36172.test @@ -1,4 +1,4 @@ ---source include/have_innodb.inc +--source include/innodb_page_size_small.inc # # Test case for bug 36172 # diff --git a/mysql-test/suite/innodb_zip/t/innodb_bug52745.test b/mysql-test/suite/innodb_zip/t/innodb_bug52745.test index 3c5d79826f0..d84feb3b22d 100644 --- a/mysql-test/suite/innodb_zip/t/innodb_bug52745.test +++ b/mysql-test/suite/innodb_zip/t/innodb_bug52745.test @@ -1,4 +1,4 @@ --- source include/have_innodb.inc +--source include/innodb_page_size_small.inc let $file_format=`select @@innodb_file_format`; let $file_per_table=`select @@innodb_file_per_table`; diff --git a/mysql-test/suite/innodb_zip/t/innodb_bug53591.test b/mysql-test/suite/innodb_zip/t/innodb_bug53591.test index 8bc461719b8..ea1221dd711 100644 --- a/mysql-test/suite/innodb_zip/t/innodb_bug53591.test +++ b/mysql-test/suite/innodb_zip/t/innodb_bug53591.test @@ -1,4 +1,4 @@ --- source include/have_innodb.inc +--source include/innodb_page_size_small.inc let $file_format=`select @@innodb_file_format`; let $file_per_table=`select @@innodb_file_per_table`; diff --git a/mysql-test/suite/innodb_zip/t/innodb_bug56680.test b/mysql-test/suite/innodb_zip/t/innodb_bug56680.test index f592bd16942..700d7e6f0a8 100644 --- a/mysql-test/suite/innodb_zip/t/innodb_bug56680.test +++ b/mysql-test/suite/innodb_zip/t/innodb_bug56680.test @@ -1,4 +1,4 @@ ---source include/have_innodb.inc +--source include/innodb_page_size_small.inc # # Bug #56680 InnoDB may return wrong results from a case-insensitive index # -- cgit v1.2.1 From fbeb9489cd7d6ad859a49ae5ab8f876f3d988470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 6 Jun 2017 14:59:42 +0300 Subject: Cleanup of MDEV-12600: crash during install_db with innodb_page_size=32K and ibdata1=3M The doublewrite buffer pages must fit in the first InnoDB system tablespace data file. The checks that were added in the initial patch (commit 112b21da37dad0fbb28bc65f9ab5a3ba6c0c2186) were at too high level and did not cover all cases. innodb.log_data_file_size: Test all innodb_page_size combinations. fsp_header_init(): Never return an error. Move the change buffer creation to the only caller that needs to do it. btr_create(): Clean up the logic. Remove the error log messages. buf_dblwr_create(): Try to return an error on non-fatal failure. Check that the first data file is big enough for creating the doublewrite buffers. buf_dblwr_process(): Check if the doublewrite buffer is available. Display the message only if it is available. recv_recovery_from_checkpoint_start_func(): Remove a redundant message about FIL_PAGE_FILE_FLUSH_LSN mismatch when crash recovery has already been initiated. fil_report_invalid_page_access(): Simplify the message. fseg_create_general(): Do not emit messages to the error log. innobase_init(): Revert the changes. trx_rseg_create(): Refactor (no functional change). --- mysql-test/suite/innodb/r/doublewrite.result | 12 +++++-- mysql-test/suite/innodb/t/doublewrite.test | 44 ++++++++++++++++++++--- mysql-test/suite/innodb/t/log_data_file_size.opt | 2 +- mysql-test/suite/innodb/t/log_data_file_size.test | 2 +- 4 files changed, 51 insertions(+), 9 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/doublewrite.result b/mysql-test/suite/innodb/r/doublewrite.result index 6b913f49972..7cc4a436e5c 100644 --- a/mysql-test/suite/innodb/r/doublewrite.result +++ b/mysql-test/suite/innodb/r/doublewrite.result @@ -231,6 +231,7 @@ set global innodb_buf_flush_list_now = 1; check table t1; Table Op Msg_type Msg_text test.t1 check status OK +FOUND /\[ERROR\] InnoDB: .* in tablespace.*test.t1.*/ in mysqld.1.err select f1, f2 from t1; f1 f2 1 ############ @@ -238,6 +239,13 @@ f1 f2 3 //////////// 4 ------------ 5 ............ -# Test End -# --------------------------------------------------------------- drop table t1; +# +# MDEV-12600 crash during install_db with innodb_page_size=32K +# and ibdata1=3M +# +SELECT * FROM INFORMATION_SCHEMA.ENGINES +WHERE engine = 'innodb' +AND support IN ('YES', 'DEFAULT', 'ENABLED'); +ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS +FOUND /\[ERROR\] InnoDB: Cannot create doublewrite buffer/ in mysqld.1.err diff --git a/mysql-test/suite/innodb/t/doublewrite.test b/mysql-test/suite/innodb/t/doublewrite.test index b4604a44731..aba3d6ecff5 100644 --- a/mysql-test/suite/innodb/t/doublewrite.test +++ b/mysql-test/suite/innodb/t/doublewrite.test @@ -4,7 +4,7 @@ --echo # PAGE OF SYSTEM TABLESPACE --echo # ---source include/have_innodb.inc +--source include/innodb_page_size.inc --source include/have_debug.inc --source include/not_embedded.inc @@ -15,12 +15,17 @@ call mtr.add_suppression("space header page consists of zero bytes.*test.t1"); call mtr.add_suppression("checksum mismatch in tablespace.*test.t1"); call mtr.add_suppression("Current page size .* != page size on page"); call mtr.add_suppression("innodb-page-size mismatch in tablespace.*test.t1"); -call mtr.add_suppression("Trying to recover page.*from the doublewrite buffer"); +call mtr.add_suppression("InnoDB: New log files created"); +call mtr.add_suppression("InnoDB: Cannot create doublewrite buffer: the first file in innodb_data_file_path must be at least (3|6|12)M\\."); +call mtr.add_suppression("InnoDB: Database creation was aborted"); +call mtr.add_suppression("Plugin 'InnoDB' (init function returned error|registration as a STORAGE ENGINE failed)"); --enable_query_log --source include/restart_mysqld.inc let INNODB_PAGE_SIZE=`select @@innodb_page_size`; let MYSQLD_DATADIR=`select @@datadir`; +let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; +let SEARCH_RANGE= -50000; show variables like 'innodb_doublewrite'; show variables like 'innodb_fil_make_page_dirty_debug'; @@ -393,9 +398,38 @@ EOF --source include/start_mysqld.inc check table t1; -select f1, f2 from t1; +--let SEARCH_PATTERN= \[ERROR\] InnoDB: .* in tablespace.*test.t1.* +--source include/search_pattern_in_file.inc ---echo # Test End ---echo # --------------------------------------------------------------- +select f1, f2 from t1; drop table t1; + +--echo # +--echo # MDEV-12600 crash during install_db with innodb_page_size=32K +--echo # and ibdata1=3M +--echo # +let bugdir= $MYSQLTEST_VARDIR/tmp/doublewrite; +--mkdir $bugdir + +let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES +WHERE engine = 'innodb' +AND support IN ('YES', 'DEFAULT', 'ENABLED'); + +--let $ibp=--innodb-log-group-home-dir=$bugdir --innodb-data-home-dir=$bugdir +--let $ibd=$ibp --innodb-undo-tablespaces=0 --innodb-log-files-in-group=2 +--let $ibp=$ibp --innodb-data-file-path=ibdata1:1M;ibdata2:1M:autoextend + +--let $restart_parameters= $ibp +--source include/restart_mysqld.inc +eval $check_no_innodb; +--let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot create doublewrite buffer +--source include/search_pattern_in_file.inc +--let $restart_parameters= +--source include/restart_mysqld.inc + +--remove_file $bugdir/ibdata1 +--remove_file $bugdir/ibdata2 +--remove_file $bugdir/ib_logfile0 +--remove_file $bugdir/ib_logfile1 +--rmdir $bugdir diff --git a/mysql-test/suite/innodb/t/log_data_file_size.opt b/mysql-test/suite/innodb/t/log_data_file_size.opt index fe36abe4701..d9a364a3287 100644 --- a/mysql-test/suite/innodb/t/log_data_file_size.opt +++ b/mysql-test/suite/innodb/t/log_data_file_size.opt @@ -1,2 +1,2 @@ --loose-innodb-sys-indexes ---innodb-data-file-path=ibdata1:3M:autoextend +--innodb-data-file-path=ibdata1:1M:autoextend diff --git a/mysql-test/suite/innodb/t/log_data_file_size.test b/mysql-test/suite/innodb/t/log_data_file_size.test index 9328f3bbe6d..2f1c497595b 100644 --- a/mysql-test/suite/innodb/t/log_data_file_size.test +++ b/mysql-test/suite/innodb/t/log_data_file_size.test @@ -1,4 +1,4 @@ ---source include/have_innodb.inc +--source include/innodb_page_size.inc --source include/not_embedded.inc let INNODB_PAGE_SIZE=`select @@innodb_page_size`; -- cgit v1.2.1 From 58c56dd7f8e787c48b6f09a4d03cddd7c922588b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 8 Jun 2017 15:40:25 +0300 Subject: MDEV-12610: MariaDB start is slow Problem appears to be that the function fsp_flags_try_adjust() is being unconditionally invoked on every .ibd file on startup. Based on performance investigation also the top function fsp_header_get_crypt_offset() needs to addressed. Ported implementation of fsp_header_get_encryption_offset() function from 10.2 to fsp_header_get_crypt_offset(). Introduced a new function fil_crypt_read_crypt_data() to read page 0 if it is not yet read. fil_crypt_find_space_to_rotate(): Now that page 0 for every .ibd file is not read on startup we need to check has page 0 read from space that we investigate for key rotation, if it is not read we read it. fil_space_crypt_get_status(): Now that page 0 for every .ibd file is not read on startup here also we need to read page 0 if it is not yet read it. This is needed as tests use IS query to wait until background encryption or decryption has finished and this function is used to produce results. fil_crypt_thread(): Add is_stopping condition for tablespace so that we do not rotate pages if usage of tablespace should be stopped. This was needed for failure seen on regression testing. fil_space_create: Remove page_0_crypt_read and extra unnecessary info output. fil_open_single_table_tablespace(): We call fsp_flags_try_adjust only when when no errors has happened and server was not started on read only mode and tablespace validation was requested or flags contain other table options except low order bits to FSP_FLAGS_POS_PAGE_SSIZE position. fil_space_t::page_0_crypt_read removed. Added test case innodb-first-page-read to test startup when encryption is on and when encryption is off to check that not for all tables page 0 is read on startup. --- .../encryption/r/innodb-first-page-read.result | 89 ++++++++++++++++++++ .../suite/encryption/r/innodb_lotoftables.result | 28 +++---- .../suite/encryption/t/innodb-first-page-read.opt | 5 ++ .../suite/encryption/t/innodb-first-page-read.test | 97 ++++++++++++++++++++++ 4 files changed, 205 insertions(+), 14 deletions(-) create mode 100644 mysql-test/suite/encryption/r/innodb-first-page-read.result create mode 100644 mysql-test/suite/encryption/t/innodb-first-page-read.opt create mode 100644 mysql-test/suite/encryption/t/innodb-first-page-read.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/encryption/r/innodb-first-page-read.result b/mysql-test/suite/encryption/r/innodb-first-page-read.result new file mode 100644 index 00000000000..6c9eea80fa9 --- /dev/null +++ b/mysql-test/suite/encryption/r/innodb-first-page-read.result @@ -0,0 +1,89 @@ +SET GLOBAL innodb_file_format = `Barracuda`; +SET GLOBAL innodb_file_per_table = ON; +create database innodb_test; +use innodb_test; +create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; +create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact; +create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic; +create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed; +create table innodb_compressed1(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=1; +create table innodb_compressed2(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=2; +create table innodb_compressed4(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=4; +create table innodb_compressed8(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=8; +create table innodb_compressed16(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=16; +create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant; +create table innodb_pagecomp(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes; +create table innodb_pagecomp1(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=1; +create table innodb_pagecomp2(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=2; +create table innodb_pagecomp3(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=3; +create table innodb_pagecomp4(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=4; +create table innodb_pagecomp5(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=5; +create table innodb_pagecomp6(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=6; +create table innodb_pagecomp7(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=7; +create table innodb_pagecomp8(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=8; +create table innodb_pagecomp9(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=9; +create table innodb_datadir1(c1 bigint not null, b char(200)) engine=innodb DATA DIRECTORY='MYSQL_TMP_DIR'; +create table innodb_datadir2(c1 bigint not null, b char(200)) engine=innodb row_format=compressed DATA DIRECTORY='MYSQL_TMP_DIR'; +create table innodb_datadir3(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes DATA DIRECTORY='MYSQL_TMP_DIR'; +begin; +insert into innodb_normal values (1,'secret'); +insert into innodb_compact select * from innodb_normal; +insert into innodb_dynamic select * from innodb_normal; +insert into innodb_compressed select * from innodb_normal; +insert into innodb_compressed1 select * from innodb_normal; +insert into innodb_compressed2 select * from innodb_normal; +insert into innodb_compressed4 select * from innodb_normal; +insert into innodb_compressed8 select * from innodb_normal; +insert into innodb_compressed16 select * from innodb_normal; +insert into innodb_redundant select * from innodb_normal; +insert into innodb_pagecomp select * from innodb_normal; +insert into innodb_pagecomp1 select * from innodb_normal; +insert into innodb_pagecomp2 select * from innodb_normal; +insert into innodb_pagecomp3 select * from innodb_normal; +insert into innodb_pagecomp4 select * from innodb_normal; +insert into innodb_pagecomp5 select * from innodb_normal; +insert into innodb_pagecomp6 select * from innodb_normal; +insert into innodb_pagecomp7 select * from innodb_normal; +insert into innodb_pagecomp8 select * from innodb_normal; +insert into innodb_pagecomp9 select * from innodb_normal; +insert into innodb_datadir1 select * from innodb_normal; +insert into innodb_datadir2 select * from innodb_normal; +insert into innodb_datadir3 select * from innodb_normal; +commit; +# Restart server and see how many page 0's are read +# result should be less than actual number of tables +# i.e. < 23 + 3 = 26 +show status like 'innodb_pages0_read%'; +Variable_name Value +Innodb_pages0_read 17 +use innodb_test; +show status like 'innodb_pages0_read%'; +Variable_name Value +Innodb_pages0_read 17 +use test; +show status like 'innodb_pages0_read%'; +Variable_name Value +Innodb_pages0_read 17 +set global innodb_encrypt_tables=OFF; +# wait until tables are decrypted +show status like 'innodb_pages0_read%'; +Variable_name Value +Innodb_pages0_read 29 +use innodb_test; +show status like 'innodb_pages0_read%'; +Variable_name Value +Innodb_pages0_read 29 +use test; +# restart and see number read page 0 +show status like 'innodb_pages0_read%'; +Variable_name Value +Innodb_pages0_read 17 +use innodb_test; +show status like 'innodb_pages0_read%'; +Variable_name Value +Innodb_pages0_read 17 +use test; +drop database innodb_test; +show status like 'innodb_pages0_read%'; +Variable_name Value +Innodb_pages0_read 29 diff --git a/mysql-test/suite/encryption/r/innodb_lotoftables.result b/mysql-test/suite/encryption/r/innodb_lotoftables.result index 418ab175a01..b7cfdd2db9d 100644 --- a/mysql-test/suite/encryption/r/innodb_lotoftables.result +++ b/mysql-test/suite/encryption/r/innodb_lotoftables.result @@ -12,13 +12,13 @@ create database innodb_encrypted_1; use innodb_encrypted_1; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 3 +Innodb_pages0_read 1 set autocommit=0; set autocommit=1; commit work; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 3 +Innodb_pages0_read 1 # should be 100 SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE NAME LIKE 'innodb_encrypted%'; COUNT(*) @@ -88,47 +88,47 @@ Innodb_pages0_read 3 # Restart Success! show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 1 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 1 use test; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 1 use innodb_encrypted_1; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 1 use innodb_encrypted_2; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 1 use innodb_encrypted_3; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 1 use innodb_encrypted_1; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 1 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 101 use innodb_encrypted_2; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 101 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 201 use innodb_encrypted_3; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 201 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 303 +Innodb_pages0_read 301 SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%'; COUNT(*) 100 diff --git a/mysql-test/suite/encryption/t/innodb-first-page-read.opt b/mysql-test/suite/encryption/t/innodb-first-page-read.opt new file mode 100644 index 00000000000..38d69691ed6 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-first-page-read.opt @@ -0,0 +1,5 @@ +--innodb-encrypt-tables=ON +--innodb-encrypt-log=ON +--innodb-encryption-rotate-key-age=15 +--innodb-encryption-threads=4 +--innodb-tablespaces-encryption diff --git a/mysql-test/suite/encryption/t/innodb-first-page-read.test b/mysql-test/suite/encryption/t/innodb-first-page-read.test new file mode 100644 index 00000000000..1fc07159e05 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-first-page-read.test @@ -0,0 +1,97 @@ +-- source include/have_innodb.inc +-- source include/have_file_key_management_plugin.inc +-- source include/not_embedded.inc + +--disable_warnings +SET GLOBAL innodb_file_format = `Barracuda`; +SET GLOBAL innodb_file_per_table = ON; +--enable_warnings + +create database innodb_test; +use innodb_test; +create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; +create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact; +create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic; +create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed; +create table innodb_compressed1(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=1; +create table innodb_compressed2(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=2; +create table innodb_compressed4(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=4; +create table innodb_compressed8(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=8; +create table innodb_compressed16(c1 bigint not null, b char(200)) engine=innodb row_format=compressed key_block_size=16; +create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant; +create table innodb_pagecomp(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes; +create table innodb_pagecomp1(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=1; +create table innodb_pagecomp2(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=2; +create table innodb_pagecomp3(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=3; +create table innodb_pagecomp4(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=4; +create table innodb_pagecomp5(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=5; +create table innodb_pagecomp6(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=6; +create table innodb_pagecomp7(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=7; +create table innodb_pagecomp8(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=8; +create table innodb_pagecomp9(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes page_compression_level=9; + +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval create table innodb_datadir1(c1 bigint not null, b char(200)) engine=innodb DATA DIRECTORY='$MYSQL_TMP_DIR'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval create table innodb_datadir2(c1 bigint not null, b char(200)) engine=innodb row_format=compressed DATA DIRECTORY='$MYSQL_TMP_DIR'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval create table innodb_datadir3(c1 bigint not null, b char(200)) engine=innodb page_compressed=yes DATA DIRECTORY='$MYSQL_TMP_DIR'; + +begin; +insert into innodb_normal values (1,'secret'); +insert into innodb_compact select * from innodb_normal; +insert into innodb_dynamic select * from innodb_normal; +insert into innodb_compressed select * from innodb_normal; +insert into innodb_compressed1 select * from innodb_normal; +insert into innodb_compressed2 select * from innodb_normal; +insert into innodb_compressed4 select * from innodb_normal; +insert into innodb_compressed8 select * from innodb_normal; +insert into innodb_compressed16 select * from innodb_normal; +insert into innodb_redundant select * from innodb_normal; +insert into innodb_pagecomp select * from innodb_normal; +insert into innodb_pagecomp1 select * from innodb_normal; +insert into innodb_pagecomp2 select * from innodb_normal; +insert into innodb_pagecomp3 select * from innodb_normal; +insert into innodb_pagecomp4 select * from innodb_normal; +insert into innodb_pagecomp5 select * from innodb_normal; +insert into innodb_pagecomp6 select * from innodb_normal; +insert into innodb_pagecomp7 select * from innodb_normal; +insert into innodb_pagecomp8 select * from innodb_normal; +insert into innodb_pagecomp9 select * from innodb_normal; +insert into innodb_datadir1 select * from innodb_normal; +insert into innodb_datadir2 select * from innodb_normal; +insert into innodb_datadir3 select * from innodb_normal; +commit; + +--echo # Restart server and see how many page 0's are read +--source include/restart_mysqld.inc + +--echo # result should be less than actual number of tables +--echo # i.e. < 23 + 3 = 26 +show status like 'innodb_pages0_read%'; +use innodb_test; +show status like 'innodb_pages0_read%'; +use test; +show status like 'innodb_pages0_read%'; + +set global innodb_encrypt_tables=OFF; + +--echo # wait until tables are decrypted +--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 +--source include/wait_condition.inc + +show status like 'innodb_pages0_read%'; +use innodb_test; +show status like 'innodb_pages0_read%'; +use test; + +--echo # restart and see number read page 0 +-- source include/restart_mysqld.inc + +show status like 'innodb_pages0_read%'; +use innodb_test; +show status like 'innodb_pages0_read%'; +use test; + +drop database innodb_test; +show status like 'innodb_pages0_read%'; -- cgit v1.2.1 From 417434f12dba3ccf5b79ca4e7afe72fe27807fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 8 Jun 2017 15:43:06 +0300 Subject: MDEV-13039 innodb_fast_shutdown=0 may fail to purge all undo log When a slow shutdown is performed soon after spawning some work for background threads that can create or commit transactions, it is possible that new transactions are started or committed after the purge has finished. This is violating the specification of innodb_fast_shutdown=0, namely that the purge must be completed. (None of the history of the recent transactions would be purged.) Also, it is possible that the purge threads would exit in slow shutdown while there exist active transactions, such as recovered incomplete transactions that are being rolled back. Thus, the slow shutdown could fail to purge some undo log that becomes purgeable after the transaction commit or rollback. srv_undo_sources: A flag that indicates if undo log can be generated or the persistent, whether by background threads or by user SQL. Even when this flag is clear, active transactions that already exist in the system may be committed or rolled back. innodb_shutdown(): Renamed from innobase_shutdown_for_mysql(). Do not return an error code; the operation never fails. Clear the srv_undo_sources flag, and also ensure that the background DROP TABLE queue is empty. srv_purge_should_exit(): Do not allow the purge to exit if srv_undo_sources are active or the background DROP TABLE queue is not empty, or in slow shutdown, if any active transactions exist (and are being rolled back). srv_purge_coordinator_thread(): Remove some previous workarounds for this bug. innobase_start_or_create_for_mysql(): Set buf_page_cleaner_is_active and srv_dict_stats_thread_active directly. Set srv_undo_sources before starting the purge subsystem, to prevent immediate shutdown of the purge. Create dict_stats_thread and fts_optimize_thread immediately after setting srv_undo_sources, so that shutdown can use this flag to determine if these subsystems were started. dict_stats_shutdown(): Shut down dict_stats_thread. Backported from 10.2. srv_shutdown_table_bg_threads(): Remove (unused). --- .../suite/innodb/r/row_format_redundant.result | 48 ++++++++++++++++ .../suite/innodb/t/row_format_redundant.test | 65 ++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 mysql-test/suite/innodb/r/row_format_redundant.result create mode 100644 mysql-test/suite/innodb/t/row_format_redundant.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/row_format_redundant.result b/mysql-test/suite/innodb/r/row_format_redundant.result new file mode 100644 index 00000000000..db31c32559f --- /dev/null +++ b/mysql-test/suite/innodb/r/row_format_redundant.result @@ -0,0 +1,48 @@ +create table t1 (a int not null, d varchar(15) not null, b +varchar(198) not null, c char(156), +fulltext ftsic(c)) engine=InnoDB +row_format=redundant; +insert into t1 values(123, 'abcdef', 'jghikl', 'mnop'); +insert into t1 values(456, 'abcdef', 'jghikl', 'mnop'); +insert into t1 values(789, 'abcdef', 'jghikl', 'mnop'); +insert into t1 values(134, 'kasdfsdsadf', 'adfjlasdkfjasd', 'adfsadflkasdasdfljasdf'); +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +SET GLOBAL innodb_file_per_table=OFF; +create table t2 (a int not null, d varchar(15) not null, b +varchar(198) not null, c char(156), fulltext ftsic(c)) engine=InnoDB +row_format=redundant; +insert into t2 select * from t1; +create table t3 (a int not null, d varchar(15) not null, b varchar(198), +c varchar(150), index k1(c(99), b(56)), index k2(b(5), c(10))) engine=InnoDB +row_format=redundant; +insert into t3 values(444, 'dddd', 'bbbbb', 'aaaaa'); +insert into t3 values(555, 'eeee', 'ccccc', 'aaaaa'); +SET GLOBAL innodb_fast_shutdown=0; +SELECT COUNT(*) FROM t1; +COUNT(*) +4096 +SELECT COUNT(*) FROM t2; +COUNT(*) +4096 +SELECT COUNT(*) FROM t3; +COUNT(*) +2 +TRUNCATE TABLE t1; +ERROR HY000: Table 't1' is read only +TRUNCATE TABLE t2; +ERROR HY000: Table 't2' is read only +TRUNCATE TABLE t3; +ERROR HY000: Table 't3' is read only +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +DROP TABLE t1,t2,t3; diff --git a/mysql-test/suite/innodb/t/row_format_redundant.test b/mysql-test/suite/innodb/t/row_format_redundant.test new file mode 100644 index 00000000000..b17b365651a --- /dev/null +++ b/mysql-test/suite/innodb/t/row_format_redundant.test @@ -0,0 +1,65 @@ +--source include/innodb_page_size.inc +# Embedded mode doesn't allow restarting +--source include/not_embedded.inc + +create table t1 (a int not null, d varchar(15) not null, b +varchar(198) not null, c char(156), +fulltext ftsic(c)) engine=InnoDB +row_format=redundant; + +insert into t1 values(123, 'abcdef', 'jghikl', 'mnop'); +insert into t1 values(456, 'abcdef', 'jghikl', 'mnop'); +insert into t1 values(789, 'abcdef', 'jghikl', 'mnop'); +insert into t1 values(134, 'kasdfsdsadf', 'adfjlasdkfjasd', 'adfsadflkasdasdfljasdf'); +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; + +SET GLOBAL innodb_file_per_table=OFF; +create table t2 (a int not null, d varchar(15) not null, b +varchar(198) not null, c char(156), fulltext ftsic(c)) engine=InnoDB +row_format=redundant; + +insert into t2 select * from t1; + +create table t3 (a int not null, d varchar(15) not null, b varchar(198), +c varchar(150), index k1(c(99), b(56)), index k2(b(5), c(10))) engine=InnoDB +row_format=redundant; + +insert into t3 values(444, 'dddd', 'bbbbb', 'aaaaa'); +insert into t3 values(555, 'eeee', 'ccccc', 'aaaaa'); + +# read-only restart requires the change buffer to be empty; therefore we +# do a slow shutdown. +SET GLOBAL innodb_fast_shutdown=0; +--let $restart_parameters = --innodb-read-only +--source include/restart_mysqld.inc + +SELECT COUNT(*) FROM t1; +SELECT COUNT(*) FROM t2; +SELECT COUNT(*) FROM t3; + +--error ER_OPEN_AS_READONLY +TRUNCATE TABLE t1; +--error ER_OPEN_AS_READONLY +TRUNCATE TABLE t2; +--error ER_OPEN_AS_READONLY +TRUNCATE TABLE t3; + +--let $restart_parameters = +--source include/restart_mysqld.inc + +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; + +# TODO: Shutdown, corrupt the SYS_TABLES.TYPE of the tables, restart + +DROP TABLE t1,t2,t3; -- cgit v1.2.1 From b175c41cde8a3cd714ebbd2accc1ab22892bdfef Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Sat, 10 Jun 2017 12:57:59 +0530 Subject: MDEV-9544 Fix test case for 10.2 --- mysql-test/suite/multi_source/mdev-9544.result | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/multi_source/mdev-9544.result b/mysql-test/suite/multi_source/mdev-9544.result index e7e4bcda8ff..42e6b6a9f56 100644 --- a/mysql-test/suite/multi_source/mdev-9544.result +++ b/mysql-test/suite/multi_source/mdev-9544.result @@ -1,21 +1,29 @@ +connect server_1,127.0.0.1,root,,,$SERVER_MYPORT_1; +connect server_2,127.0.0.1,root,,,$SERVER_MYPORT_2; +connect server_3,127.0.0.1,root,,,$SERVER_MYPORT_3; +connect server_4,127.0.0.1,root,,,$SERVER_MYPORT_4; +connection server_1; create database a; use a; create table t1(a int); insert into t1 values(1); create table t2(a int); insert into t2 values(1); +connection server_2; create database b; use b; create table t1(a int); insert into t1 values(1); create table t2(a int); insert into t2 values(1); +connection server_3; create database c; use c; create table t1(a int); insert into t1 values(1); create table t2(a int); insert into t2 values(1); +connection server_4; change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root'; change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root'; change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root'; @@ -62,9 +70,13 @@ mysqld-relay-bin-m2.000002 mysqld-relay-bin-m2.000003 mysqld-relay-bin-m2.index #CleanUp +connection server_1; drop database a; +connection server_2; drop database b; +connection server_3; drop database c; +connection server_4; stop all slaves; Warnings: Note 1938 SLAVE 'm2' stopped -- cgit v1.2.1 From 4325041df6cf13ed1e62749fdb43fb8f138d1e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 12 Jun 2017 11:08:06 +0300 Subject: MDEV-13057 innodb_read_only=1 should avoid creating buf_flush_page_cleaner_thread When the server is started in innodb_read_only mode, there cannot be any writes to persistent InnoDB/XtraDB files. Just like the creation of buf_flush_page_cleaner_thread is skipped in this case, also the creation of the XtraDB-specific buf_flush_lru_manager_thread should be skipped. --- .../sys_vars/r/innodb_sched_priority_cleaner_basic.result | 2 +- .../suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result b/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result index 1183fb27732..f2bfaf2ed61 100644 --- a/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result @@ -1,4 +1,4 @@ -SET @start_value = @@GLOBAL.innodb_sched_priority_cleaner; +SET GLOBAL innodb_sched_priority_cleaner=39; SELECT @@GLOBAL.innodb_sched_priority_cleaner; @@GLOBAL.innodb_sched_priority_cleaner 19 diff --git a/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test b/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test index b2382fd7844..2c2037f167f 100644 --- a/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test @@ -4,7 +4,15 @@ # A dynamic, global variable -SET @start_value = @@GLOBAL.innodb_sched_priority_cleaner; +# Test in read-only mode +--let $restart_parameters= --innodb-read-only +--source include/restart_mysqld.inc +--let $restart_parameters= + +# This has no actual effect in innodb_read_only mode +SET GLOBAL innodb_sched_priority_cleaner=39; + +--source include/restart_mysqld.inc # Default value SELECT @@GLOBAL.innodb_sched_priority_cleaner; -- cgit v1.2.1 From 75b35a3b6897a0fcef28d73a480d6d9d65c7ac9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 12 Jun 2017 14:10:39 +0300 Subject: Partially disable a test affected by MDEV-13059 --- mysql-test/suite/innodb/t/row_format_redundant.test | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/t/row_format_redundant.test b/mysql-test/suite/innodb/t/row_format_redundant.test index b17b365651a..974588d11eb 100644 --- a/mysql-test/suite/innodb/t/row_format_redundant.test +++ b/mysql-test/suite/innodb/t/row_format_redundant.test @@ -2,6 +2,16 @@ # Embedded mode doesn't allow restarting --source include/not_embedded.inc +# MDEV-13059 XtraDB hangs on Windows due to failing to release +# block->lock X-latch in innodb_read_only mode +if (`SELECT count(*) FROM information_schema.plugins WHERE + plugin_name = 'innodb' AND plugin_status = 'active' AND + plugin_description LIKE '%xtradb%'`){ + if (`SELECT @@version_compile_os IN ('Win32','Win64','Windows')`) { + skip MDEV-13059 XtraDB hangs on Windows in innodb_read_only mode; + } +} + create table t1 (a int not null, d varchar(15) not null, b varchar(198) not null, c char(156), fulltext ftsic(c)) engine=InnoDB -- cgit v1.2.1 From 757339efd0894be2c486cfeb79f61182831a050f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 12 Jun 2017 17:09:44 +0300 Subject: Adjust a test result after merge --- mysql-test/suite/encryption/r/innodb-first-page-read.result | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/encryption/r/innodb-first-page-read.result b/mysql-test/suite/encryption/r/innodb-first-page-read.result index 6c9eea80fa9..4a55612af27 100644 --- a/mysql-test/suite/encryption/r/innodb-first-page-read.result +++ b/mysql-test/suite/encryption/r/innodb-first-page-read.result @@ -55,15 +55,15 @@ commit; # i.e. < 23 + 3 = 26 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 17 +Innodb_pages0_read 19 use innodb_test; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 17 +Innodb_pages0_read 19 use test; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 17 +Innodb_pages0_read 19 set global innodb_encrypt_tables=OFF; # wait until tables are decrypted show status like 'innodb_pages0_read%'; @@ -77,11 +77,11 @@ use test; # restart and see number read page 0 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 17 +Innodb_pages0_read 19 use innodb_test; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 17 +Innodb_pages0_read 19 use test; drop database innodb_test; show status like 'innodb_pages0_read%'; -- cgit v1.2.1 From 35248fed10becf08368a3dee547c938963ffc986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 8 Jun 2017 15:43:06 +0300 Subject: 10.2 follow-up to MDEV-13039 innodb_fast_shutdown=0 crash due premature purge shutdown before fts_optimize_shutdown() srv_start_state_t: Document the flags. Replace SRV_START_STATE_STAT with SRV_START_STATE_REDO. The srv_bg_undo_sources replaces the original use of SRV_START_STATE_STAT. dict_stats_thread_started, buf_dump_thread_started, buf_flush_page_cleaner_thread_started: Remove (unused). srv_shutdown_all_bg_threads(): Always wait for the I/O threads to exit, also in read-only mode. os_thread_free(): Remove. --- .../suite/innodb/r/row_format_redundant.result | 28 +++++++++++- .../suite/innodb/t/row_format_redundant.test | 53 +++++++++++++++++----- 2 files changed, 69 insertions(+), 12 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/row_format_redundant.result b/mysql-test/suite/innodb/r/row_format_redundant.result index db31c32559f..c6926872d1a 100644 --- a/mysql-test/suite/innodb/r/row_format_redundant.result +++ b/mysql-test/suite/innodb/r/row_format_redundant.result @@ -1,3 +1,7 @@ +# +# Bug#21644827 - FTS, ASSERT !SRV_READ_ONLY_MODE || M_IMPL.M_LOG_MODE == +# MTR_LOG_NO_REDO +# create table t1 (a int not null, d varchar(15) not null, b varchar(198) not null, c char(156), fulltext ftsic(c)) engine=InnoDB @@ -45,4 +49,26 @@ ERROR HY000: Table 't3' is read only TRUNCATE TABLE t1; TRUNCATE TABLE t2; TRUNCATE TABLE t3; -DROP TABLE t1,t2,t3; +TRUNCATE TABLE t1; +ERROR 42S02: Table 'test.t1' doesn't exist in engine +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +SELECT COUNT(*) FROM t1; +ERROR 42S02: Table 'test.t1' doesn't exist in engine +SELECT COUNT(*) FROM t2; +COUNT(*) +0 +SELECT COUNT(*) FROM t3; +COUNT(*) +0 +RENAME TABLE t1 TO tee_one; +ERROR HY000: Error on rename of './test/t1' to './test/tee_one' (errno: 155 "The table does not exist in engine") +DROP TABLE t1; +Warnings: +Warning 1932 Table 'test.t1' doesn't exist in engine +NOT FOUND /\[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags. SYS_TABLES.MIX_LEN=255;/ in mysqld.1.err +FOUND 48 /\[ERROR\] InnoDB: InnoDB: Error: table unused flags are:255/ in mysqld.1.err +FOUND 1 /\[Warning\] InnoDB: Parent table of FTS auxiliary table test/FTS_.* not found\./ in mysqld.1.err +NOT FOUND /"\[Warning\] InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the \.frm file for the table exists.";/ in mysqld.1.err +FOUND 2 /\[ERROR\] InnoDB: Table `test`.`t1` does not exist in the InnoDB internal data dictionary though MariaDB is trying to (drop|rename)/ in mysqld.1.err +DROP TABLE t2,t3; diff --git a/mysql-test/suite/innodb/t/row_format_redundant.test b/mysql-test/suite/innodb/t/row_format_redundant.test index 974588d11eb..4d41314fc79 100644 --- a/mysql-test/suite/innodb/t/row_format_redundant.test +++ b/mysql-test/suite/innodb/t/row_format_redundant.test @@ -1,16 +1,12 @@ --source include/innodb_page_size.inc +--source include/have_debug.inc # Embedded mode doesn't allow restarting --source include/not_embedded.inc -# MDEV-13059 XtraDB hangs on Windows due to failing to release -# block->lock X-latch in innodb_read_only mode -if (`SELECT count(*) FROM information_schema.plugins WHERE - plugin_name = 'innodb' AND plugin_status = 'active' AND - plugin_description LIKE '%xtradb%'`){ - if (`SELECT @@version_compile_os IN ('Win32','Win64','Windows')`) { - skip MDEV-13059 XtraDB hangs on Windows in innodb_read_only mode; - } -} +--echo # +--echo # Bug#21644827 - FTS, ASSERT !SRV_READ_ONLY_MODE || M_IMPL.M_LOG_MODE == +--echo # MTR_LOG_NO_REDO +--echo # create table t1 (a int not null, d varchar(15) not null, b varchar(198) not null, c char(156), @@ -70,6 +66,41 @@ TRUNCATE TABLE t1; TRUNCATE TABLE t2; TRUNCATE TABLE t3; -# TODO: Shutdown, corrupt the SYS_TABLES.TYPE of the tables, restart +--source include/shutdown_mysqld.inc -DROP TABLE t1,t2,t3; +# FIXME: Corrupt the SYS_TABLES.TYPE of the tables, do not use --debug +--let $restart_parameters = --debug=d,ib_table_invalid_flags +--source include/start_mysqld.inc +--error ER_NO_SUCH_TABLE_IN_ENGINE +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +--error ER_NO_SUCH_TABLE_IN_ENGINE +SELECT COUNT(*) FROM t1; +SELECT COUNT(*) FROM t2; +SELECT COUNT(*) FROM t3; +--error ER_ERROR_ON_RENAME +RENAME TABLE t1 TO tee_one; +DROP TABLE t1; + +--disable_query_log +call mtr.add_suppression("\\[ERROR\\] InnoDB: Table `test`\\.`t1` in InnoDB data dictionary contains invalid flags\\. SYS_TABLES\\.MIX_LEN=255"); +call mtr.add_suppression("\\[ERROR\\] InnoDB: InnoDB: Error: table unused flags are:255"); +call mtr.add_suppression("\\[Warning\\] InnoDB: Parent table of FTS auxiliary table test/FTS_.* not found\\."); +call mtr.add_suppression("\\[Warning\\] InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the \\.frm file for the table exists."); +call mtr.add_suppression("\\[ERROR\\] InnoDB: Table `test`.`t1` does not exist in the InnoDB internal data dictionary though MariaDB is trying to (drop|rename)"); + +--enable_query_log +let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; +--let SEARCH_PATTERN= \[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags. SYS_TABLES.MIX_LEN=255; +--source include/search_pattern_in_file.inc +--let SEARCH_PATTERN= \[ERROR\] InnoDB: InnoDB: Error: table unused flags are:255 +--source include/search_pattern_in_file.inc +--let SEARCH_PATTERN= \[Warning\] InnoDB: Parent table of FTS auxiliary table test/FTS_.* not found\. +--source include/search_pattern_in_file.inc +--let SEARCH_PATTERN= "\\[Warning\\] InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the \.frm file for the table exists."; +--source include/search_pattern_in_file.inc +--let SEARCH_PATTERN= \[ERROR\] InnoDB: Table `test`.`t1` does not exist in the InnoDB internal data dictionary though MariaDB is trying to (drop|rename) +--source include/search_pattern_in_file.inc + +DROP TABLE t2,t3; -- cgit v1.2.1 From 74e4cf70d09bbe7a0a530bc50895820e04466194 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 12 Jun 2017 18:43:23 +0000 Subject: MDEV-13059 XtraDB hangs on Windows due to failing to release block->lock X-latch in innodb_read_only mode. The reason for the hang is that there was no notification received about completed read io. File handles are bound to completion_port, and there were no background "write" threads that would be waiting on completion_port, only 2 "read" threads waiting on read_completion_port were active. The fix is to use a single IO completion port for all IOs, if innodb_read_only is set. --- mysql-test/suite/innodb/t/row_format_redundant.test | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/t/row_format_redundant.test b/mysql-test/suite/innodb/t/row_format_redundant.test index 974588d11eb..b17b365651a 100644 --- a/mysql-test/suite/innodb/t/row_format_redundant.test +++ b/mysql-test/suite/innodb/t/row_format_redundant.test @@ -2,16 +2,6 @@ # Embedded mode doesn't allow restarting --source include/not_embedded.inc -# MDEV-13059 XtraDB hangs on Windows due to failing to release -# block->lock X-latch in innodb_read_only mode -if (`SELECT count(*) FROM information_schema.plugins WHERE - plugin_name = 'innodb' AND plugin_status = 'active' AND - plugin_description LIKE '%xtradb%'`){ - if (`SELECT @@version_compile_os IN ('Win32','Win64','Windows')`) { - skip MDEV-13059 XtraDB hangs on Windows in innodb_read_only mode; - } -} - create table t1 (a int not null, d varchar(15) not null, b varchar(198) not null, c char(156), fulltext ftsic(c)) engine=InnoDB -- cgit v1.2.1 From 1d5a306e3884ff0b159402f1f83dee2fb87d93f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 13 Jun 2017 16:20:21 +0300 Subject: MDEV-12873 InnoDB SYS_TABLES.TYPE incompatibility for PAGE_COMPRESSION in MariaDB 10.2.2 to 10.2.6 Add a test case for corrupting SYS_TABLES.TYPE, and for ROW_FORMAT=REDUNDANT, the unused field SYS_TABLES.MIX_LEN that must be ignored (InnoDB before MySQL 5.5 wrote uninitialized garbage to this column). MariaDB 10.0 appears to validate the SYS_TABLES.TYPE properly. This is a test-only change. --- mysql-test/suite/innodb/r/table_flags,4k.rdiff | 83 +++++++++ mysql-test/suite/innodb/r/table_flags,8k.rdiff | 83 +++++++++ mysql-test/suite/innodb/r/table_flags.result | 175 +++++++++++++++++++ .../suite/innodb/t/row_format_redundant.test | 4 +- mysql-test/suite/innodb/t/table_flags.test | 190 +++++++++++++++++++++ 5 files changed, 532 insertions(+), 3 deletions(-) create mode 100644 mysql-test/suite/innodb/r/table_flags,4k.rdiff create mode 100644 mysql-test/suite/innodb/r/table_flags,8k.rdiff create mode 100644 mysql-test/suite/innodb/r/table_flags.result create mode 100644 mysql-test/suite/innodb/t/table_flags.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/table_flags,4k.rdiff b/mysql-test/suite/innodb/r/table_flags,4k.rdiff new file mode 100644 index 00000000000..faa8a408c65 --- /dev/null +++ b/mysql-test/suite/innodb/r/table_flags,4k.rdiff @@ -0,0 +1,83 @@ +--- suite/innodb/r/table_flags.result ++++ suite/innodb/r/table_flags,4k.reject +@@ -13,7 +13,7 @@ + header=0x01000003016e (NAME=0x696e66696d756d00) + header=0x00002815008d (NAME='SYS_DATAFILES', + DB_TRX_ID=0x000000000301, +- DB_ROLL_PTR=0x81000001320194, ++ DB_ROLL_PTR=0x81000003260194, + ID=0x000000000000000e, + N_COLS=0x00000002, + TYPE=0x00000001, +@@ -23,7 +23,7 @@ + SPACE=0x00000000) + header=0x0000101500d5 (NAME='SYS_FOREIGN', + DB_TRX_ID=0x000000000300, +- DB_ROLL_PTR=0x800000012d0110, ++ DB_ROLL_PTR=0x80000003200110, + ID=0x000000000000000b, + N_COLS=0x00000004, + TYPE=0x00000001, +@@ -33,7 +33,7 @@ + SPACE=0x00000000) + header=0x000018150122 (NAME='SYS_FOREIGN_COLS', + DB_TRX_ID=0x000000000300, +- DB_ROLL_PTR=0x800000012d0201, ++ DB_ROLL_PTR=0x80000003200201, + ID=0x000000000000000c, + N_COLS=0x00000004, + TYPE=0x00000001, +@@ -43,7 +43,7 @@ + SPACE=0x00000000) + header=0x0400201501fc (NAME='SYS_TABLESPACES', + DB_TRX_ID=0x000000000301, +- DB_ROLL_PTR=0x81000001320110, ++ DB_ROLL_PTR=0x81000003260110, + ID=0x000000000000000d, + N_COLS=0x00000003, + TYPE=0x00000001, +@@ -53,7 +53,7 @@ + SPACE=0x00000000) + header=0x000038150240 (NAME='test/tc', + DB_TRX_ID=0x000000000303, +- DB_ROLL_PTR=0x83000001360110, ++ DB_ROLL_PTR=0x830000032b0110, + ID=0x0000000000000010, + N_COLS=0x80000001, + TYPE=0x00000001, +@@ -63,7 +63,7 @@ + SPACE=0x00000002) + header=0x0000401502c8 (NAME='test/td', + DB_TRX_ID=0x000000000304, +- DB_ROLL_PTR=0x84000001370110, ++ DB_ROLL_PTR=0x840000032c0110, + ID=0x0000000000000011, + N_COLS=0x80000001, + TYPE=0x00000021, +@@ -73,7 +73,7 @@ + SPACE=0x00000003) + header=0x0000501501b8 (NAME='test/tp', + DB_TRX_ID=0x000000000306, +- DB_ROLL_PTR=0x86000001390110, ++ DB_ROLL_PTR=0x860000032e0110, + ID=0x0000000000000013, + N_COLS=0x80000001, + TYPE=0x00000021, +@@ -83,7 +83,7 @@ + SPACE=0x00000005) + header=0x000030150284 (NAME='test/tr', + DB_TRX_ID=0x000000000302, +- DB_ROLL_PTR=0x82000001350110, ++ DB_ROLL_PTR=0x820000032a0110, + ID=0x000000000000000f, + N_COLS=0x00000001, + TYPE=0x00000001, +@@ -93,7 +93,7 @@ + SPACE=0x00000001) + header=0x000048150074 (NAME='test/tz', + DB_TRX_ID=0x000000000305, +- DB_ROLL_PTR=0x85000001380110, ++ DB_ROLL_PTR=0x850000032d0110, + ID=0x0000000000000012, + N_COLS=0x80000001, + TYPE=0x00000023, diff --git a/mysql-test/suite/innodb/r/table_flags,8k.rdiff b/mysql-test/suite/innodb/r/table_flags,8k.rdiff new file mode 100644 index 00000000000..ba3439fc6cf --- /dev/null +++ b/mysql-test/suite/innodb/r/table_flags,8k.rdiff @@ -0,0 +1,83 @@ +--- suite/innodb/r/table_flags.result ++++ suite/innodb/r/table_flags,8k.reject +@@ -13,7 +13,7 @@ + header=0x01000003016e (NAME=0x696e66696d756d00) + header=0x00002815008d (NAME='SYS_DATAFILES', + DB_TRX_ID=0x000000000301, +- DB_ROLL_PTR=0x81000001320194, ++ DB_ROLL_PTR=0x81000001d70194, + ID=0x000000000000000e, + N_COLS=0x00000002, + TYPE=0x00000001, +@@ -23,7 +23,7 @@ + SPACE=0x00000000) + header=0x0000101500d5 (NAME='SYS_FOREIGN', + DB_TRX_ID=0x000000000300, +- DB_ROLL_PTR=0x800000012d0110, ++ DB_ROLL_PTR=0x80000001d10110, + ID=0x000000000000000b, + N_COLS=0x00000004, + TYPE=0x00000001, +@@ -33,7 +33,7 @@ + SPACE=0x00000000) + header=0x000018150122 (NAME='SYS_FOREIGN_COLS', + DB_TRX_ID=0x000000000300, +- DB_ROLL_PTR=0x800000012d0201, ++ DB_ROLL_PTR=0x80000001d10201, + ID=0x000000000000000c, + N_COLS=0x00000004, + TYPE=0x00000001, +@@ -43,7 +43,7 @@ + SPACE=0x00000000) + header=0x0400201501fc (NAME='SYS_TABLESPACES', + DB_TRX_ID=0x000000000301, +- DB_ROLL_PTR=0x81000001320110, ++ DB_ROLL_PTR=0x81000001d70110, + ID=0x000000000000000d, + N_COLS=0x00000003, + TYPE=0x00000001, +@@ -53,7 +53,7 @@ + SPACE=0x00000000) + header=0x000038150240 (NAME='test/tc', + DB_TRX_ID=0x000000000303, +- DB_ROLL_PTR=0x83000001360110, ++ DB_ROLL_PTR=0x83000001db0110, + ID=0x0000000000000010, + N_COLS=0x80000001, + TYPE=0x00000001, +@@ -63,7 +63,7 @@ + SPACE=0x00000002) + header=0x0000401502c8 (NAME='test/td', + DB_TRX_ID=0x000000000304, +- DB_ROLL_PTR=0x84000001370110, ++ DB_ROLL_PTR=0x84000001dc0110, + ID=0x0000000000000011, + N_COLS=0x80000001, + TYPE=0x00000021, +@@ -73,7 +73,7 @@ + SPACE=0x00000003) + header=0x0000501501b8 (NAME='test/tp', + DB_TRX_ID=0x000000000306, +- DB_ROLL_PTR=0x86000001390110, ++ DB_ROLL_PTR=0x86000001de0110, + ID=0x0000000000000013, + N_COLS=0x80000001, + TYPE=0x00000021, +@@ -83,7 +83,7 @@ + SPACE=0x00000005) + header=0x000030150284 (NAME='test/tr', + DB_TRX_ID=0x000000000302, +- DB_ROLL_PTR=0x82000001350110, ++ DB_ROLL_PTR=0x82000001da0110, + ID=0x000000000000000f, + N_COLS=0x00000001, + TYPE=0x00000001, +@@ -93,7 +93,7 @@ + SPACE=0x00000001) + header=0x000048150074 (NAME='test/tz', + DB_TRX_ID=0x000000000305, +- DB_ROLL_PTR=0x85000001380110, ++ DB_ROLL_PTR=0x85000001dd0110, + ID=0x0000000000000012, + N_COLS=0x80000001, + TYPE=0x00000023, diff --git a/mysql-test/suite/innodb/r/table_flags.result b/mysql-test/suite/innodb/r/table_flags.result new file mode 100644 index 00000000000..8d79439764c --- /dev/null +++ b/mysql-test/suite/innodb/r/table_flags.result @@ -0,0 +1,175 @@ +SET GLOBAL innodb_file_per_table=1; +CREATE TABLE tr(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=REDUNDANT; +CREATE TABLE tc(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPACT; +CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC; +CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED +KEY_BLOCK_SIZE=1; +CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC +PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; +ERROR HY000: Unknown option 'PAGE_COMPRESSED' +CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC; +SYS_TABLES clustered index root page (8): +N_RECS=9; LEVEL=0; INDEX_ID=0x0000000000000001 +header=0x01000003016e (NAME=0x696e66696d756d00) +header=0x00002815008d (NAME='SYS_DATAFILES', + DB_TRX_ID=0x000000000301, + DB_ROLL_PTR=0x81000001320194, + ID=0x000000000000000e, + N_COLS=0x00000002, + TYPE=0x00000001, + MIX_ID=0x0000000000000000, + MIX_LEN=0x00000040, + CLUSTER_NAME=NULL(0 bytes), + SPACE=0x00000000) +header=0x0000101500d5 (NAME='SYS_FOREIGN', + DB_TRX_ID=0x000000000300, + DB_ROLL_PTR=0x800000012d0110, + ID=0x000000000000000b, + N_COLS=0x00000004, + TYPE=0x00000001, + MIX_ID=0x0000000000000000, + MIX_LEN=0x00000040, + CLUSTER_NAME=NULL(0 bytes), + SPACE=0x00000000) +header=0x000018150122 (NAME='SYS_FOREIGN_COLS', + DB_TRX_ID=0x000000000300, + DB_ROLL_PTR=0x800000012d0201, + ID=0x000000000000000c, + N_COLS=0x00000004, + TYPE=0x00000001, + MIX_ID=0x0000000000000000, + MIX_LEN=0x00000040, + CLUSTER_NAME=NULL(0 bytes), + SPACE=0x00000000) +header=0x0400201501fc (NAME='SYS_TABLESPACES', + DB_TRX_ID=0x000000000301, + DB_ROLL_PTR=0x81000001320110, + ID=0x000000000000000d, + N_COLS=0x00000003, + TYPE=0x00000001, + MIX_ID=0x0000000000000000, + MIX_LEN=0x00000040, + CLUSTER_NAME=NULL(0 bytes), + SPACE=0x00000000) +header=0x000038150240 (NAME='test/tc', + DB_TRX_ID=0x000000000303, + DB_ROLL_PTR=0x83000001360110, + ID=0x0000000000000010, + N_COLS=0x80000001, + TYPE=0x00000001, + MIX_ID=0x0000000000000000, + MIX_LEN=0x00000050, + CLUSTER_NAME=NULL(0 bytes), + SPACE=0x00000002) +header=0x0000401502c8 (NAME='test/td', + DB_TRX_ID=0x000000000304, + DB_ROLL_PTR=0x84000001370110, + ID=0x0000000000000011, + N_COLS=0x80000001, + TYPE=0x00000021, + MIX_ID=0x0000000000000000, + MIX_LEN=0x00000050, + CLUSTER_NAME=NULL(0 bytes), + SPACE=0x00000003) +header=0x0000501501b8 (NAME='test/tp', + DB_TRX_ID=0x000000000306, + DB_ROLL_PTR=0x86000001390110, + ID=0x0000000000000013, + N_COLS=0x80000001, + TYPE=0x00000021, + MIX_ID=0x0000000000000000, + MIX_LEN=0x00000050, + CLUSTER_NAME=NULL(0 bytes), + SPACE=0x00000005) +header=0x000030150284 (NAME='test/tr', + DB_TRX_ID=0x000000000302, + DB_ROLL_PTR=0x82000001350110, + ID=0x000000000000000f, + N_COLS=0x00000001, + TYPE=0x00000001, + MIX_ID=0x0000000000000000, + MIX_LEN=0x00000050, + CLUSTER_NAME=NULL(0 bytes), + SPACE=0x00000001) +header=0x000048150074 (NAME='test/tz', + DB_TRX_ID=0x000000000305, + DB_ROLL_PTR=0x85000001380110, + ID=0x0000000000000012, + N_COLS=0x80000001, + TYPE=0x00000023, + MIX_ID=0x0000000000000000, + MIX_LEN=0x00000050, + CLUSTER_NAME=NULL(0 bytes), + SPACE=0x00000004) +header=0x060008030000 (NAME=0x73757072656d756d00) +SHOW CREATE TABLE tr; +Table Create Table +tr CREATE TABLE `tr` ( + `a` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT +INSERT INTO tr VALUES(42); +SHOW CREATE TABLE tc; +ERROR 42S02: Table 'test.tc' doesn't exist in engine +SHOW CREATE TABLE td; +ERROR 42S02: Table 'test.td' doesn't exist in engine +SHOW CREATE TABLE tz; +ERROR 42S02: Table 'test.tz' doesn't exist in engine +SHOW CREATE TABLE tp; +ERROR 42S02: Table 'test.tp' doesn't exist in engine +FOUND /InnoDB: Table '.test.\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|8a1|3023)/ in mysqld.1.err +FOUND /InnoDB: Cannot open table test/t[cdzp] from the internal data dictionary of InnoDB/ in mysqld.1.err +Restoring SYS_TABLES clustered index root page (8) +SHOW CREATE TABLE tr; +Table Create Table +tr CREATE TABLE `tr` ( + `a` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT +SHOW CREATE TABLE tc; +Table Create Table +tc CREATE TABLE `tc` ( + `a` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT +SHOW CREATE TABLE td; +Table Create Table +td CREATE TABLE `td` ( + `a` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +SHOW CREATE TABLE tz; +Table Create Table +tz CREATE TABLE `tz` ( + `a` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 +SHOW CREATE TABLE tp; +Table Create Table +tp CREATE TABLE `tp` ( + `a` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +BEGIN; +INSERT INTO tr VALUES(1); +INSERT INTO tc VALUES(1); +INSERT INTO td VALUES(1); +INSERT INTO tz VALUES(1); +INSERT INTO tp VALUES(1); +ROLLBACK; +SELECT * FROM tr; +a +42 +SELECT * FROM tc; +a +SELECT * FROM td; +a +SELECT * FROM tz; +a +SELECT * FROM tp; +a +DROP TABLE tr,tc,td,tz,tp; +ib_logfile0 +ib_logfile1 +ibdata1 +sys_tables.bin diff --git a/mysql-test/suite/innodb/t/row_format_redundant.test b/mysql-test/suite/innodb/t/row_format_redundant.test index b17b365651a..d10121c75c6 100644 --- a/mysql-test/suite/innodb/t/row_format_redundant.test +++ b/mysql-test/suite/innodb/t/row_format_redundant.test @@ -1,4 +1,4 @@ ---source include/innodb_page_size.inc +--source include/have_innodb.inc # Embedded mode doesn't allow restarting --source include/not_embedded.inc @@ -60,6 +60,4 @@ TRUNCATE TABLE t1; TRUNCATE TABLE t2; TRUNCATE TABLE t3; -# TODO: Shutdown, corrupt the SYS_TABLES.TYPE of the tables, restart - DROP TABLE t1,t2,t3; diff --git a/mysql-test/suite/innodb/t/table_flags.test b/mysql-test/suite/innodb/t/table_flags.test new file mode 100644 index 00000000000..4d3afcb2dec --- /dev/null +++ b/mysql-test/suite/innodb/t/table_flags.test @@ -0,0 +1,190 @@ +--source include/innodb_page_size.inc +# Embedded server tests do not support restarting +--source include/not_embedded.inc + +--disable_query_log +call mtr.add_suppression("InnoDB: New log files created, LSN="); +call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables"); +call mtr.add_suppression("InnoDB: Error: .*innodb_table_stats. not found"); +call mtr.add_suppression("InnoDB: Table '.test.\\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|8a1|3023)"); +call mtr.add_suppression("InnoDB: Cannot open table test/t[cdzp] from the internal data dictionary of InnoDB"); +call mtr.add_suppression("InnoDB: Error: table 'test/t[cdzp]'"); +FLUSH TABLES; +--enable_query_log + +let INNODB_PAGE_SIZE=`select @@innodb_page_size`; +let MYSQLD_DATADIR=`select @@datadir`; + +let bugdir= $MYSQLTEST_VARDIR/tmp/table_flags; +--mkdir $bugdir +--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err + +--let $d=--innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir +--let $d=$d --innodb-data-file-path=ibdata1:10M:autoextend +--let $d=$d --innodb-undo-tablespaces=0 +--let $restart_parameters=$d --innodb-stats-persistent=0 --innodb-file-format=1 +--source include/restart_mysqld.inc + +SET GLOBAL innodb_file_per_table=1; +CREATE TABLE tr(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=REDUNDANT; +CREATE TABLE tc(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPACT; +CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC; +CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED +KEY_BLOCK_SIZE=1; +# PAGE_COMPRESSED is supported starting with MariaDB 10.1.0 +--error ER_UNKNOWN_OPTION +CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC +PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; +CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC; + +--source include/shutdown_mysqld.inc +--perl +use strict; +my $ps= $ENV{INNODB_PAGE_SIZE}; +my $file= "$ENV{bugdir}/ibdata1"; +open(FILE, "+<", $file) || die "Unable to open $file\n"; +# Read DICT_HDR_TABLES, the root page number of CLUST_IND (SYS_TABLES.NAME). +sysseek(FILE, 7*$ps+38+32, 0) || die "Unable to seek $file"; +die "Unable to read $file" unless sysread(FILE, $_, 4) == 4; +my $sys_tables_root = unpack("N", $_); +my $page; +print "SYS_TABLES clustered index root page ($sys_tables_root):\n"; +sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file"; +die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps; +open(BACKUP, ">$ENV{bugdir}/sys_tables.bin") || die "Unable to open backup\n"; +syswrite(BACKUP, $page, $ps)==$ps || die "Unable to write backup\n"; +close(BACKUP) || die "Unable to close backup\n"; +print "N_RECS=", unpack("n", substr($page,38+16,2)); +print "; LEVEL=", unpack("n", substr($page,38+26,2)); +print "; INDEX_ID=0x", unpack("H*", substr($page,38+28,8)), "\n"; +my @fields=("NAME","DB_TRX_ID","DB_ROLL_PTR", + "ID","N_COLS","TYPE","MIX_ID","MIX_LEN","CLUSTER_NAME","SPACE"); +for (my $offset= 0x65; $offset; + $offset= unpack("n", substr($page,$offset-2,2))) +{ + print "header=0x", unpack("H*",substr($page,$offset-6,6)), " ("; + my $n_fields= unpack("n", substr($page,$offset-4,2)) >> 1 & 0x3ff; + my $start= 0; + my $name; + for (my $i= 0; $i < $n_fields; $i++) { + my $end= unpack("C", substr($page, $offset-7-$i, 1)); + print ",\n " if $i; + print "$fields[$i]="; + if ($end & 0x80) { + print "NULL(", ($end & 0x7f) - $start, " bytes)" + } elsif ($n_fields > 1 && $i == 0) { + $name= substr($page,$offset+$start,$end-$start); + print "'$name'" + } else { + print "0x", unpack("H*", substr($page,$offset+$start,$end-$start)) + } + # Corrupt SYS_TABLES.TYPE + if ($i == 5) + { + my $flags= 0; + if ($name eq 'test/tr') { +# $flags= 0x40 # DATA_DIR mismatch causes 10.0 crash! + } elsif ($name eq 'test/tc') { + $flags= 0x80 # 10.1 PAGE_COMPRESSED + } elsif ($name eq 'test/td') { + $flags= 0xf00 # 10.1 PAGE_COMPRESSION_LEVEL=15 (0..9 is valid) + } elsif ($name eq 'test/tz') { + $flags= 0x3000 # 10.1 ATOMIC_WRITES=3 (0..2 is valid) + } elsif ($name eq 'test/tp') { + $flags= 0x880 # 10.1 PAGE_COMPRESSED, PAGE_COMPRESSION_LEVEL=8 + # (in 10.1, this leaves PAGE_COMPRESSION_LEVEL=1 + # without PAGE_COMPRESSED, which should be invalid) + } + + substr($page,$offset+$start,$end-$start)= pack( + "N", $flags ^ + unpack("N", substr($page,$offset+$start,$end-$start))) + if $flags; + } + # Corrupt SYS_TABLES.MIX_LEN (ignored for ROW_FORMAT=REDUNDANT) + if ($i == 7 && $name eq 'test/tr') + { + substr($page,$offset+$start,$end-$start)= chr(255) x 4; + } + $start= $end & 0x7f; + } + print ")\n"; +} +substr($page,0,4)=pack("N",0xdeadbeef); +substr($page,$ps-8,4)=pack("N",0xdeadbeef); +sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file"; +syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n"; +close(FILE) || die "Unable to close $file\n"; +EOF +--source include/start_mysqld.inc + +SHOW CREATE TABLE tr; +INSERT INTO tr VALUES(42); +--error ER_NO_SUCH_TABLE_IN_ENGINE +SHOW CREATE TABLE tc; +--error ER_NO_SUCH_TABLE_IN_ENGINE +SHOW CREATE TABLE td; +--error ER_NO_SUCH_TABLE_IN_ENGINE +SHOW CREATE TABLE tz; +--error ER_NO_SUCH_TABLE_IN_ENGINE +SHOW CREATE TABLE tp; + +--source include/shutdown_mysqld.inc + +let SEARCH_RANGE= -50000; +let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; +--let SEARCH_PATTERN= InnoDB: Table '.test.\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|8a1|3023) +--source include/search_pattern_in_file.inc +--let SEARCH_PATTERN= InnoDB: Cannot open table test/t[cdzp] from the internal data dictionary of InnoDB +--source include/search_pattern_in_file.inc + +# Restore the backup of the corrupted SYS_TABLES clustered index root page +--perl +use strict; +my $ps= $ENV{INNODB_PAGE_SIZE}; +my $file= "$ENV{bugdir}/ibdata1"; +open(FILE, "+<", $file) || die "Unable to open $file\n"; +open(BACKUP, "<$ENV{bugdir}/sys_tables.bin") || die "Unable to open backup\n"; +# Read DICT_HDR_TABLES, the root page number of CLUST_IND (SYS_TABLES.NAME). +sysseek(FILE, 7*$ps+38+32, 0) || die "Unable to seek $file"; +die "Unable to read $file\n" unless sysread(FILE, $_, 4) == 4; +my $sys_tables_root = unpack("N", $_); +print "Restoring SYS_TABLES clustered index root page ($sys_tables_root)\n"; +sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file"; +die "Unable to read backup\n" unless sysread(BACKUP, $_, $ps) == $ps; +die "Unable to restore backup\n" unless syswrite(FILE, $_, $ps) == $ps; +close(BACKUP); +close(FILE) || die "Unable to close $file\n"; +EOF +--source include/start_mysqld.inc + +SHOW CREATE TABLE tr; +SHOW CREATE TABLE tc; +SHOW CREATE TABLE td; +SHOW CREATE TABLE tz; +SHOW CREATE TABLE tp; + +BEGIN; +INSERT INTO tr VALUES(1); +INSERT INTO tc VALUES(1); +INSERT INTO td VALUES(1); +INSERT INTO tz VALUES(1); +INSERT INTO tp VALUES(1); +ROLLBACK; + +SELECT * FROM tr; +SELECT * FROM tc; +SELECT * FROM td; +SELECT * FROM tz; +SELECT * FROM tp; + +DROP TABLE tr,tc,td,tz,tp; + +--source include/shutdown_mysqld.inc + +--let $restart_parameters= +--source include/start_mysqld.inc + +--list_files $bugdir +--remove_files_wildcard $bugdir +--rmdir $bugdir -- cgit v1.2.1 From e813fe862226554cfe31754b3dfeafbb2b9a7159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 13 Jun 2017 23:04:01 +0300 Subject: MDEV-13084 MariaDB 10.2 crashes on corrupted SYS_TABLES.MIX_LEN field innodb.row_format_redundant: Really corrupt the SYS_TABLES.MIX_LEN, and do not use any debug instrumentation. For tables created in the system tablespace, the contents of the column will be ignored. Only the table t1 will refuse to load. dict_load_table_one(): Remove the DBUG_EXECUTE_IF instrumentation. Omit a redundant error message "incorrect flags in SYS_TABLES". dict_sys_tables_rec_read(): Partially revert the Oracle Bug#21644827 fix, and always report errors by the return value. fts_create_in_mem_aux_table(): Do not rely on dict_table_t::flags2, but instead evaluate the tablespace ID. DICT_TF2_BITS: Reduce to the correct value of 7. The two extra high-order bits were specific to MySQL 5.7. --- .../suite/innodb/r/row_format_redundant.result | 15 ++- .../suite/innodb/t/row_format_redundant.test | 101 ++++++++++++++++----- 2 files changed, 86 insertions(+), 30 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/row_format_redundant.result b/mysql-test/suite/innodb/r/row_format_redundant.result index c6926872d1a..45dfdf01218 100644 --- a/mysql-test/suite/innodb/r/row_format_redundant.result +++ b/mysql-test/suite/innodb/r/row_format_redundant.result @@ -1,7 +1,9 @@ +SET GLOBAL innodb_file_per_table=1; # # Bug#21644827 - FTS, ASSERT !SRV_READ_ONLY_MODE || M_IMPL.M_LOG_MODE == # MTR_LOG_NO_REDO # +SET GLOBAL innodb_file_per_table=ON; create table t1 (a int not null, d varchar(15) not null, b varchar(198) not null, c char(156), fulltext ftsic(c)) engine=InnoDB @@ -49,6 +51,9 @@ ERROR HY000: Table 't3' is read only TRUNCATE TABLE t1; TRUNCATE TABLE t2; TRUNCATE TABLE t3; +corrupted SYS_TABLES.MIX_LEN for test/t1 +corrupted SYS_TABLES.MIX_LEN for test/t2 +corrupted SYS_TABLES.MIX_LEN for test/t3 TRUNCATE TABLE t1; ERROR 42S02: Table 'test.t1' doesn't exist in engine TRUNCATE TABLE t2; @@ -66,9 +71,9 @@ ERROR HY000: Error on rename of './test/t1' to './test/tee_one' (errno: 155 "The DROP TABLE t1; Warnings: Warning 1932 Table 'test.t1' doesn't exist in engine -NOT FOUND /\[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags. SYS_TABLES.MIX_LEN=255;/ in mysqld.1.err -FOUND 48 /\[ERROR\] InnoDB: InnoDB: Error: table unused flags are:255/ in mysqld.1.err -FOUND 1 /\[Warning\] InnoDB: Parent table of FTS auxiliary table test/FTS_.* not found\./ in mysqld.1.err -NOT FOUND /"\[Warning\] InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the \.frm file for the table exists.";/ in mysqld.1.err -FOUND 2 /\[ERROR\] InnoDB: Table `test`.`t1` does not exist in the InnoDB internal data dictionary though MariaDB is trying to (drop|rename)/ in mysqld.1.err DROP TABLE t2,t3; +FOUND 49 /\[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags\. SYS_TABLES.MIX_LEN=255\b/ in mysqld.1.err +ib_buffer_pool +ib_logfile0 +ib_logfile1 +ibdata1 diff --git a/mysql-test/suite/innodb/t/row_format_redundant.test b/mysql-test/suite/innodb/t/row_format_redundant.test index 4d41314fc79..f8e25b373de 100644 --- a/mysql-test/suite/innodb/t/row_format_redundant.test +++ b/mysql-test/suite/innodb/t/row_format_redundant.test @@ -1,13 +1,36 @@ ---source include/innodb_page_size.inc ---source include/have_debug.inc +--source include/have_innodb.inc # Embedded mode doesn't allow restarting --source include/not_embedded.inc +--disable_query_log +call mtr.add_suppression("InnoDB: Table `mysql`\\.`innodb_table_stats` not found"); +call mtr.add_suppression("InnoDB: Table `test`.`t1` in InnoDB data dictionary contains invalid flags. SYS_TABLES.MIX_LEN=255"); +call mtr.add_suppression("InnoDB: Parent table of FTS auxiliary table test/FTS_.* not found"); +call mtr.add_suppression("InnoDB: Cannot open table test/t1 from the internal data dictionary"); +call mtr.add_suppression("InnoDB: Table `test`.`t1` does not exist in the InnoDB internal data dictionary though MariaDB is trying to (rename|drop)"); +FLUSH TABLES; +--enable_query_log + +let INNODB_PAGE_SIZE=`select @@innodb_page_size`; + +let bugdir= $MYSQLTEST_VARDIR/tmp/row_format_redundant; +--mkdir $bugdir +--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err + +--let $d=--innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir +--let $d=$d --innodb-data-file-path=ibdata1:1M:autoextend +--let $d=$d --innodb-undo-tablespaces=0 --innodb-stats-persistent=0 +--let $restart_parameters= $d +--source include/restart_mysqld.inc + +SET GLOBAL innodb_file_per_table=1; + --echo # --echo # Bug#21644827 - FTS, ASSERT !SRV_READ_ONLY_MODE || M_IMPL.M_LOG_MODE == --echo # MTR_LOG_NO_REDO --echo # +SET GLOBAL innodb_file_per_table=ON; create table t1 (a int not null, d varchar(15) not null, b varchar(198) not null, c char(156), fulltext ftsic(c)) engine=InnoDB @@ -45,7 +68,7 @@ insert into t3 values(555, 'eeee', 'ccccc', 'aaaaa'); # read-only restart requires the change buffer to be empty; therefore we # do a slow shutdown. SET GLOBAL innodb_fast_shutdown=0; ---let $restart_parameters = --innodb-read-only +--let $restart_parameters= $d --innodb-read-only --source include/restart_mysqld.inc SELECT COUNT(*) FROM t1; @@ -59,7 +82,7 @@ TRUNCATE TABLE t2; --error ER_OPEN_AS_READONLY TRUNCATE TABLE t3; ---let $restart_parameters = +--let $restart_parameters= $d --source include/restart_mysqld.inc TRUNCATE TABLE t1; @@ -67,9 +90,43 @@ TRUNCATE TABLE t2; TRUNCATE TABLE t3; --source include/shutdown_mysqld.inc +--perl +use strict; +my $ps= $ENV{INNODB_PAGE_SIZE}; +my $file= "$ENV{bugdir}/ibdata1"; +open(FILE, "+<", $file) || die "Unable to open $file\n"; +# Read DICT_HDR_TABLES, the root page number of CLUST_IND (SYS_TABLES.NAME). +sysseek(FILE, 7*$ps+38+32, 0) || die "Unable to seek $file"; +die "Unable to read $file" unless sysread(FILE, $_, 4) == 4; +my $sys_tables_root = unpack("N", $_); +my $page; +sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file"; +die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps; +for (my $offset= 0x65; $offset; + $offset= unpack("n", substr($page,$offset-2,2))) +{ + my $n_fields= unpack("n", substr($page,$offset-4,2)) >> 1 & 0x3ff; + my $start= 0; + my $end= unpack("C", substr($page, $offset-7, 1)); + my $name= substr($page,$offset+$start,$end-$start); + for (my $i= 0; $i < $n_fields; $i++) { + my $end= unpack("C", substr($page, $offset-7-$i, 1)); + # Corrupt SYS_TABLES.MIX_LEN (ignored for ROW_FORMAT=REDUNDANT) + if ($i == 7 && $name =~ '^test/t[123]') + { + print "corrupted SYS_TABLES.MIX_LEN for $name\n"; + substr($page,$offset+$start,$end-$start)= pack("N", 255); + } + $start= $end & 0x7f; + } +} +substr($page,0,4)=pack("N",0xdeadbeef); +substr($page,$ps-8,4)=pack("N",0xdeadbeef); +sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file"; +syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n"; +close(FILE) || die "Unable to close $file\n"; +EOF -# FIXME: Corrupt the SYS_TABLES.TYPE of the tables, do not use --debug ---let $restart_parameters = --debug=d,ib_table_invalid_flags --source include/start_mysqld.inc --error ER_NO_SUCH_TABLE_IN_ENGINE TRUNCATE TABLE t1; @@ -82,25 +139,19 @@ SELECT COUNT(*) FROM t3; --error ER_ERROR_ON_RENAME RENAME TABLE t1 TO tee_one; DROP TABLE t1; +DROP TABLE t2,t3; ---disable_query_log -call mtr.add_suppression("\\[ERROR\\] InnoDB: Table `test`\\.`t1` in InnoDB data dictionary contains invalid flags\\. SYS_TABLES\\.MIX_LEN=255"); -call mtr.add_suppression("\\[ERROR\\] InnoDB: InnoDB: Error: table unused flags are:255"); -call mtr.add_suppression("\\[Warning\\] InnoDB: Parent table of FTS auxiliary table test/FTS_.* not found\\."); -call mtr.add_suppression("\\[Warning\\] InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the \\.frm file for the table exists."); -call mtr.add_suppression("\\[ERROR\\] InnoDB: Table `test`.`t1` does not exist in the InnoDB internal data dictionary though MariaDB is trying to (drop|rename)"); - ---enable_query_log -let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; ---let SEARCH_PATTERN= \[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags. SYS_TABLES.MIX_LEN=255; ---source include/search_pattern_in_file.inc ---let SEARCH_PATTERN= \[ERROR\] InnoDB: InnoDB: Error: table unused flags are:255 ---source include/search_pattern_in_file.inc ---let SEARCH_PATTERN= \[Warning\] InnoDB: Parent table of FTS auxiliary table test/FTS_.* not found\. ---source include/search_pattern_in_file.inc ---let SEARCH_PATTERN= "\\[Warning\\] InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the \.frm file for the table exists."; ---source include/search_pattern_in_file.inc ---let SEARCH_PATTERN= \[ERROR\] InnoDB: Table `test`.`t1` does not exist in the InnoDB internal data dictionary though MariaDB is trying to (drop|rename) +--let SEARCH_PATTERN= \[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags\. SYS_TABLES.MIX_LEN=255\b --source include/search_pattern_in_file.inc -DROP TABLE t2,t3; +--let $restart_parameters= +--source include/restart_mysqld.inc + +--list_files $bugdir +--remove_files_wildcard $bugdir +--rmdir $bugdir + +# Remove the data file, because DROP TABLE skipped it for the "corrupted" table +--let MYSQLD_DATADIR=`select @@datadir` +--remove_file $MYSQLD_DATADIR/test/t1.ibd +--list_files $MYSQLD_DATADIR/test -- cgit v1.2.1 From 91ae1258ee29405c0e7c6c196aef2e870c11ec01 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Fri, 7 Apr 2017 15:38:01 +0200 Subject: MDEV-12471: BULK Command BULK execution moved to a new command. --- mysql-test/suite/sys_vars/r/sysvars_server_embedded.result | 4 ++-- mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index 8880c9f8ca9..bf5e267bf44 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -2867,9 +2867,9 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES SESSION_VALUE NULL -GLOBAL_VALUE 187 +GLOBAL_VALUE 188 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 187 +DEFAULT_VALUE 188 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Maximum number of statement instruments. diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 11d6594ee80..8b062075db8 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -3063,9 +3063,9 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES SESSION_VALUE NULL -GLOBAL_VALUE 187 +GLOBAL_VALUE 188 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 187 +DEFAULT_VALUE 188 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Maximum number of statement instruments. -- cgit v1.2.1 From 3b1921c714fcb4415cea9058408fb5a626e93b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 8 Jun 2017 08:25:53 +0300 Subject: Re-record failing SEQUENCE tests --- mysql-test/suite/rpl/r/sequence.result | 20 ++++++++++---------- mysql-test/suite/sql_sequence/other.result | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 10 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/rpl/r/sequence.result b/mysql-test/suite/rpl/r/sequence.result index 9e0c8b7bc5b..6286c5c7106 100644 --- a/mysql-test/suite/rpl/r/sequence.result +++ b/mysql-test/suite/rpl/r/sequence.result @@ -38,7 +38,7 @@ insert into t1 select * from s1; insert into s1 values(-100,-1000,9223372036854775806,1,1,1000,0,0); insert into t1 select * from s1; select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 10 0 0 21 1 9223372036854775806 1 1 10 0 0 21 1 9223372036854775806 1 1 10 0 0 @@ -47,7 +47,7 @@ next_value min_value max_value start increment cache cycle round -100 -1000 9223372036854775806 1 1 1000 0 0 connection slave; select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 10 0 0 21 1 9223372036854775806 1 1 10 0 0 21 1 9223372036854775806 1 1 10 0 0 @@ -56,7 +56,7 @@ next_value min_value max_value start increment cache cycle round -100 -1000 9223372036854775806 1 1 1000 0 0 connection slave2; select * from t1; -next_value min_value max_value start increment cache cycle round +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count 1 1 9223372036854775806 1 1 10 0 0 21 1 9223372036854775806 1 1 10 0 0 21 1 9223372036854775806 1 1 10 0 0 @@ -69,14 +69,14 @@ master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; CREATE SEQUENCE s1 cache=10 master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` ( - `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', - `min_value` bigint(21) NOT NULL COMMENT 'min value', - `max_value` bigint(21) NOT NULL COMMENT 'max value', - `start` bigint(21) NOT NULL COMMENT 'start value', + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache` bigint(21) NOT NULL COMMENT 'cache size', - `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', - `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) PAGE_CHECKSUM=1 master-bin.000001 # Annotate_rows # # create table t1 select * from s1 master-bin.000001 # Table_map # # table_id: # (test.t1) diff --git a/mysql-test/suite/sql_sequence/other.result b/mysql-test/suite/sql_sequence/other.result index c415ac38064..90e3a0737c6 100644 --- a/mysql-test/suite/sql_sequence/other.result +++ b/mysql-test/suite/sql_sequence/other.result @@ -148,3 +148,17 @@ next_not_cached_value minimum_value maximum_value start_value increment cache_si 4001 1 9223372036854775806 1 1 1000 0 0 commit; drop sequence s1; +# +# Flush tables with read lock +# +create sequence s1; +select next value for s1; +next value for s1 +1 +flush tables with read lock; +create sequence s2; +ERROR HY000: Can't execute the query because you have a conflicting read lock +select next value for s1; +ERROR HY000: Can't execute the query because you have a conflicting read lock +unlock tables; +drop sequence s1; -- cgit v1.2.1 From 88b961816e90c57b0f6f166e6c7650a1ae540751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 15 Jun 2017 12:40:24 +0300 Subject: Re-record a failing test, likely related to MDEV-12610 --- .../suite/encryption/r/innodb_lotoftables.result | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/encryption/r/innodb_lotoftables.result b/mysql-test/suite/encryption/r/innodb_lotoftables.result index b7cfdd2db9d..86ab60e7836 100644 --- a/mysql-test/suite/encryption/r/innodb_lotoftables.result +++ b/mysql-test/suite/encryption/r/innodb_lotoftables.result @@ -12,13 +12,13 @@ create database innodb_encrypted_1; use innodb_encrypted_1; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 1 +Innodb_pages0_read 3 set autocommit=0; set autocommit=1; commit work; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 1 +Innodb_pages0_read 3 # should be 100 SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE NAME LIKE 'innodb_encrypted%'; COUNT(*) @@ -88,47 +88,47 @@ Innodb_pages0_read 3 # Restart Success! show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 1 +Innodb_pages0_read 3 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 1 +Innodb_pages0_read 3 use test; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 1 +Innodb_pages0_read 3 use innodb_encrypted_1; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 1 +Innodb_pages0_read 3 use innodb_encrypted_2; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 1 +Innodb_pages0_read 3 use innodb_encrypted_3; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 1 +Innodb_pages0_read 3 use innodb_encrypted_1; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 1 +Innodb_pages0_read 3 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 101 +Innodb_pages0_read 103 use innodb_encrypted_2; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 101 +Innodb_pages0_read 103 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 201 +Innodb_pages0_read 203 use innodb_encrypted_3; show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 201 +Innodb_pages0_read 203 show status like 'innodb_pages0_read%'; Variable_name Value -Innodb_pages0_read 301 +Innodb_pages0_read 303 SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%'; COUNT(*) 100 -- cgit v1.2.1 From 72378a25830184f91005be7e80cfb28381c79f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 14 Jun 2017 14:08:49 +0300 Subject: MDEV-12873 InnoDB SYS_TABLES.TYPE incompatibility for PAGE_COMPRESSED=YES in MariaDB 10.2.2 to 10.2.6 Remove the SHARED_SPACE flag that was erroneously introduced in MariaDB 10.2.2, and shift the SYS_TABLES.TYPE flags back to where they were before MariaDB 10.2.2. While doing this, ensure that tables created with affected MariaDB versions can be loaded, and also ensure that tables created with MySQL 5.7 using the TABLESPACE attribute cannot be loaded. MariaDB 10.2.2 picked the SHARED_SPACE flag from MySQL 5.7, shifting the MariaDB 10.1 flags PAGE_COMPRESSION, PAGE_COMPRESSION_LEVEL, ATOMIC_WRITES by one bit. The SHARED_SPACE flag would always be written as 0 by MariaDB, because MariaDB does not support CREATE TABLESPACE or CREATE TABLE...TABLESPACE for InnoDB. So, instead of the bits AALLLLCxxxxxxx we would have AALLLLC0xxxxxxx if the table was created with MariaDB 10.2.2 to 10.2.6. (AA=ATOMIC_WRITES, LLLL=PAGE_COMPRESSION_LEVEL, C=PAGE_COMPRESSED, xxxxxxx=7 bits that were not moved.) PAGE_COMPRESSED=NO implies LLLLC=00000. That is not a problem. If someone created a table in MariaDB 10.2.2 or 10.2.3 with the attribute ATOMIC_WRITES=OFF (value 2; AA=10) and without PAGE_COMPRESSED=YES or PAGE_COMPRESSION_LEVEL, the table should be rejected. We ignore this problem, because it should be unlikely for anyone to specify ATOMIC_WRITES=OFF, and because 10.2.2 and 10.2.2 were not mature releases. The value ATOMIC_WRITES=ON (1) would be interpreted as ATOMIC_WRITES=OFF, but starting with MariaDB 10.2.4 the ATOMIC_WRITES attribute is ignored. PAGE_COMPRESSED=YES implies that PAGE_COMPRESSION_LEVEL be between 1 and 9 and that ROW_FORMAT be COMPACT or DYNAMIC. Thus, the affected wrong bit pattern in SYS_TABLES.TYPE is of the form AALLLL10DB00001 where D signals the presence of a DATA DIRECTORY attribute and B is 1 for ROW_FORMAT=DYNAMIC and 0 for ROW_FORMAT=COMPACT. We must interpret this bit pattern as AALLLL1DB00001 (discarding the extraneous 0 bit). dict_sys_tables_rec_read(): Adjust the affected bit pattern when reading the SYS_TABLES.TYPE column. In case of invalid flags, report both SYS_TABLES.TYPE (after possible adjustment) and SYS_TABLES.MIX_LEN. dict_load_table_one(): Replace an unreachable condition on !dict_tf2_is_valid() with a debug assertion. The flags will already have been validated by dict_sys_tables_rec_read(); if that validation fails, dict_load_table_low() will have failed. fil_ibd_create(): Shorten an error message about a file pre-existing. Datafile::validate_to_dd(): Clarify an error message about tablespace flags mismatch. ha_innobase::open(): Remove an unnecessary warning message. dict_tf_is_valid(): Simplify and stricten the logic. Validate the values of PAGE_COMPRESSION. Remove error log output; let the callers handle that. DICT_TF_BITS: Remove ATOMIC_WRITES, PAGE_ENCRYPTION, PAGE_ENCRYPTION_KEY. The ATOMIC_WRITES is ignored once the SYS_TABLES.TYPE has been validated; there is no need to store it in dict_table_t::flags. The PAGE_ENCRYPTION and PAGE_ENCRYPTION_KEY are unused since MariaDB 10.1.4 (the GA release was 10.1.8). DICT_TF_BIT_MASK: Remove (unused). FSP_FLAGS_MEM_ATOMIC_WRITES: Remove (the flags are never read). row_import_read_v1(): Display an error if dict_tf_is_valid() fails. --- mysql-test/suite/innodb/r/row_format_redundant.result | 2 +- mysql-test/suite/innodb/t/row_format_redundant.test | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/row_format_redundant.result b/mysql-test/suite/innodb/r/row_format_redundant.result index 45dfdf01218..2bc8769092f 100644 --- a/mysql-test/suite/innodb/r/row_format_redundant.result +++ b/mysql-test/suite/innodb/r/row_format_redundant.result @@ -72,7 +72,7 @@ DROP TABLE t1; Warnings: Warning 1932 Table 'test.t1' doesn't exist in engine DROP TABLE t2,t3; -FOUND 49 /\[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags\. SYS_TABLES.MIX_LEN=255\b/ in mysqld.1.err +FOUND 49 /\[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=1 SYS_TABLES\.MIX_LEN=255\b/ in mysqld.1.err ib_buffer_pool ib_logfile0 ib_logfile1 diff --git a/mysql-test/suite/innodb/t/row_format_redundant.test b/mysql-test/suite/innodb/t/row_format_redundant.test index f8e25b373de..af3fe3b52cf 100644 --- a/mysql-test/suite/innodb/t/row_format_redundant.test +++ b/mysql-test/suite/innodb/t/row_format_redundant.test @@ -4,7 +4,7 @@ --disable_query_log call mtr.add_suppression("InnoDB: Table `mysql`\\.`innodb_table_stats` not found"); -call mtr.add_suppression("InnoDB: Table `test`.`t1` in InnoDB data dictionary contains invalid flags. SYS_TABLES.MIX_LEN=255"); +call mtr.add_suppression("InnoDB: Table `test`.`t1` in InnoDB data dictionary contains invalid flags. SYS_TABLES\\.TYPE=1 SYS_TABLES\\.MIX_LEN=255\\r?$"); call mtr.add_suppression("InnoDB: Parent table of FTS auxiliary table test/FTS_.* not found"); call mtr.add_suppression("InnoDB: Cannot open table test/t1 from the internal data dictionary"); call mtr.add_suppression("InnoDB: Table `test`.`t1` does not exist in the InnoDB internal data dictionary though MariaDB is trying to (rename|drop)"); @@ -141,7 +141,7 @@ RENAME TABLE t1 TO tee_one; DROP TABLE t1; DROP TABLE t2,t3; ---let SEARCH_PATTERN= \[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags\. SYS_TABLES.MIX_LEN=255\b +--let SEARCH_PATTERN= \[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=1 SYS_TABLES\.MIX_LEN=255\b --source include/search_pattern_in_file.inc --let $restart_parameters= -- cgit v1.2.1 From f73507e68526b491c2e1d35293602d4caf577436 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Fri, 16 Jun 2017 18:37:38 +0200 Subject: result fix --- mysql-test/suite/plugins/r/show_all_plugins.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/plugins/r/show_all_plugins.result b/mysql-test/suite/plugins/r/show_all_plugins.result index 4471011b660..dd6cbfce4c4 100644 --- a/mysql-test/suite/plugins/r/show_all_plugins.result +++ b/mysql-test/suite/plugins/r/show_all_plugins.result @@ -26,7 +26,7 @@ three_attempts NOT INSTALLED AUTHENTICATION dialog_examples.so GPL two_questions NOT INSTALLED AUTHENTICATION dialog_examples.so GPL show status like '%libraries%'; Variable_name Value -Opened_plugin_libraries 8 +Opened_plugin_libraries 7 show plugins soname where library = 'ha_example.so'; Name Status Type Library License EXAMPLE NOT INSTALLED STORAGE ENGINE ha_example.so GPL -- cgit v1.2.1 From 9a646c91dde8234c5b32660e029fa97f446fcf41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 29 May 2017 14:24:18 +0300 Subject: Mariabackup: Remove the --stats option The option was basically duplicating InnoDB functionality. Persistent statistics can be accessed via the tables mysql.innodb_table_stats and mysql.innodb_index_stats. --- mysql-test/suite/mariabackup/full_backup.test | 1 - mysql-test/suite/mariabackup/incremental_encrypted.test | 5 ----- mysql-test/suite/mariabackup/xb_file_key_management.test | 1 - 3 files changed, 7 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/mariabackup/full_backup.test b/mysql-test/suite/mariabackup/full_backup.test index a79f54c67e4..f987410cf76 100644 --- a/mysql-test/suite/mariabackup/full_backup.test +++ b/mysql-test/suite/mariabackup/full_backup.test @@ -13,7 +13,6 @@ INSERT INTO t VALUES(2); echo # xtrabackup prepare; --disable_result_log exec $XTRABACKUP --prepare --target-dir=$targetdir; -exec $XTRABACKUP --defaults-file=$targetdir/backup-my.cnf --stats --datadir=$targetdir; -- source include/restart_and_restore.inc --enable_result_log diff --git a/mysql-test/suite/mariabackup/incremental_encrypted.test b/mysql-test/suite/mariabackup/incremental_encrypted.test index c379b3c8165..04f4ba5d18a 100644 --- a/mysql-test/suite/mariabackup/incremental_encrypted.test +++ b/mysql-test/suite/mariabackup/incremental_encrypted.test @@ -27,11 +27,6 @@ echo # Prepare full backup, apply incremental one; exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir; exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir; -# stats also can support encryption, but needs plugin-load and plugin variables, they are stored in backup-my.cnf -# We need to prepare again to create log files though. -exec $XTRABACKUP --prepare --target-dir=$basedir; -exec $XTRABACKUP --defaults-file=$basedir/backup-my.cnf --stats --datadir=$basedir; - echo # Restore and check results; let $targetdir=$basedir; -- source include/restart_and_restore.inc diff --git a/mysql-test/suite/mariabackup/xb_file_key_management.test b/mysql-test/suite/mariabackup/xb_file_key_management.test index bc975a7cdc4..be0b15eb387 100644 --- a/mysql-test/suite/mariabackup/xb_file_key_management.test +++ b/mysql-test/suite/mariabackup/xb_file_key_management.test @@ -19,7 +19,6 @@ echo # xtrabackup prepare; --disable_result_log exec $XTRABACKUP --prepare --target-dir=$targetdir; -exec $XTRABACKUP --defaults-file=$targetdir/backup-my.cnf --stats --datadir=$targetdir ; -- source include/restart_and_restore.inc --enable_result_log -- cgit v1.2.1 From d1e182d603c73e42a18667f3984d6487c9a3b090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 19 Jun 2017 15:59:19 +0300 Subject: MDEV-12975 InnoDB redo log minimum size check uses detected file size instead of requested innodb_log_file_size log_calc_max_ages(): Use the requested size in the check, instead of the detected redo log size. The redo log will be resized at startup if it differs from what has been requested. --- mysql-test/suite/innodb/t/log_file_size.test | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/t/log_file_size.test b/mysql-test/suite/innodb/t/log_file_size.test index 4bae93957e8..9cc7742f6a8 100644 --- a/mysql-test/suite/innodb/t/log_file_size.test +++ b/mysql-test/suite/innodb/t/log_file_size.test @@ -1,6 +1,6 @@ # Test resizing the InnoDB redo log. ---source include/have_innodb.inc +--source include/innodb_page_size_small.inc # Embedded server does not support crashing --source include/not_embedded.inc @@ -37,6 +37,12 @@ call mtr.add_suppression("Attempting backtrace"); FLUSH TABLES; --enable_query_log +--let $restart_parameters= --innodb-thread-concurrency=1 --innodb-log-file-size=1m --innodb-log-files-in-group=2 +--source include/restart_mysqld.inc + +--let $restart_parameters= --innodb-thread-concurrency=100 --innodb-log-file-size=10M --innodb-log-files-in-group=2 +--source include/restart_mysqld.inc + CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB; BEGIN; INSERT INTO t1 VALUES (42); -- cgit v1.2.1