diff options
Diffstat (limited to 'mysql-test/suite')
24 files changed, 549 insertions, 249 deletions
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 4129deb6fc5..8a6fe8e16c1 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -16,9 +16,7 @@ MDEV-20225 : MDEV-20886 galera.MDEV-20225 MW-328A : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002 MW-328B : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002 MW-329 : MDEV-19962 Galera test failure on MW-329 -galera_FK_duplicate_client_insert : MDEV-24473: galera.galera_FK_duplicate_client_insert MTR failed: SIGABRT. InnoDB: Conflicting lock on table. Assertion failure in lock0lock.cc galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event() -galera_bf_abort_at_after_statement : MDEV-21557: galera_bf_abort_at_after_statement MTR failed: query 'reap' succeeded - should have failed with errno 1213 galera_bf_abort_group_commit : MDEV-18282 Galera test failure on galera.galera_bf_abort_group_commit galera_bf_kill_debug : MDEV-24485 wsrep::client_state::do_acquire_ownership(): Assertion `state_ == s_idle || mode_ != m_local' failed galera_bf_lock_wait : MDEV-21597 wsrep::transaction::start_transaction(): Assertion `active() == false' failed @@ -32,18 +30,12 @@ galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails galera_pc_ignore_sb : MDEV-20888 galera.galera_pc_ignore_sb galera_pc_recovery : MDEV-25199 cluster fails to start up galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim -galera_toi_ddl_nonconflicting : MDEV-21518 galera.galera_toi_ddl_nonconflicting -galera_toi_truncate : MDEV-22996 Hang on galera_toi_truncate test case galera_trigger : MDEV-24048 galera.galera_trigger MTR fails: Result content mismatch +galera_var_ignore_apply_errors : MDEV-26770 galera_var_ignore_apply_errors fails Server did not transition to READY state galera_var_node_address : MDEV-20485 Galera test failure galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang -galera_var_reject_queries : assertion in inline_mysql_socket_send -galera_var_replicate_myisam_on : MDEV-24062 Galera test failure on galera_var_replicate_myisam_on galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit mysql-wsrep#198 : MDEV-24446: galera.mysql-wsrep#198 MTR failed: query 'reap' failed: 2000: Unknown MySQL error partition : MDEV-19958 Galera test failure on galera.partition query_cache: MDEV-15805 Test failure on galera.query_cache versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch -galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons -pxc-421: wsrep_provider is read-only for security reasons - diff --git a/mysql-test/suite/galera/r/galera_toi_truncate.result b/mysql-test/suite/galera/r/galera_toi_truncate.result index a02487ac347..bd3ee0dd75e 100644 --- a/mysql-test/suite/galera/r/galera_toi_truncate.result +++ b/mysql-test/suite/galera/r/galera_toi_truncate.result @@ -3,16 +3,24 @@ connection node_1; connection node_1; CREATE TABLE ten (f1 INTEGER NOT NULL PRIMARY KEY) 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 t1 (id int not null primary key auto_increment, f1 INTEGER) ENGINE=InnoDB; connection node_2; -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, ten AS a7, ten AS a8; -connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; -connection node_2a; +set session wsrep_sync_wait=0; +connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1b; +SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; +connection node_2; +INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1; +connection node_1b; +SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; +connection node_1; +TRUNCATE TABLE t1;; +connection node_1b; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; +SET GLOBAL debug_dbug = ""; +SET DEBUG_SYNC = "RESET"; connection node_1; -TRUNCATE TABLE t1; connection node_2; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction SELECT COUNT(*) AS EXPECT_0 FROM t1; EXPECT_0 0 @@ -20,5 +28,6 @@ connection node_1; SELECT COUNT(*) AS EXPECT_0 FROM t1; EXPECT_0 0 +disconnect node_1b; DROP TABLE t1; DROP TABLE ten; diff --git a/mysql-test/suite/galera/r/galera_var_reject_queries.result b/mysql-test/suite/galera/r/galera_var_reject_queries.result index 1b2bc1c5e16..33ee9262638 100644 --- a/mysql-test/suite/galera/r/galera_var_reject_queries.result +++ b/mysql-test/suite/galera/r/galera_var_reject_queries.result @@ -1,11 +1,6 @@ -<<<<<<< HEAD connection node_2; connection node_1; -||||||| merged common ancestors -======= -call mtr.add_suppression("WSREP has not yet prepared node for application use"); ->>>>>>> 10.3 -CREATE TABLE t1 (f1 INTEGER); +CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) engine=innodb; connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; connection node_1; SET SESSION wsrep_reject_queries = ALL; @@ -27,7 +22,7 @@ VARIABLE_VALUE = 2 INSERT INTO t1 VALUES (1); connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET GLOBAL wsrep_reject_queries = NONE; -SELECT COUNT(*) = 1 FROM t1; -COUNT(*) = 1 +SELECT COUNT(*) AS EXPECT_1 FROM t1; +EXPECT_1 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result b/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result index ad28f5a426e..314da703e58 100644 --- a/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result +++ b/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result @@ -53,8 +53,8 @@ COUNT(*) = 0 1 DROP TABLE t1; connection node_1; -CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM; -CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; +CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t2 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES (1); @@ -100,7 +100,7 @@ DROP TABLE t2; # MDEV-11152: wsrep_replicate_myisam: SELECT gets replicated using TO # connection node_1; -CREATE TABLE t1 (i INT) ENGINE=INNODB; +CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE=INNODB; INSERT INTO t1 VALUES(1); SELECT * FROM t1; i @@ -237,5 +237,14 @@ DROP TRIGGER tr1; DROP TRIGGER tr2; DROP TRIGGER tr3; DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, UNIQUE(a)) ENGINE=MyISAM; +CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=1; +SET GLOBAL wsrep_replicate_myisam=ON; +INSERT INTO t1 (a,b) VALUES (10,20); +connection node_2; +SELECT * from t1; +a b +1 20 connection node_1; +DROP TABLE t1; connection node_2; diff --git a/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result b/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result deleted file mode 100644 index 7a645407004..00000000000 --- a/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result +++ /dev/null @@ -1,23 +0,0 @@ -connection node_2; -connection node_1; -connection node_1; -connection node_2; -connection node_1; -CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -INSERT INTO t1 VALUES (1); -connection node_2; -SET GLOBAL wsrep_provider='none'; -INSERT INTO t1 VALUES (2); -connection node_1; -INSERT INTO t1 VALUES (3); -connection node_2; -SET SESSION wsrep_sync_wait = 0; -INSERT INTO t1 VALUES (4); -SELECT COUNT(*) = 4 FROM t1; -COUNT(*) = 4 -1 -connection node_1; -SELECT COUNT(*) = 3 FROM t1; -COUNT(*) = 3 -1 -DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/pxc-421.result b/mysql-test/suite/galera/r/pxc-421.result deleted file mode 100644 index 058af15c098..00000000000 --- a/mysql-test/suite/galera/r/pxc-421.result +++ /dev/null @@ -1,46 +0,0 @@ -connection node_2; -connection node_1; -connection node_1; -connection node_2; -connection node_1; -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; -set GLOBAL wsrep_slave_threads=16; -SET GLOBAL wsrep_provider='none'; -INSERT INTO t1 VALUES (2); -connection node_1; -INSERT INTO t1 VALUES (3); -connection node_2; -INSERT INTO t1 VALUES (4); -set GLOBAL wsrep_slave_threads=5; -SELECT COUNT(*) = 5 FROM t1; -COUNT(*) = 5 -1 -connection node_1; -set GLOBAL wsrep_slave_threads=12; -SELECT COUNT(*) = 4 FROM t1; -COUNT(*) = 4 -1 -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'; -Variable_name Value -wsrep_slave_threads 5 -SET GLOBAL wsrep_slave_threads = 1; -SELECT COUNT(*) FROM t1; -COUNT(*) -16 -connection node_1; -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/galera_toi_ddl_nonconflicting.test b/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test index dbd2510cba3..d431fc0b9ed 100644 --- a/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test +++ b/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test @@ -8,6 +8,8 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER); --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1'; +--source include/wait_condition.inc --send ALTER TABLE t1 ADD COLUMN f3 INTEGER; INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 123); --connection node_1 diff --git a/mysql-test/suite/galera/t/galera_toi_truncate.test b/mysql-test/suite/galera/t/galera_toi_truncate.test index 5b23a8c3f3e..ab94d9397ce 100644 --- a/mysql-test/suite/galera/t/galera_toi_truncate.test +++ b/mysql-test/suite/galera/t/galera_toi_truncate.test @@ -6,6 +6,7 @@ --source include/galera_cluster.inc --source include/have_debug_sync.inc --source include/have_debug.inc +--source include/galera_have_debug_sync.inc # # INSERT and TRUNCATE on different nodes @@ -15,32 +16,51 @@ CREATE TABLE ten (f1 INTEGER NOT NULL PRIMARY KEY) 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 t1 (id int not null primary key auto_increment, f1 INTEGER) ENGINE=InnoDB; --connection node_2 +set session wsrep_sync_wait=0; --let $wait_condition = SELECT COUNT(*) = 10 FROM ten; --source include/wait_condition.inc -# 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, ten AS a7, ten AS a8 +--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connection node_1b ---connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 ---connection node_2a ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Sending data%' AND INFO LIKE 'INSERT INTO t1 (f1)%'; ---source include/wait_condition.inc +# block applier before applying +SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; + +--connection node_2 +--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1 + +--connection node_1b +# wait until applier has reached the sync point +SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; --connection node_1 -TRUNCATE TABLE t1; +--send TRUNCATE TABLE t1; + +--connection node_1b +# release the applier +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; +SET GLOBAL debug_dbug = ""; +SET DEBUG_SYNC = "RESET"; + +--connection node_1 +--reap --connection node_2 ---error ER_LOCK_DEADLOCK --reap +--let $wait_condition = SELECT COUNT(*) = 0 FROM t1; +--source include/wait_condition.inc SELECT COUNT(*) AS EXPECT_0 FROM t1; --connection node_1 +--let $wait_condition = SELECT COUNT(*) = 0 FROM t1; +--source include/wait_condition.inc SELECT COUNT(*) AS EXPECT_0 FROM t1; +--disconnect node_1b + DROP TABLE t1; DROP TABLE ten; diff --git a/mysql-test/suite/galera/t/galera_var_reject_queries.test b/mysql-test/suite/galera/t/galera_var_reject_queries.test index aa31b94d6e0..60aabe9bc17 100644 --- a/mysql-test/suite/galera/t/galera_var_reject_queries.test +++ b/mysql-test/suite/galera/t/galera_var_reject_queries.test @@ -5,9 +5,7 @@ --source include/galera_cluster.inc --source include/have_innodb.inc -call mtr.add_suppression("WSREP has not yet prepared node for application use"); - -CREATE TABLE t1 (f1 INTEGER); +CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) engine=innodb; --connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 @@ -44,6 +42,6 @@ INSERT INTO t1 VALUES (1); --connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1 SET GLOBAL wsrep_reject_queries = NONE; -SELECT COUNT(*) = 1 FROM t1; +SELECT COUNT(*) AS EXPECT_1 FROM t1; DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test b/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test index adb5cb04273..acebe4cccdc 100644 --- a/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test +++ b/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test @@ -80,8 +80,8 @@ DROP TABLE t1; # --connection node_1 -CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM; -CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; +CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t2 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES (1); @@ -136,7 +136,7 @@ DROP TABLE t2; --echo # MDEV-11152: wsrep_replicate_myisam: SELECT gets replicated using TO --echo # --connection node_1 -CREATE TABLE t1 (i INT) ENGINE=INNODB; +CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE=INNODB; INSERT INTO t1 VALUES(1); # This command should not get replicated. SELECT * FROM t1; @@ -218,7 +218,16 @@ DROP TRIGGER tr2; DROP TRIGGER tr3; DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, UNIQUE(a)) ENGINE=MyISAM; +CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a=1; +SET GLOBAL wsrep_replicate_myisam=ON; +INSERT INTO t1 (a,b) VALUES (10,20); + +--connection node_2 +SELECT * from t1; --connection node_1 +DROP TABLE t1; + --disable_query_log --eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig --enable_query_log @@ -227,3 +236,4 @@ DROP TABLE t1,t2; --disable_query_log --eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig --enable_query_log + diff --git a/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test b/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test deleted file mode 100644 index 7f91495fcc4..00000000000 --- a/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test +++ /dev/null @@ -1,50 +0,0 @@ -# -# Test that wsrep_provider can be unset and then set back to its original value -# and replication will continue except for any updates made while the value was 'none' -# - ---source include/galera_cluster.inc ---source include/have_innodb.inc - -# Save original auto_increment_offset values. ---let $node_1=node_1 ---let $node_2=node_2 ---source include/auto_increment_offset_save.inc - ---connection node_1 -CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -INSERT INTO t1 VALUES (1); - ---connection node_2 ---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 - -SET SESSION wsrep_sync_wait = 0; - ---source include/wait_until_connected_again.inc ---source include/galera_wait_ready.inc - -INSERT INTO t1 VALUES (4); - -# Node #2 has all the inserts -SELECT COUNT(*) = 4 FROM t1; - ---connection node_1 -# Node #1 is missing the insert made while Node #2 was not replicated -SELECT COUNT(*) = 3 FROM t1; - -DROP TABLE t1; - ---source include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera/t/pxc-421.test b/mysql-test/suite/galera/t/pxc-421.test deleted file mode 100644 index 33a2b157f18..00000000000 --- a/mysql-test/suite/galera/t/pxc-421.test +++ /dev/null @@ -1,67 +0,0 @@ -# -# 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 - -# Save original auto_increment_offset values. ---let $node_1=node_1 ---let $node_2=node_2 ---source include/auto_increment_offset_save.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 - -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; - ---source include/auto_increment_offset_restore.inc - diff --git a/mysql-test/suite/galera_3nodes_sr/r/MDEV-26707.result b/mysql-test/suite/galera_3nodes_sr/r/MDEV-26707.result new file mode 100644 index 00000000000..8de724c1576 --- /dev/null +++ b/mysql-test/suite/galera_3nodes_sr/r/MDEV-26707.result @@ -0,0 +1,86 @@ +connection node_2; +connection node_1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connect node_3a, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +connection node_2; +SET SESSION wsrep_trx_fragment_size=1; +BEGIN; +INSERT INTO t1 VALUES (21); +connection node_1; +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_streaming_log; +EXPECT_1 +1 +connection node_2; +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_streaming_log; +EXPECT_1 +1 +connection node_3; +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_streaming_log; +EXPECT_1 +1 +connection node_3a; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1'; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_sync_wait = DEFAULT; +connection node_1a; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_sync_wait = DEFAULT; +connection node_2a; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_sync_wait = DEFAULT; +connection node_2; +SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continue'; +COMMIT; +connection node_2a; +SET DEBUG_SYNC = 'now WAIT_FOR before_cert'; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1'; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_sync_wait = DEFAULT; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_2; +ERROR HY000: Got error 6 "No such device or address" during COMMIT +connection node_2a; +SET DEBUG_SYNC = 'RESET'; +connection node_1a; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_sync_wait = DEFAULT; +connection node_3a; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0'; +SET SESSION wsrep_sync_wait = 0; +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_streaming_log; +EXPECT_1 +1 +SET SESSION wsrep_sync_wait = DEFAULT; +connection node_1a; +SET SESSION wsrep_sync_wait = 0; +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_streaming_log; +EXPECT_1 +1 +SET SESSION wsrep_sync_wait = DEFAULT; +connection node_2a; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0'; +SET SESSION wsrep_sync_wait = DEFAULT; +connection node_1a; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_sync_wait = DEFAULT; +connection node_3a; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_sync_wait = DEFAULT; +connection node_1a; +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +connection node_2a; +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +connection node_3a; +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_3nodes_sr/r/galera_sr_kill_slave_before_apply.result b/mysql-test/suite/galera_3nodes_sr/r/galera_sr_kill_slave_before_apply.result index e9dc5518e96..933038e00f1 100644 --- a/mysql-test/suite/galera_3nodes_sr/r/galera_sr_kill_slave_before_apply.result +++ b/mysql-test/suite/galera_3nodes_sr/r/galera_sr_kill_slave_before_apply.result @@ -32,14 +32,18 @@ Killing server ... # restart connection node_1; COMMIT; -SELECT COUNT(*) = 5 FROM t1; -COUNT(*) = 5 +count_match 1 -connection node_2; -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 +count_match 1 connection node_1; +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 +connection node_2; +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 +connection node_1; DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/suite/galera_3nodes_sr/suite.pm b/mysql-test/suite/galera_3nodes_sr/suite.pm index a65c2b5df30..becc764733a 100644 --- a/mysql-test/suite/galera_3nodes_sr/suite.pm +++ b/mysql-test/suite/galera_3nodes_sr/suite.pm @@ -37,6 +37,8 @@ push @::global_suppressions, qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored.|, qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), + qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), + qr|WSREP: .*core_handle_uuid_msg.*|, qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on), qr(WSREP: JOIN message from member .* in non-primary configuration. Ignored.), ); diff --git a/mysql-test/suite/galera_3nodes_sr/t/MDEV-26707.test b/mysql-test/suite/galera_3nodes_sr/t/MDEV-26707.test new file mode 100644 index 00000000000..ed7adc8313a --- /dev/null +++ b/mysql-test/suite/galera_3nodes_sr/t/MDEV-26707.test @@ -0,0 +1,162 @@ +# +# MDEV-26707: SR transaction rolls back locally, but not in cluster +# +# This test excercises the following scenario: +# Initially we have a three node cluster where node 2 has an active +# SR transaction that has replicated one fragment. +# Node 3 disconnects from the cluster, followed by disconnect of node 2. +# Node 2 attempts to COMMIT its transaction, but fails because node 2 is +# non-primary. This failure causes the transaction to rolled back locally +# (node 2 can't communicate with the cluster at this point, so rollback +# fragment cannot be sent successfully) +# Node 3 joins back creating non-primary view (node 1, node 3). +# Then node 2 joins back creating primary view (node 1, node 1, node 3). +# If bug is present, we have that node 2 has rolled back locally, while +# the same transaction is still active nodes 1 and 3, leaving entries +# in their wsrep_streaming_log tables. +# + +--source include/galera_cluster.inc +--source include/have_debug_sync.inc + +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 +--connect node_3a, 127.0.0.1, root, , test, $NODE_MYPORT_3 + + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); + +--connection node_2 +SET SESSION wsrep_trx_fragment_size=1; +BEGIN; +INSERT INTO t1 VALUES (21); + +--connection node_1 +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_streaming_log; + +--connection node_2 +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_streaming_log; + +--connection node_3 +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_streaming_log; + +# +# Disconnect node 3 from cluster +# +--connection node_3a +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1'; +SET SESSION wsrep_sync_wait = 0; +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc +SET SESSION wsrep_sync_wait = DEFAULT; + +--connection node_1a +SET SESSION wsrep_sync_wait = 0; +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc +SET SESSION wsrep_sync_wait = DEFAULT; + +--connection node_2a +SET SESSION wsrep_sync_wait = 0; +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc +SET SESSION wsrep_sync_wait = DEFAULT; + +# +# Issue commit block COMMIT before certification on node 2 +# +--connection node_2 +SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continue'; +--send COMMIT + +--connection node_2a +SET DEBUG_SYNC = 'now WAIT_FOR before_cert'; + +# +# Disconnect node 2 +# +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1'; +SET SESSION wsrep_sync_wait = 0; +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc +SET SESSION wsrep_sync_wait = DEFAULT; + + +# +# Unblock COMMIT and expect it to fail +# +SET DEBUG_SYNC = 'now SIGNAL continue'; + +--connection node_2 +--error ER_ERROR_DURING_COMMIT +--reap + +--connection node_2a +SET DEBUG_SYNC = 'RESET'; + +--connection node_1a +SET SESSION wsrep_sync_wait = 0; +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc +SET SESSION wsrep_sync_wait = DEFAULT; + + +# +# Reconnect node 3 +# +--connection node_3a +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0'; +SET SESSION wsrep_sync_wait = 0; +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_streaming_log; +SET SESSION wsrep_sync_wait = DEFAULT; + +--connection node_1a +SET SESSION wsrep_sync_wait = 0; +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_streaming_log; +SET SESSION wsrep_sync_wait = DEFAULT; + + +# +# Reconnect node 2 +# +--connection node_2a +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0'; +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc +--source include/galera_wait_ready.inc +SET SESSION wsrep_sync_wait = DEFAULT; + +--connection node_1a +SET SESSION wsrep_sync_wait = 0; +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc +--source include/galera_wait_ready.inc +SET SESSION wsrep_sync_wait = DEFAULT; + +--connection node_3a +SET SESSION wsrep_sync_wait = 0; +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc +--source include/galera_wait_ready.inc +SET SESSION wsrep_sync_wait = DEFAULT; + + +# +# Expect no entries in wsrep_streaming_log +# +--connection node_1a +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +--connection node_2a +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +--connection node_3a +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; + + +--connection node_1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_before_apply.test b/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_before_apply.test index 92566fa6323..ea549a6bea2 100644 --- a/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_before_apply.test +++ b/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_before_apply.test @@ -51,20 +51,37 @@ INSERT INTO t1 VALUES (5); --source include/kill_galera.inc --source include/start_mysqld.inc -# Expect that the SR table will get some entries after the restart ---let $wait_condition = SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; ---source include/wait_condition.inc - --connection node_1 +# The following COMMIT usually succeeds. Due to timing, +# it is however possible that this node delivers the same +# view twice during configuration change. In which case +# this transaction will mistakenly be considered orphaned, +# and aborted. +--error 0, ER_LOCK_DEADLOCK COMMIT; -SELECT COUNT(*) = 5 FROM t1; ---connection node_2 -SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; ---let $wait_condition = SELECT COUNT(*) = 5 FROM t1; ---source include/wait_condition.inc -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +--disable_query_log +if ($mysql_errno == 0) { + --connection node_1 + SELECT COUNT(*) = 5 AS count_match FROM t1; + --connection node_2 + SELECT COUNT(*) = 5 AS count_match FROM t1; +} + +if ($mysql_errno == 1213) { + --connection node_1 + SELECT COUNT(*) = 0 AS count_match FROM t1; + --connection node_2 + SELECT COUNT(*) = 0 AS count_match FROM t1; +} +--enable_query_log + +--connection node_1 +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; + +--connection node_2 +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; --connection node_1 DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/mdev-14846.result b/mysql-test/suite/innodb/r/mdev-14846.result new file mode 100644 index 00000000000..219bd718feb --- /dev/null +++ b/mysql-test/suite/innodb/r/mdev-14846.result @@ -0,0 +1,52 @@ +CREATE TABLE t1 ( +pk INT, +f1 VARCHAR(10) NOT NULL, +f2 VARCHAR(10) NULL, +f3 INT UNSIGNED NULL, +KEY (f1), +PRIMARY KEY (pk) +) ENGINE=InnoDB; +CREATE OR REPLACE ALGORITHM=MERGE VIEW v4 AS SELECT * FROM t1; +INSERT INTO t1 VALUES (1,'k','g',6),(2,'y','r',0),(3,'t','q',1),(4,'a','r',NULL),(5,'z','t',NULL); +CREATE TABLE t2 (f VARCHAR(10) NULL) ENGINE=InnoDB; +INSERT INTO t2 VALUES (NULL),('g'),('e'),('g'); +CREATE TABLE t3 ( +f1 VARCHAR(10) NOT NULL, +f2 VARCHAR(10) NULL, +f3 INT UNSIGNED NULL +) ENGINE=InnoDB; +INSERT INTO t3 VALUES ('k','n',9),('y','b',8),('m','w',6); +CREATE TABLE t4 (f INT NULL) ENGINE=InnoDB; +INSERT INTO t4 VALUES (8),(9); +UPDATE t1 SET t1.pk = -109 WHERE t1.f1 IN ( SELECT 'a' FROM t4 WHERE f >= 1 ); +SET DEBUG_SYNC='now SIGNAL con1_dml'; +connect con1,localhost,root,,test; +SET DEBUG_SYNC='now WAIT_FOR con1_dml'; +begin; +SELECT * FROM t1 for update; +pk f1 f2 f3 +-109 a r NULL +1 k g 6 +2 y r 0 +3 t q 1 +5 z t NULL +SET DEBUG_SYNC='now SIGNAL default_dml'; +connection default; +SET DEBUG_SYNC='now WAIT_FOR default_dml'; +UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h'; +connect con2,localhost,root,,test; +set debug_sync='now WAIT_FOR default_dml'; +SET DEBUG_SYNC='now SIGNAL con1_dml2'; +disconnect con2; +connection con1; +SET DEBUG_SYNC='now WAIT_FOR con1_dml2'; +UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 ); +connection default; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection con1; +COMMIT; +disconnect con1; +connection default; +DROP VIEW v4; +DROP TABLE t1, t2, t3, t4; +set debug_sync= reset; diff --git a/mysql-test/suite/innodb/t/mdev-14846.opt b/mysql-test/suite/innodb/t/mdev-14846.opt new file mode 100644 index 00000000000..c8fe0561390 --- /dev/null +++ b/mysql-test/suite/innodb/t/mdev-14846.opt @@ -0,0 +1 @@ +--loose-innodb_lock_waits diff --git a/mysql-test/suite/innodb/t/mdev-14846.test b/mysql-test/suite/innodb/t/mdev-14846.test new file mode 100644 index 00000000000..adcefecd52f --- /dev/null +++ b/mysql-test/suite/innodb/t/mdev-14846.test @@ -0,0 +1,70 @@ +--source include/have_innodb.inc +--source include/count_sessions.inc +--source include/have_debug_sync.inc + +CREATE TABLE t1 ( + pk INT, + f1 VARCHAR(10) NOT NULL, + f2 VARCHAR(10) NULL, + f3 INT UNSIGNED NULL, + KEY (f1), + PRIMARY KEY (pk) +) ENGINE=InnoDB; + +CREATE OR REPLACE ALGORITHM=MERGE VIEW v4 AS SELECT * FROM t1; +INSERT INTO t1 VALUES (1,'k','g',6),(2,'y','r',0),(3,'t','q',1),(4,'a','r',NULL),(5,'z','t',NULL); + +CREATE TABLE t2 (f VARCHAR(10) NULL) ENGINE=InnoDB; +INSERT INTO t2 VALUES (NULL),('g'),('e'),('g'); + +CREATE TABLE t3 ( + f1 VARCHAR(10) NOT NULL, + f2 VARCHAR(10) NULL, + f3 INT UNSIGNED NULL +) ENGINE=InnoDB; + +INSERT INTO t3 VALUES ('k','n',9),('y','b',8),('m','w',6); + +CREATE TABLE t4 (f INT NULL) ENGINE=InnoDB; +INSERT INTO t4 VALUES (8),(9); +UPDATE t1 SET t1.pk = -109 WHERE t1.f1 IN ( SELECT 'a' FROM t4 WHERE f >= 1 ); +SET DEBUG_SYNC='now SIGNAL con1_dml'; + +--connect (con1,localhost,root,,test) +SET DEBUG_SYNC='now WAIT_FOR con1_dml'; +begin; +SELECT * FROM t1 for update; # Holds x lock of all records in the table t1 +SET DEBUG_SYNC='now SIGNAL default_dml'; + +--connection default +SET DEBUG_SYNC='now WAIT_FOR default_dml'; +--send UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h' +# It holds the lock of all record in t3 and tries to acquire record lock for the table t1. + +--connect (con2,localhost,root,,test) +set debug_sync='now WAIT_FOR default_dml'; +let $wait_condition= +select count(*) > 0 from information_schema.innodb_lock_waits; +--source include/wait_condition.inc +SET DEBUG_SYNC='now SIGNAL con1_dml2'; +disconnect con2; + +# Cleanup +--connection con1 +SET DEBUG_SYNC='now WAIT_FOR con1_dml2'; +UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 ); +# It holds the record lock on table t1 and tries to acquire record lock on t3. +# leads to deadlock (con1 trx is waiting for default trx and vice versa) + +--connection default +--error ER_LOCK_DEADLOCK +--reap + +connection con1; +COMMIT; +disconnect con1; + +--connection default +DROP VIEW v4; +DROP TABLE t1, t2, t3, t4; +set debug_sync= reset; diff --git a/mysql-test/suite/plugins/r/feedback_plugin_send.result b/mysql-test/suite/plugins/r/feedback_plugin_send.result index 5a48c703ec4..69046e16dd9 100644 --- a/mysql-test/suite/plugins/r/feedback_plugin_send.result +++ b/mysql-test/suite/plugins/r/feedback_plugin_send.result @@ -24,7 +24,23 @@ VARIABLE_VALUE>0 VARIABLE_NAME 1 Collation used utf8mb4_bin 1 Collation used utf8_bin 1 Collation used utf8_general_ci +prepare stmt from "SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK WHERE VARIABLE_NAME LIKE 'Collation used %' ORDER BY VARIABLE_NAME"; +execute stmt; +VARIABLE_VALUE>0 VARIABLE_NAME +1 Collation used binary +1 Collation used latin1_swedish_ci +1 Collation used utf8mb4_bin +1 Collation used utf8_bin +1 Collation used utf8_general_ci +execute stmt; +VARIABLE_VALUE>0 VARIABLE_NAME +1 Collation used binary +1 Collation used latin1_swedish_ci +1 Collation used utf8mb4_bin +1 Collation used utf8_bin +1 Collation used utf8_general_ci +deallocate prepare stmt; set global sql_mode=ONLY_FULL_GROUP_BY; # restart -6: feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent -6: feedback plugin: server replied 'ok' +feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent +feedback plugin: server replied 'ok' diff --git a/mysql-test/suite/plugins/t/feedback_plugin_send.test b/mysql-test/suite/plugins/t/feedback_plugin_send.test index b28f9d4cb38..0ea1814ec29 100644 --- a/mysql-test/suite/plugins/t/feedback_plugin_send.test +++ b/mysql-test/suite/plugins/t/feedback_plugin_send.test @@ -38,6 +38,6 @@ perl; while ($_=<LOG>) { $logg{$&}++ if /feedback plugin:.*/; } - print "$logg{$_}: $_\n" for sort keys %logg; + print "$_\n" for sort keys %logg; close LOG; EOF diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result index e07f1408ab7..0cdc5945acf 100644 --- a/mysql-test/suite/versioning/r/alter.result +++ b/mysql-test/suite/versioning/r/alter.result @@ -763,6 +763,25 @@ set system_versioning_alter_history= keep; alter ignore table t1 drop pk; drop table t1; # +# MDEV-22660 SIGSEGV on adding system versioning and modifying system column +# +create or replace table t1 (a int); +alter table t1 +add row_start timestamp(6) as row start, +add row_end timestamp(6) as row end, +add period for system_time(row_start, row_end), +with system versioning, +modify row_end varchar(8); +ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `row_start` and `row_end` +alter table t1 +add row_start timestamp(6) as row start, +add row_end timestamp(6) as row end, +add period for system_time(row_start, row_end), +with system versioning, +modify row_start varchar(8); +ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `row_start` and `row_end` +drop table t1; +# # MDEV-21941 RENAME doesn't work for system time or period fields # create or replace table t1 (a int) with system versioning; diff --git a/mysql-test/suite/versioning/t/alter.test b/mysql-test/suite/versioning/t/alter.test index 9d3101fb4ad..85b61c8655e 100644 --- a/mysql-test/suite/versioning/t/alter.test +++ b/mysql-test/suite/versioning/t/alter.test @@ -656,6 +656,28 @@ drop table t1; --echo # +--echo # MDEV-22660 SIGSEGV on adding system versioning and modifying system column +--echo # +create or replace table t1 (a int); +--error ER_VERS_PERIOD_COLUMNS +alter table t1 + add row_start timestamp(6) as row start, + add row_end timestamp(6) as row end, + add period for system_time(row_start, row_end), + with system versioning, + modify row_end varchar(8); +--error ER_VERS_PERIOD_COLUMNS +alter table t1 + add row_start timestamp(6) as row start, + add row_end timestamp(6) as row end, + add period for system_time(row_start, row_end), + with system versioning, + modify row_start varchar(8); +# cleanup +drop table t1; + + +--echo # --echo # MDEV-21941 RENAME doesn't work for system time or period fields --echo # create or replace table t1 (a int) with system versioning; |