diff options
Diffstat (limited to 'mysql-test/suite')
31 files changed, 511 insertions, 127 deletions
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 8583fd72760..f81fb849c77 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -12,6 +12,7 @@ MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently with Galera/replication victim kill 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.galera_defaults : MDEV-21494 Galera test sporadic failure on galera.galera_defaults galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event() diff --git a/mysql-test/suite/galera/r/galera_fk_cascade_delete.result b/mysql-test/suite/galera/r/galera_fk_cascade_delete.result index 73375ae55c5..a6c6504dc39 100644 --- a/mysql-test/suite/galera/r/galera_fk_cascade_delete.result +++ b/mysql-test/suite/galera/r/galera_fk_cascade_delete.result @@ -1,3 +1,8 @@ +# +# test phase with cascading foreign key through 3 tables +# +connection node_1; +set wsrep_sync_wait=0; CREATE TABLE grandparent ( id INT NOT NULL PRIMARY KEY ) ENGINE=InnoDB; @@ -19,14 +24,15 @@ INSERT INTO grandparent VALUES (1),(2); INSERT INTO parent VALUES (1,1), (2,2); INSERT INTO child VALUES (1,1), (2,2); connection node_2; +set wsrep_sync_wait=0; DELETE FROM grandparent WHERE id = 1; connection node_1; -SELECT COUNT(*) = 0 FROM parent WHERE grandparent_id = 1; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1; -COUNT(*) = 0 -1 +SELECT COUNT(*), COUNT(*) = 0 FROM parent WHERE grandparent_id = 1; +COUNT(*) COUNT(*) = 0 +0 1 +SELECT COUNT(*), COUNT(*) = 0 FROM child WHERE parent_id = 1; +COUNT(*) COUNT(*) = 0 +0 1 DROP TABLE child; DROP TABLE parent; DROP TABLE grandparent; diff --git a/mysql-test/suite/galera/r/galera_fk_cascade_delete_debug.result b/mysql-test/suite/galera/r/galera_fk_cascade_delete_debug.result new file mode 100644 index 00000000000..89613b2856a --- /dev/null +++ b/mysql-test/suite/galera/r/galera_fk_cascade_delete_debug.result @@ -0,0 +1,67 @@ +# +# test phase with foreign key of varchar type +# +connection node_1; +CREATE TABLE parent ( +`id` varchar(36) COLLATE utf8_unicode_ci NOT NULL, +PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE child ( +`id` int NOT NULL, +`parent_id` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL, +PRIMARY KEY (`id`), +KEY `parent_id` (`parent_id`), +CONSTRAINT `ipallocations_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO parent VALUES ('row one'), ('row two'); +INSERT INTO child VALUES (1,'row one'), (2,'row two'); +connection node_2; +DELETE FROM parent; +connection node_1; +SELECT COUNT(*), COUNT(*) = 0 FROM parent; +COUNT(*) COUNT(*) = 0 +0 1 +SELECT COUNT(*), COUNT(*) = 0 FROM child; +COUNT(*) COUNT(*) = 0 +0 1 +DROP TABLE child; +DROP TABLE parent; +# +# test phase with MM conflict in FK cascade +# +connection node_1; +set wsrep_retry_autocommit=0; +CREATE TABLE parent ( +id INT NOT NULL PRIMARY KEY +) ENGINE=InnoDB; +CREATE TABLE child ( +id INT NOT NULL PRIMARY KEY, +j int default 0, +parent_id INT, +FOREIGN KEY (parent_id) +REFERENCES parent(id) +ON DELETE CASCADE +) ENGINE=InnoDB; +INSERT INTO parent VALUES (1); +INSERT INTO child VALUES (1,0,1); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; +connection node_2; +DELETE FROM parent; +connection node_1a; +SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; +connection node_1; +update child set j=2;; +connection node_1a; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; +SET GLOBAL debug_dbug = ""; +SET DEBUG_SYNC = "RESET"; +connection node_1; +SELECT COUNT(*), COUNT(*) = 0 FROM parent; +COUNT(*) COUNT(*) = 0 +0 1 +SELECT COUNT(*), COUNT(*) = 0 FROM child; +COUNT(*) COUNT(*) = 0 +0 1 +DROP TABLE child; +DROP TABLE parent; diff --git a/mysql-test/suite/galera/r/galera_trigger.result b/mysql-test/suite/galera/r/galera_trigger.result new file mode 100644 index 00000000000..112d3f39aa0 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_trigger.result @@ -0,0 +1,32 @@ +CREATE TABLE IF NOT EXISTS t1 (id int(10) not null primary key) engine=innodb; +CREATE OR REPLACE TRIGGER tr1 +BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET NEW.id = 100; +END| +INSERT INTO t1 VALUES (1); +SELECT * from t1; +id +100 +CREATE OR REPLACE TRIGGER tr1 +BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET NEW.id = 200; +END| +connection node_2; +SET SESSION wsrep_sync_wait=15; +SELECT * FROM t1; +id +100 +INSERT INTO t1 values (2); +SELECT * FROM t1; +id +100 +200 +connection node_1; +SELECT * FROM t1; +id +100 +200 +DROP TRIGGER tr1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_fk_cascade_delete.test b/mysql-test/suite/galera/t/galera_fk_cascade_delete.test index 9b79b4c30b6..6f0de0a1f4a 100644 --- a/mysql-test/suite/galera/t/galera_fk_cascade_delete.test +++ b/mysql-test/suite/galera/t/galera_fk_cascade_delete.test @@ -3,7 +3,13 @@ # --source include/galera_cluster.inc ---source include/have_innodb.inc + +--echo # +--echo # test phase with cascading foreign key through 3 tables +--echo # + +--connection node_1 +set wsrep_sync_wait=0; CREATE TABLE grandparent ( id INT NOT NULL PRIMARY KEY @@ -30,11 +36,17 @@ INSERT INTO parent VALUES (1,1), (2,2); INSERT INTO child VALUES (1,1), (2,2); --connection node_2 +set wsrep_sync_wait=0; + +--let $wait_condition = SELECT COUNT(*) = 2 FROM child; +--source include/wait_condition.inc DELETE FROM grandparent WHERE id = 1; --connection node_1 -SELECT COUNT(*) = 0 FROM parent WHERE grandparent_id = 1; -SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1; +--let $wait_condition = SELECT COUNT(*) = 1 FROM child; +--source include/wait_condition.inc +SELECT COUNT(*), COUNT(*) = 0 FROM parent WHERE grandparent_id = 1; +SELECT COUNT(*), COUNT(*) = 0 FROM child WHERE parent_id = 1; DROP TABLE child; DROP TABLE parent; diff --git a/mysql-test/suite/galera/t/galera_fk_cascade_delete_debug.test b/mysql-test/suite/galera/t/galera_fk_cascade_delete_debug.test new file mode 100644 index 00000000000..f38c028b7d6 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_fk_cascade_delete_debug.test @@ -0,0 +1,98 @@ +--source include/galera_cluster.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc + +--echo # +--echo # test phase with foreign key of varchar type +--echo # +--connection node_1 + CREATE TABLE parent ( + `id` varchar(36) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + + + CREATE TABLE child ( + `id` int NOT NULL, + `parent_id` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `parent_id` (`parent_id`), + CONSTRAINT `ipallocations_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + + +INSERT INTO parent VALUES ('row one'), ('row two'); +INSERT INTO child VALUES (1,'row one'), (2,'row two'); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 2 FROM child; +--source include/wait_condition.inc +DELETE FROM parent; + +--connection node_1 +--let $wait_condition = SELECT COUNT(*) = 0 FROM child; +--source include/wait_condition.inc + +SELECT COUNT(*), COUNT(*) = 0 FROM parent; +SELECT COUNT(*), COUNT(*) = 0 FROM child; + +DROP TABLE child; +DROP TABLE parent; + +--echo # +--echo # test phase with MM conflict in FK cascade +--echo # + +--connection node_1 +set wsrep_retry_autocommit=0; +CREATE TABLE parent ( + id INT NOT NULL PRIMARY KEY +) ENGINE=InnoDB; + +CREATE TABLE child ( + id INT NOT NULL PRIMARY KEY, + j int default 0, + parent_id INT, + FOREIGN KEY (parent_id) + REFERENCES parent(id) + ON DELETE CASCADE +) ENGINE=InnoDB; + +INSERT INTO parent VALUES (1); +INSERT INTO child VALUES (1,0,1); + +# block applier before applying +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM child; +--source include/wait_condition.inc +DELETE FROM parent; + +--connection node_1a +# wait until applier has reached the sync point +SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; + + +--connection node_1 +# issue conflicting write to child table, it should fail in certification +--error ER_LOCK_DEADLOCK +--send update child set j=2; + +--connection node_1a +# release the applier +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; +SET GLOBAL debug_dbug = ""; +SET DEBUG_SYNC = "RESET"; + +--connection node_1 +--reap + +--let $wait_condition = SELECT COUNT(*) = 0 FROM child; +--source include/wait_condition.inc +SELECT COUNT(*), COUNT(*) = 0 FROM parent; +SELECT COUNT(*), COUNT(*) = 0 FROM child; + +DROP TABLE child; +DROP TABLE parent; diff --git a/mysql-test/suite/galera/t/galera_trigger.test b/mysql-test/suite/galera/t/galera_trigger.test new file mode 100644 index 00000000000..54508583f4b --- /dev/null +++ b/mysql-test/suite/galera/t/galera_trigger.test @@ -0,0 +1,36 @@ +--source include/galera_cluster.inc +# +# MDEV-21578 CREATE OR REPLACE TRIGGER in Galera cluster not replicating +# +CREATE TABLE IF NOT EXISTS t1 (id int(10) not null primary key) engine=innodb; +--delimiter | +CREATE OR REPLACE TRIGGER tr1 +BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET NEW.id = 100; +END| +--delimiter ; + +INSERT INTO t1 VALUES (1); +SELECT * from t1; + +--delimiter | +CREATE OR REPLACE TRIGGER tr1 +BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET NEW.id = 200; +END| +--delimiter ; + +--connection node_2 +SET SESSION wsrep_sync_wait=15; +SELECT * FROM t1; +INSERT INTO t1 values (2); +SELECT * FROM t1; + +--connection node_1 +SELECT * FROM t1; + +DROP TRIGGER tr1; +DROP TABLE t1; + diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def index 415da407cf7..c6d3ece75d1 100644 --- a/mysql-test/suite/galera_3nodes/disabled.def +++ b/mysql-test/suite/galera_3nodes/disabled.def @@ -10,12 +10,6 @@ # ############################################################################## -galera_ipv6_mariabackup : MDEV-23573 Could not open '../galera/include/have_mariabackup.inc' -galera_ipv6_mariabackup_section : MDEV-23574 Could not open '../galera/include/have_mariabackup.inc' -galera_ipv6_mysqldump : MDEV-23576 WSREP_SST: [ERROR] rsync daemon port '16008' has been taken -galera_ipv6_rsyn : MDEV-23581 WSREP_SST: [ERROR] rsync daemon port '16008' has been taken -galera_ipv6_rsync_section : MDEV-23580 WSREP_SST: [ERROR] rsync daemon port '16008' has been taken -galera_ipv6_xtrabackup-v2 : MDEV-23575 WSREP_SST: [ERROR] innobackupex not in path galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(} galera_slave_options_do :MDEV-8798 galera_slave_options_ignore : MDEV-8798 diff --git a/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result b/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result deleted file mode 100644 index 6ed7587303d..00000000000 --- a/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result +++ /dev/null @@ -1,17 +0,0 @@ -connection node_1; -connection node_2; -connection node_3; -connection node_1; -CREATE TABLE t1 (f1 INTEGER); -INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -connection node_2; -SELECT COUNT(*) = 10 FROM t1; -COUNT(*) = 10 -1 -Killing server ... -connection node_1; -INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20); -SELECT COUNT(*) = 20 FROM t1; -COUNT(*) = 20 -1 -DROP TABLE t1; diff --git a/mysql-test/suite/galera_3nodes/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm index 4a861f3b9fa..350e4af98ff 100644 --- a/mysql-test/suite/galera_3nodes/suite.pm +++ b/mysql-test/suite/galera_3nodes/suite.pm @@ -22,7 +22,6 @@ push @::global_suppressions, qr(WSREP:.*down context.*), qr(WSREP: Failed to send state UUID:), qr(WSREP: last inactive check more than .* skipping check), - qr(WSREP: SQL statement was ineffective), qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned.), qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, qr(WSREP: Quorum: No node with complete state), @@ -36,14 +35,38 @@ push @::global_suppressions, qr(WSREP: user message in state LEAVING), qr(WSREP: .* sending install message failed: Transport endpoint is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), - qr(WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.), + qr(WSREP: Maximum writeset size exceeded by .*), + qr(WSREP: transaction size exceeded.*), + qr(WSREP: RBR event .*), + qr(WSREP: Ignoring error for TO isolated action: .*), + qr(WSREP: transaction size limit .*), + qr(WSREP: rbr write fail, .*), + qr(WSREP: .*Backend not supported: foo.*), + qr(WSREP: .*Failed to initialize backend using .*), + qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*), + qr(WSREP: gcs connect failed: Socket type not supported), + qr(WSREP: failed to open gcomm backend connection: 110: failed to reach primary view: 110 .*), + qr(WSREP: .*Failed to open backend connection: -110 .*), + qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*), + qr(WSREP: gcs connect failed: Connection timed out), + qr|WSREP: wsrep::connect\(.*\) failed: 7|, + qr(WSREP: SYNC message from member .* in non-primary configuration. Ignored.), qr(WSREP: Could not find peer:), + qr(WSREP: TO isolation failed for: .*), qr|WSREP: gcs_caused\(\) returned .*|, 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: Unsupported protocol downgrade: incremental data collection disabled. Expect abort.|, 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: discarding established .*), + 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.), + qr|WSREP: JOIN message from member .* in non-primary configuration. Ignored.|, + qr(WSREP: Failed to remove page file .*), + qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*), + qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.|, + qr|WSREP: Trying to continue unpaused monitor|, ); bless { }; diff --git a/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.cnf b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.cnf deleted file mode 100644 index 35ecb8b5937..00000000000 --- a/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.cnf +++ /dev/null @@ -1,4 +0,0 @@ -!include ../galera_3nodes.cnf - -[mysqld] -wsrep-causal-reads=OFF diff --git a/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test deleted file mode 100644 index 8dfb4660f3e..00000000000 --- a/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test +++ /dev/null @@ -1,80 +0,0 @@ -# -# This test uses innobackupex to take a backup on node #2 and then restores that node from backup -# - ---source include/galera_cluster.inc ---source include/have_innodb.inc ---source include/have_mariabackup.inc - ---let $galera_connection_name = node_3 ---let $galera_server_number = 3 ---source include/galera_connect.inc - -# Save original auto_increment_offset values. ---let $node_1=node_1 ---let $node_2=node_2 ---let $node_3=node_3 ---source ../galera/include/auto_increment_offset_save.inc - ---connection node_1 -CREATE TABLE t1 (f1 INTEGER); -INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); - ---connection node_2 -SELECT COUNT(*) = 10 FROM t1; - ---exec rm -rf $MYSQL_TMP_DIR/innobackupex_backup ---exec mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --galera-info --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp $MYSQL_TMP_DIR/innobackupex_backup &> $MYSQL_TMP_DIR/innobackupex-backup.log ---exec mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --apply-log --galera-info --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp $MYSQL_TMP_DIR/innobackupex_backup &> $MYSQL_TMP_DIR/innobackupex-apply.log - ---source ../galera/include/kill_galera.inc ---sleep 1 - ---connection node_1 -INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20); - ---exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/* ---exec mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --copy-back --port=$NODE_MYPORT_2 --host=127.0.0.1 $MYSQL_TMP_DIR/innobackupex_backup &> $MYSQL_TMP_DIR/innobackupex-restore.log - -# -# Convert the xtrabackup_galera_info into a grastate.dat file -# - ---perl - use strict; - my $xtrabackup_galera_info_file = $ENV{'MYSQL_TMP_DIR'}.'/innobackupex_backup/xtrabackup_galera_info'; - open(XTRABACKUP_GALERA_INFO, $xtrabackup_galera_info_file) or die "Can not open $xtrabackup_galera_info_file: $!"; - my $xtrabackup_galera_info = <XTRABACKUP_GALERA_INFO>; - my ($uuid, $seqno) = split(':', $xtrabackup_galera_info); - - my $grastate_dat_file = $ENV{'MYSQLTEST_VARDIR'}.'/mysqld.2/data/grastate.dat'; - die "grastate.dat already exists" if -e $grastate_dat_file; - - open(GRASTATE_DAT, ">$grastate_dat_file") or die "Can not write to $grastate_dat_file: $!"; - print GRASTATE_DAT "version: 2.1\n"; - print GRASTATE_DAT "uuid: $uuid\n"; - print GRASTATE_DAT "seqno: $seqno\n"; - print GRASTATE_DAT "cert_index:\n"; - exit(0); -EOF - ---source include/start_mysqld.inc ---sleep 5 - ---source include/wait_until_connected_again.inc ---let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; ---source include/wait_condition.inc - -SELECT COUNT(*) = 20 FROM t1; - -DROP TABLE t1; - ---sleep 10 - ---let $galera_connection_name = node_2a ---let $galera_server_number = 2 ---source include/galera_connect.inc ---let $node_2=node_2a - -# Restore original auto_increment_offset values. ---source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test index 863ce65b579..ae489117942 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test @@ -1,7 +1,8 @@ --source include/galera_cluster.inc --source include/check_ipv6.inc --source include/have_innodb.inc ---source ../galera/include/have_mariabackup.inc +--source include/have_mariabackup.inc +--source include/force_restart.inc # Confirm that initial handshake happened over ipv6 diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test index 78fcf0873fc..2c5aae8534d 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test @@ -1,7 +1,8 @@ --source include/galera_cluster.inc --source include/check_ipv6.inc --source include/have_innodb.inc ---source ../galera/include/have_mariabackup.inc +--source include/have_mariabackup.inc +--source include/force_restart.inc # Confirm that initial handshake happened over ipv6 diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test index 4a6de8abb9c..c9e08f58950 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test @@ -1,5 +1,6 @@ --source include/galera_cluster.inc --source include/check_ipv6.inc +--source include/force_restart.inc call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to'"); call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos"); diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.test index 1937eb43e13..fff776d98b6 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.test +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.test @@ -1,5 +1,6 @@ --source include/galera_cluster.inc --source include/check_ipv6.inc +--source include/force_restart.inc # Confirm that initial handshake happened over ipv6 diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.test index 1937eb43e13..fff776d98b6 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.test +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.test @@ -1,5 +1,6 @@ --source include/galera_cluster.inc --source include/check_ipv6.inc +--source include/force_restart.inc # Confirm that initial handshake happened over ipv6 diff --git a/mysql-test/suite/galera_3nodes/t/galera_var_dirty_reads2.test b/mysql-test/suite/galera_3nodes/t/galera_var_dirty_reads2.test index e3f94a012b8..6476c4fe4fa 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_var_dirty_reads2.test +++ b/mysql-test/suite/galera_3nodes/t/galera_var_dirty_reads2.test @@ -34,6 +34,9 @@ SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_dirty_reads = 1; +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1; +--source include/wait_condition.inc + # Those statements should succeed --error 0 @@ -111,6 +114,7 @@ SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.PROCESSLIST; # Restore cluster SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +--source include/galera_wait_ready.inc --connection node_1 --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; diff --git a/mysql-test/suite/gcol/inc/gcol_keys.inc b/mysql-test/suite/gcol/inc/gcol_keys.inc index 97c9e41b5e8..475ab96e56f 100644 --- a/mysql-test/suite/gcol/inc/gcol_keys.inc +++ b/mysql-test/suite/gcol/inc/gcol_keys.inc @@ -747,4 +747,66 @@ ANALYZE TABLE t1, t2; --eval $query DROP TABLE t1, t2; +if($support_virtual_index) +{ +--echo # +--echo # MDEV-20618 Assertion `btr_validate_index(index, 0, false)' failed +--echo # in row_upd_sec_index_entry +--echo # +CREATE TABLE t1 (A BIT(15), VA BIT(10) GENERATED ALWAYS AS (A),PK INT, + PRIMARY KEY (PK), UNIQUE KEY (VA)); + +INSERT IGNORE INTO t1 VALUES ( '\r1','a',1); +--error ER_DATA_TOO_LONG +REPLACE INTO t1 (PK) VALUES (1); + +DROP TABLE t1; + +--echo # +--echo # MDEV-17890 Record in index was not found on update, server crash in +--echo # row_upd_build_difference_binary or +--echo # Assertion `0' failed in row_upd_sec_index_entry +--echo # +CREATE TABLE t1 ( + pk BIGINT AUTO_INCREMENT, + b BIT(15), + v BIT(10) AS (b) VIRTUAL, + PRIMARY KEY(pk), + UNIQUE(v) +); + +INSERT IGNORE INTO t1 (b) VALUES (b'101110001110100'),(b'011101'); +SELECT pk, b INTO OUTFILE 'load.data' FROM t1; +--error ER_DATA_TOO_LONG +LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1 (pk, b); + +--let $datadir= `SELECT @@datadir` +--remove_file $datadir/test/load.data +DROP TABLE t1; + +--echo # +--echo # MDEV-17834 Server crashes in row_upd_build_difference_binary +--echo # on LOAD DATA into table with indexed virtual column --echo # +CREATE TABLE t1 ( + pk INT, + i TINYINT, + ts TIMESTAMP NULL, + vi TINYINT AS (i+1) PERSISTENT, + vts TIMESTAMP(5) AS (ts) VIRTUAL, + PRIMARY KEY(pk), + UNIQUE(vts) +); + +INSERT IGNORE INTO t1 (pk,i) VALUES (1,127); + +--write_file $MYSQLTEST_VARDIR/tmp/load.data +1 4 2019-01-01 00:00:00 +EOF +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--error ER_WARN_DATA_OUT_OF_RANGE +eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/load.data' REPLACE INTO TABLE t1 (pk,i,ts); + +--remove_file $MYSQLTEST_VARDIR/tmp/load.data +DROP TABLE t1; +} diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result index b46515e1eae..05bc8347e5f 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result @@ -827,6 +827,56 @@ a1 a2 b 0 NULL 1 DROP TABLE t1, t2; # +# MDEV-20618 Assertion `btr_validate_index(index, 0, false)' failed +# in row_upd_sec_index_entry +# +CREATE TABLE t1 (A BIT(15), VA BIT(10) GENERATED ALWAYS AS (A),PK INT, +PRIMARY KEY (PK), UNIQUE KEY (VA)); +INSERT IGNORE INTO t1 VALUES ( '\r1','a',1); +Warnings: +Warning 1906 The value specified for generated column 'VA' in table 't1' has been ignored +Warning 1264 Out of range value for column 'VA' at row 1 +REPLACE INTO t1 (PK) VALUES (1); +ERROR 22001: Data too long for column 'VA' at row 1 +DROP TABLE t1; +# +# MDEV-17890 Record in index was not found on update, server crash in +# row_upd_build_difference_binary or +# Assertion `0' failed in row_upd_sec_index_entry +# +CREATE TABLE t1 ( +pk BIGINT AUTO_INCREMENT, +b BIT(15), +v BIT(10) AS (b) VIRTUAL, +PRIMARY KEY(pk), +UNIQUE(v) +); +INSERT IGNORE INTO t1 (b) VALUES (b'101110001110100'),(b'011101'); +Warnings: +Warning 1264 Out of range value for column 'v' at row 1 +SELECT pk, b INTO OUTFILE 'load.data' FROM t1; +LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1 (pk, b); +ERROR 22001: Data too long for column 'v' at row 1 +DROP TABLE t1; +# +# MDEV-17834 Server crashes in row_upd_build_difference_binary +# on LOAD DATA into table with indexed virtual column +# +CREATE TABLE t1 ( +pk INT, +i TINYINT, +ts TIMESTAMP NULL, +vi TINYINT AS (i+1) PERSISTENT, +vts TIMESTAMP(5) AS (ts) VIRTUAL, +PRIMARY KEY(pk), +UNIQUE(vts) +); +INSERT IGNORE INTO t1 (pk,i) VALUES (1,127); +Warnings: +Warning 1264 Out of range value for column 'vi' at row 1 +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/load.data' REPLACE INTO TABLE t1 (pk,i,ts); +ERROR 22003: Out of range value for column 'vi' at row 1 +DROP TABLE t1; # # BUG#21365158 WL8149:ASSERTION `!TABLE || (!TABLE->WRITE_SET # diff --git a/mysql-test/suite/gcol/r/gcol_keys_myisam.result b/mysql-test/suite/gcol/r/gcol_keys_myisam.result index dcbba1f70c1..a91a77aedf3 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_keys_myisam.result @@ -827,6 +827,56 @@ a1 a2 b 0 NULL 1 DROP TABLE t1, t2; # +# MDEV-20618 Assertion `btr_validate_index(index, 0, false)' failed +# in row_upd_sec_index_entry +# +CREATE TABLE t1 (A BIT(15), VA BIT(10) GENERATED ALWAYS AS (A),PK INT, +PRIMARY KEY (PK), UNIQUE KEY (VA)); +INSERT IGNORE INTO t1 VALUES ( '\r1','a',1); +Warnings: +Warning 1906 The value specified for generated column 'VA' in table 't1' has been ignored +Warning 1264 Out of range value for column 'VA' at row 1 +REPLACE INTO t1 (PK) VALUES (1); +ERROR 22001: Data too long for column 'VA' at row 1 +DROP TABLE t1; +# +# MDEV-17890 Record in index was not found on update, server crash in +# row_upd_build_difference_binary or +# Assertion `0' failed in row_upd_sec_index_entry +# +CREATE TABLE t1 ( +pk BIGINT AUTO_INCREMENT, +b BIT(15), +v BIT(10) AS (b) VIRTUAL, +PRIMARY KEY(pk), +UNIQUE(v) +); +INSERT IGNORE INTO t1 (b) VALUES (b'101110001110100'),(b'011101'); +Warnings: +Warning 1264 Out of range value for column 'v' at row 1 +SELECT pk, b INTO OUTFILE 'load.data' FROM t1; +LOAD DATA INFILE 'load.data' REPLACE INTO TABLE t1 (pk, b); +ERROR 22001: Data too long for column 'v' at row 1 +DROP TABLE t1; +# +# MDEV-17834 Server crashes in row_upd_build_difference_binary +# on LOAD DATA into table with indexed virtual column +# +CREATE TABLE t1 ( +pk INT, +i TINYINT, +ts TIMESTAMP NULL, +vi TINYINT AS (i+1) PERSISTENT, +vts TIMESTAMP(5) AS (ts) VIRTUAL, +PRIMARY KEY(pk), +UNIQUE(vts) +); +INSERT IGNORE INTO t1 (pk,i) VALUES (1,127); +Warnings: +Warning 1264 Out of range value for column 'vi' at row 1 +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/load.data' REPLACE INTO TABLE t1 (pk,i,ts); +ERROR 22003: Out of range value for column 'vi' at row 1 +DROP TABLE t1; DROP VIEW IF EXISTS v1,v2; DROP TABLE IF EXISTS t1,t2,t3; DROP PROCEDURE IF EXISTS p1; diff --git a/mysql-test/suite/gcol/r/innodb_virtual_index.result b/mysql-test/suite/gcol/r/innodb_virtual_index.result index 3918cf95ae1..70c9d10a68b 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_index.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_index.result @@ -255,6 +255,9 @@ ERROR 22007: Incorrect date value: '20190132' for column `test`.`t1`.`vb` at row SELECT * FROM t1; a b vb ROLLBACK; +SELECT * FROM t1; +a b vb +1 20190132 0000-00-00 CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK diff --git a/mysql-test/suite/gcol/t/innodb_virtual_index.test b/mysql-test/suite/gcol/t/innodb_virtual_index.test index c2f9cd78fe2..353841840dc 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_index.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_index.test @@ -278,7 +278,6 @@ DELETE FROM t1; INSERT INTO t1 (a,b) VALUES(1,20190123); SELECT * FROM t1; ROLLBACK; -# MDEV-18366 FIXME: fix the crash and enable this -# SELECT * FROM t1; +SELECT * FROM t1; CHECK TABLE t1; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/foreign-keys.result b/mysql-test/suite/innodb/r/foreign-keys.result index 1618540aa96..127084f5669 100644 --- a/mysql-test/suite/innodb/r/foreign-keys.result +++ b/mysql-test/suite/innodb/r/foreign-keys.result @@ -220,3 +220,19 @@ drop table t1,t2; ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails drop table t1,t2; ERROR 42S02: Unknown table 'test.t2' +# +# MDEV-23470 InnoDB: Failing assertion: cmp < 0 in +# row_ins_check_foreign_constraint +# +CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY, f2 INT NOT NULL)ENGINE=InnoDB; +CREATE TABLE t2(f1 VARCHAR(100), f2 INT NOT NULL, +INDEX(f2))ENGINE=InnoDB; +INSERT INTO t1 VALUES(99, 2); +ALTER TABLE t2 ADD FOREIGN KEY(f2) REFERENCES t1(f1); +SET FOREIGN_KEY_CHECKS=0; +DROP INDEX f2 ON t2; +SET FOREIGN_KEY_CHECKS=1; +INSERT INTO t2 VALUES('G', 3); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f2`) REFERENCES `t1` (`f1`)) +DROP TABLE t2, t1; +SET FOREIGN_KEY_CHECKS=DEFAULT; diff --git a/mysql-test/suite/innodb/t/foreign-keys.test b/mysql-test/suite/innodb/t/foreign-keys.test index cda3966e7f9..dda87359df9 100644 --- a/mysql-test/suite/innodb/t/foreign-keys.test +++ b/mysql-test/suite/innodb/t/foreign-keys.test @@ -250,3 +250,22 @@ show create table t2; drop table t1,t2; --error ER_BAD_TABLE_ERROR drop table t1,t2; + +--echo # +--echo # MDEV-23470 InnoDB: Failing assertion: cmp < 0 in +--echo # row_ins_check_foreign_constraint +--echo # +CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY, f2 INT NOT NULL)ENGINE=InnoDB; +CREATE TABLE t2(f1 VARCHAR(100), f2 INT NOT NULL, + INDEX(f2))ENGINE=InnoDB; + +INSERT INTO t1 VALUES(99, 2); +ALTER TABLE t2 ADD FOREIGN KEY(f2) REFERENCES t1(f1); + +SET FOREIGN_KEY_CHECKS=0; +DROP INDEX f2 ON t2; +SET FOREIGN_KEY_CHECKS=1; +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO t2 VALUES('G', 3); +DROP TABLE t2, t1; +SET FOREIGN_KEY_CHECKS=DEFAULT; diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result b/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result index b6c82e3754c..9ef2f4a89db 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result +++ b/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result @@ -7,6 +7,8 @@ SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6"; ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first connection slave; include/stop_slave.inc +SET @@GLOBAL.replicate_do_table=""; +SET @@GLOBAL.replicate_ignore_table=""; SET @@GLOBAL.replicate_do_table="test.t1,test.t2,test.t3"; SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6"; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result b/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result index 47cd362a549..fe0b283fc7c 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result +++ b/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result @@ -7,6 +7,8 @@ SET @@GLOBAL.replicate_wild_ignore_table="test.b%"; ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first connection slave; include/stop_slave.inc +SET @@GLOBAL.replicate_wild_do_table=""; +SET @@GLOBAL.replicate_wild_ignore_table=""; SET @@GLOBAL.replicate_wild_do_table="test.a%"; SET @@GLOBAL.replicate_wild_ignore_table="test.b%"; include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test b/mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test index d4a4faf8d67..529613b37b1 100644 --- a/mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test +++ b/mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test @@ -51,6 +51,8 @@ SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6"; connection slave; source include/stop_slave.inc; +SET @@GLOBAL.replicate_do_table=""; +SET @@GLOBAL.replicate_ignore_table=""; SET @@GLOBAL.replicate_do_table="test.t1,test.t2,test.t3"; SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6"; source include/start_slave.inc; diff --git a/mysql-test/suite/rpl/t/rpl_filter_wild_tables_dynamic.test b/mysql-test/suite/rpl/t/rpl_filter_wild_tables_dynamic.test index 6db61927eec..657a95cec15 100644 --- a/mysql-test/suite/rpl/t/rpl_filter_wild_tables_dynamic.test +++ b/mysql-test/suite/rpl/t/rpl_filter_wild_tables_dynamic.test @@ -13,6 +13,8 @@ SET @@GLOBAL.replicate_wild_ignore_table="test.b%"; connection slave; source include/stop_slave.inc; +SET @@GLOBAL.replicate_wild_do_table=""; +SET @@GLOBAL.replicate_wild_ignore_table=""; SET @@GLOBAL.replicate_wild_do_table="test.a%"; SET @@GLOBAL.replicate_wild_ignore_table="test.b%"; source include/start_slave.inc; diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 90dee4a43dc..9c9074b25a6 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -456,8 +456,7 @@ select pk, col_bit+0, vcol_bit+0 from t1; pk col_bit+0 vcol_bit+0 99 10000 1023 REPLACE LOW_PRIORITY INTO `t1` (`pk`) VALUES (99); -Warnings: -Warning 1264 Out of range value for column 'vcol_bit' at row 1 +ERROR 22001: Data too long for column 'vcol_bit' at row 1 drop table t1; # # MDEV-17837 REPLACE on table with virtual_field can cause crash in set_ok_status() @@ -476,8 +475,7 @@ INSERT IGNORE INTO t1 (pk,i) VALUES (1,127); Warnings: Warning 1264 Out of range value for column 'vi' at row 1 REPLACE INTO t1 (pk,i) VALUES (1,2); -Warnings: -Warning 1264 Out of range value for column 'vi' at row 1 +ERROR 22003: Out of range value for column 'vi' at row 1 DROP TABLE t1; SET @sql_mode=@old_sql_mode; # diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index 73b23c78977..07f96f4e0b8 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -431,6 +431,7 @@ replace INTO `t1` (`pk`,col_bit) VALUES (99,1000); select pk, col_bit+0, vcol_bit+0 from t1; replace INTO `t1` (`pk`,col_bit) VALUES (99,10000); select pk, col_bit+0, vcol_bit+0 from t1; +--error ER_DATA_TOO_LONG REPLACE LOW_PRIORITY INTO `t1` (`pk`) VALUES (99); drop table t1; @@ -451,6 +452,7 @@ CREATE TABLE t1 ( INSERT INTO t1 (pk,i) VALUES (1,1); TRUNCATE TABLE t1; INSERT IGNORE INTO t1 (pk,i) VALUES (1,127); +--error ER_WARN_DATA_OUT_OF_RANGE REPLACE INTO t1 (pk,i) VALUES (1,2); DROP TABLE t1; SET @sql_mode=@old_sql_mode; |