diff options
Diffstat (limited to 'mysql-test')
26 files changed, 485 insertions, 74 deletions
diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm index ecc0830c3df..c88b1170a80 100644 --- a/mysql-test/lib/My/Config.pm +++ b/mysql-test/lib/My/Config.pm @@ -338,6 +338,13 @@ sub new { # Skip comment next; } + # Correctly process Replication Filter when they are defined + # with connection name. + elsif ( $line =~ /^([\w]+.[\w]+)\s*=\s*(.*)\s*/){ + my $option= $1; + my $value= $2; + $self->insert($group_name, $option, $value); + } else { croak "Unexpected line '$line' found in '$path'"; } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 68bd03ef5ca..d88d99ce2f9 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1891,7 +1891,10 @@ sub collect_mysqld_features { if (/Copyright/ .. /^-{30,}/) { # here we want to detect all not mandatory plugins # they are listed in the --help output as - # --archive[=name] Enable or disable ARCHIVE plugin. Possible values are ON, OFF, FORCE (don't start if the plugin fails to load). + # --archive[=name] + # Enable or disable ARCHIVE plugin. Possible values are ON, OFF, + # FORCE (don't start if the plugin fails to load), + # FORCE_PLUS_PERMANENT (like FORCE, but the plugin can not be uninstalled). push @optional_plugins, $1 if /^ --([-a-z0-9]+)\[=name\] +Enable or disable \w+ plugin. One of: ON, OFF, FORCE/; next; diff --git a/mysql-test/r/repair_symlink-5543.result b/mysql-test/r/repair_symlink-5543.result index c77e7162a51..2024c9f5684 100644 --- a/mysql-test/r/repair_symlink-5543.result +++ b/mysql-test/r/repair_symlink-5543.result @@ -1,7 +1,7 @@ create table t1 (a int) engine=myisam data directory='MYSQL_TMP_DIR'; insert t1 values (1); -# Some systems fail with errcode 40, when doing openat, while others -# don't have openat and fail with errcode 20. +# Some systems fail with errcode 40, or 90 (MIPS) when doing openat, +# while others don't have openat and fail with errcode 20. repair table t1; Table Op Msg_type Msg_text test.t1 repair error 20 for record at pos 0 diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index d13af4437f3..310413f4924 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -8327,6 +8327,20 @@ UNION SELECT * FROM INFORMATION_SCHEMA.TABLES JOIN INFORMATION_SCHEMA.PARAMETERS; DROP FUNCTION f; DROP VIEW v; +# +# MDEV-17963: Assertion `field_pos < field_count' failed in Protocol_text::store, +# Assertion `field_handlers == 0 || field_pos < field_count' +# +CREATE TABLE t1 (ct time); +INSERT INTO t1 VALUES ('16:11:28'); +CREATE FUNCTION f1 () RETURNS varchar(100) +BEGIN +DECLARE xxx varchar(100); +ANALYZE SELECT sum(ct) FROM t1 INTO xxx ; +RETURN xxx; +END| +ERROR 0A000: Not allowed to return a result set from a function +drop table t1; #End of 10.1 tests # # MDEV-11081: CURSOR for query with GROUP BY diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 0d75e56b4ac..ef312aad92e 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -1146,6 +1146,16 @@ a 00:01:00 DROP TABLE t1; # +# MDEV-17857 Assertion `tmp != ((long long) 0x8000000000000000LL)' failed in TIME_from_longlong_datetime_packed upon SELECT with GROUP BY +# +CREATE TABLE t1 (i INT, d DATETIME); +INSERT INTO t1 VALUES (3,NULL),(3,'1976-12-14 13:21:07'),(NULL,'1981-09-24 01:04:47'); +SELECT ExtractValue('foo','bar'), i, MIN(d) FROM t1 GROUP BY i; +ExtractValue('foo','bar') i MIN(d) + NULL 1981-09-24 01:04:47 + 3 1976-12-14 13:21:07 +DROP TABLE t1; +# # End of 10.1 tests # # diff --git a/mysql-test/suite/galera/r/galera_as_slave_gtid.result b/mysql-test/suite/galera/r/galera_as_slave_gtid.result index 0ef9d208bf4..12fc6b5ba4d 100644 --- a/mysql-test/suite/galera/r/galera_as_slave_gtid.result +++ b/mysql-test/suite/galera/r/galera_as_slave_gtid.result @@ -22,3 +22,7 @@ connection node_3; connection node_2; STOP SLAVE; RESET SLAVE ALL; +#cleanup +reset master; +reset master; +reset master; diff --git a/mysql-test/suite/galera/r/galera_log_bin.result b/mysql-test/suite/galera/r/galera_log_bin.result index a6f0ef12be1..2fb59fc200f 100644 --- a/mysql-test/suite/galera/r/galera_log_bin.result +++ b/mysql-test/suite/galera/r/galera_log_bin.result @@ -1,3 +1,7 @@ +connection node_1; +reset master; +connection node_2; +reset master; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); CREATE TABLE t2 (id INT) ENGINE=InnoDB; @@ -12,58 +16,60 @@ COUNT(*) = 2 1 connection node_1; ALTER TABLE t1 ADD COLUMN f2 INTEGER; -FLUSH LOGS; -SHOW BINLOG EVENTS IN 'mysqld-bin.000002' LIMIT 4,21; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -mysqld-bin.000002 # Gtid # # GTID 0-1-1 -mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB -mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-2 -mysqld-bin.000002 # Annotate_rows # # INSERT INTO t1 VALUES (1) -mysqld-bin.000002 # Table_map # # table_id: # (test.t1) -mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F -mysqld-bin.000002 # Xid # # COMMIT /* xid=# */ -mysqld-bin.000002 # Gtid # # GTID 0-1-3 -mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB -mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-4 -mysqld-bin.000002 # Annotate_rows # # INSERT INTO t2 VALUES (1) -mysqld-bin.000002 # Table_map # # table_id: # (test.t2) -mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F -mysqld-bin.000002 # Xid # # COMMIT /* xid=# */ -mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-5 -mysqld-bin.000002 # Annotate_rows # # INSERT INTO t2 VALUES (1) -mysqld-bin.000002 # Table_map # # table_id: # (test.t2) -mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F -mysqld-bin.000002 # Xid # # COMMIT /* xid=# */ -mysqld-bin.000002 # Gtid # # GTID 0-1-6 -mysqld-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t1) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER connection node_2; SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; COUNT(*) = 2 1 -SHOW BINLOG EVENTS IN 'mysqld-bin.000003' LIMIT 3,21; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -mysqld-bin.000003 # Gtid # # GTID 0-1-1 -mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB -mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-2 -mysqld-bin.000003 # Annotate_rows # # INSERT INTO t1 VALUES (1) -mysqld-bin.000003 # Table_map # # table_id: # (test.t1) -mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F -mysqld-bin.000003 # Xid # # COMMIT /* xid=# */ -mysqld-bin.000003 # Gtid # # GTID 0-1-3 -mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB -mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-4 -mysqld-bin.000003 # Annotate_rows # # INSERT INTO t2 VALUES (1) -mysqld-bin.000003 # Table_map # # table_id: # (test.t2) -mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F -mysqld-bin.000003 # Xid # # COMMIT /* xid=# */ -mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-5 -mysqld-bin.000003 # Annotate_rows # # INSERT INTO t2 VALUES (1) -mysqld-bin.000003 # Table_map # # table_id: # (test.t2) -mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F -mysqld-bin.000003 # Xid # # COMMIT /* xid=# */ -mysqld-bin.000003 # Gtid # # GTID 0-1-6 -mysqld-bin.000003 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t1) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER DROP TABLE t1; DROP TABLE t2; +#cleanup connection node_1; RESET MASTER; +connection node_2; +reset master; diff --git a/mysql-test/suite/galera/r/galera_log_output_csv.result b/mysql-test/suite/galera/r/galera_log_output_csv.result index 5cb61b36332..ea218abbb59 100644 --- a/mysql-test/suite/galera/r/galera_log_output_csv.result +++ b/mysql-test/suite/galera/r/galera_log_output_csv.result @@ -18,3 +18,5 @@ COUNT(*) = 1 1 connection node_1; DROP TABLE t1; +truncate table mysql.slow_log; +truncate table mysql.general_log; diff --git a/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result b/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result index 1a8733e2e1a..afe72a10877 100644 --- a/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result +++ b/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result @@ -78,6 +78,11 @@ wsrep_gtid_mode 1 # On node_1 connection node_1; DROP TABLE t1, t2; +#cleanup +connection node_1; +reset master; +connection node_2; +reset master; disconnect node_2; disconnect node_1; # End of test diff --git a/mysql-test/suite/galera/r/mdev_10518.result b/mysql-test/suite/galera/r/mdev_10518.result index 4ccd5fd1d23..aedf7cc4038 100644 --- a/mysql-test/suite/galera/r/mdev_10518.result +++ b/mysql-test/suite/galera/r/mdev_10518.result @@ -78,6 +78,11 @@ wsrep_gtid_mode 1 # On node_1 connection node_1; DROP TABLE t1, t2; +#cleanup +connection node_1; +reset master; +connection node_2; +reset master; disconnect node_2; disconnect node_1; # End of test diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid.test b/mysql-test/suite/galera/t/galera_as_slave_gtid.test index c2331a2ae05..a3c43540916 100644 --- a/mysql-test/suite/galera/t/galera_as_slave_gtid.test +++ b/mysql-test/suite/galera/t/galera_as_slave_gtid.test @@ -65,3 +65,13 @@ DROP TABLE t1; STOP SLAVE; RESET SLAVE ALL; + +--echo #cleanup +--connection node_1 +reset master; + +--connection node_2 +reset master; + +--connection node_3 +reset master; diff --git a/mysql-test/suite/galera/t/galera_log_bin.test b/mysql-test/suite/galera/t/galera_log_bin.test index 2f0faa761c5..c3d94d15194 100644 --- a/mysql-test/suite/galera/t/galera_log_bin.test +++ b/mysql-test/suite/galera/t/galera_log_bin.test @@ -1,6 +1,11 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--connection node_1 +reset master; +--connection node_2 +reset master; + # # Test Galera with --log-bin --log-slave-updates . # This way the actual MySQL binary log is used, @@ -20,20 +25,19 @@ SELECT COUNT(*) = 2 FROM t2; --connection node_1 ALTER TABLE t1 ADD COLUMN f2 INTEGER; - -FLUSH LOGS; ---replace_column 2 # 4 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/ -SHOW BINLOG EVENTS IN 'mysqld-bin.000002' LIMIT 4,21; +--let $MASTER_MYPORT=$NODE_MYPORT_1 +--source include/show_binlog_events.inc --connection node_2 SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ---replace_column 2 # 4 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/ -SHOW BINLOG EVENTS IN 'mysqld-bin.000003' LIMIT 3,21; +--let $MASTER_MYPORT=$NODE_MYPORT_2 +--source include/show_binlog_events.inc DROP TABLE t1; DROP TABLE t2; +--echo #cleanup --connection node_1 RESET MASTER; +--connection node_2 +reset master; diff --git a/mysql-test/suite/galera/t/galera_log_output_csv.test b/mysql-test/suite/galera/t/galera_log_output_csv.test index 94ae3dd6168..eeccc953187 100644 --- a/mysql-test/suite/galera/t/galera_log_output_csv.test +++ b/mysql-test/suite/galera/t/galera_log_output_csv.test @@ -22,3 +22,5 @@ SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 2 = 2 FROM t1'; --connection node_1 DROP TABLE t1; +truncate table mysql.slow_log; +truncate table mysql.general_log; diff --git a/mysql-test/suite/galera/t/galera_sync_wait_show.test b/mysql-test/suite/galera/t/galera_sync_wait_show.test index edad2840da2..1d240cc40d4 100644 --- a/mysql-test/suite/galera/t/galera_sync_wait_show.test +++ b/mysql-test/suite/galera/t/galera_sync_wait_show.test @@ -64,7 +64,9 @@ DROP TABLE t1; --connection node_1 +--disable_warnings CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1; +--enable_warnings --connection node_2 SHOW CREATE EVENT event1; diff --git a/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test b/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test index c4127b4f655..015f25abf2f 100644 --- a/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test +++ b/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test @@ -48,6 +48,13 @@ source include/print_gtid.inc; # Cleanup DROP TABLE t1, t2; +--echo #cleanup +--connection node_1 +reset master; + +--connection node_2 +reset master; + --source include/galera_end.inc --echo # End of test diff --git a/mysql-test/suite/galera/t/mdev_10518.test b/mysql-test/suite/galera/t/mdev_10518.test index c4127b4f655..015f25abf2f 100644 --- a/mysql-test/suite/galera/t/mdev_10518.test +++ b/mysql-test/suite/galera/t/mdev_10518.test @@ -48,6 +48,13 @@ source include/print_gtid.inc; # Cleanup DROP TABLE t1, t2; +--echo #cleanup +--connection node_1 +reset master; + +--connection node_2 +reset master; + --source include/galera_end.inc --echo # End of test diff --git a/mysql-test/suite/multi_source/mdev-8874.cnf b/mysql-test/suite/multi_source/mdev-8874.cnf new file mode 100644 index 00000000000..dc89db72772 --- /dev/null +++ b/mysql-test/suite/multi_source/mdev-8874.cnf @@ -0,0 +1,25 @@ +!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 +m1.replicate_ignore_table='a.t1' +m2.replicate_ignore_table='b.t1' +replicate_ignore_table='c.t1' + +[ENV] +SERVER_MYPORT_4= @mysqld.4.port +SERVER_MYSOCK_4= @mysqld.4.socket diff --git a/mysql-test/suite/multi_source/mdev-8874.result b/mysql-test/suite/multi_source/mdev-8874.result new file mode 100644 index 00000000000..25185eed02a --- /dev/null +++ b/mysql-test/suite/multi_source/mdev-8874.result @@ -0,0 +1,114 @@ +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 +select @@global.'m1'.replicate_ignore_table; +@@global.'m1'.replicate_ignore_table +a.t1 +select @@global.'m2'.replicate_ignore_table; +@@global.'m2'.replicate_ignore_table +b.t1 +select @@global.replicate_ignore_table; +@@global.replicate_ignore_table +c.t1 +use a; +#No t1 table +show tables; +Tables_in_a +t2 +use b; +#No t1 table +show tables; +Tables_in_b +t2 +use c; +#No t1 table +show tables; +Tables_in_c +t2 +#TEST +STOP ALL SLAVES; +Warnings: +Note 1938 SLAVE 'm2' stopped +Note 1938 SLAVE '' stopped +Note 1938 SLAVE 'm1' stopped +RESET SLAVE 'm1' ALL ; +RESET SLAVE 'm2' ALL ; +RESET SLAVE ALL ; +drop database a; +drop database b; +drop database c; +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; +Warnings: +Note 1937 SLAVE 'm2' started +Note 1937 SLAVE '' started +Note 1937 SLAVE 'm1' started +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 +#Replication Filter should be intact (t1 still not replicated) +select @@global.'m1'.replicate_ignore_table; +@@global.'m1'.replicate_ignore_table +a.t1 +select @@global.'m2'.replicate_ignore_table; +@@global.'m2'.replicate_ignore_table +b.t1 +select @@global.replicate_ignore_table; +@@global.replicate_ignore_table +c.t1 +use a; +#No t1 table +show tables; +Tables_in_a +t2 +use b; +#No t1 table +show tables; +Tables_in_b +t2 +use c; +#No t1 table +show tables; +Tables_in_c +t2 +#CleanUp +drop database a; +drop database b; +drop database c; +stop all slaves; +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-8874.test b/mysql-test/suite/multi_source/mdev-8874.test new file mode 100644 index 00000000000..d03c255b911 --- /dev/null +++ b/mysql-test/suite/multi_source/mdev-8874.test @@ -0,0 +1,141 @@ +--source include/not_embedded.inc +--source include/have_innodb.inc +--source include/have_debug.inc +# MDEV-8874 +# In Named Master slave connection if we do reset slave 'connection_name' ALL and then +# if we reconnect slave, replication filters are ignored. +# This patch fixes this issue. +--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 +select @@global.'m1'.replicate_ignore_table; +select @@global.'m2'.replicate_ignore_table; +select @@global.replicate_ignore_table; + +--enable_warnings +--sync_with_master 0,'m1' +--sync_with_master 0,'m2' +--sync_with_master 0,'' +use a; +--echo #No t1 table +show tables; +use b; +--echo #No t1 table +show tables; +use c; +--echo #No t1 table +show tables; +--echo #TEST +STOP ALL SLAVES; +RESET SLAVE 'm1' ALL ; +RESET SLAVE 'm2' ALL ; +RESET SLAVE ALL ; +drop database a; +drop database b; +drop database c; +--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 +--sync_with_master 0,'m1' +--sync_with_master 0,'m2' +--sync_with_master 0,'' + +--echo #Replication Filter should be intact (t1 still not replicated) +select @@global.'m1'.replicate_ignore_table; +select @@global.'m2'.replicate_ignore_table; +select @@global.replicate_ignore_table; +use a; +--echo #No t1 table +show tables; +use b; +--echo #No t1 table +show tables; +use c; +--echo #No t1 table +show tables; + + +#--echo #restart the server +#--source include/restart_mysqld.inc + + +--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,'' +--disable_warnings +stop all slaves; +--enable_warnings +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 diff --git a/mysql-test/suite/rpl/r/kill_race_condition.result b/mysql-test/suite/rpl/r/kill_race_condition.result index 87ee3214b8e..1181eb0b0b1 100644 --- a/mysql-test/suite/rpl/r/kill_race_condition.result +++ b/mysql-test/suite/rpl/r/kill_race_condition.result @@ -1,18 +1,23 @@ include/master-slave.inc [connection master] +connection master; +create table t1 (a int); +connection slave; connection slave; set global debug_dbug='d,rows_log_event_before_open_table'; -set debug_sync='now WAIT_FOR before_open_table'; connection master; -create table t1 (a int); insert t1 values (1),(2),(3); connection slave; +set debug_sync='now WAIT_FOR before_open_table'; kill slave_sql_thread; set debug_sync='now SIGNAL go_ahead_sql'; +include/wait_for_slave_sql_error.inc [errno=1927] +Last_SQL_Error = Error executing row event: 'Connection was killed' set global debug_dbug=''; set debug_sync='RESET'; connection master; drop table t1; connection slave; -start slave; +include/start_slave.inc +Last_SQL_Error = include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result b/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result index 68ad4877927..5ba751155e6 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result @@ -27,10 +27,6 @@ select plugin_name,plugin_status from information_schema.plugins where plugin_na plugin_name plugin_status rpl_semi_sync_slave DELETED connection master; -show global status like "Slave%_connect%"; -Variable_name Value -Slave_connections 2 -Slaves_connected 1 UNINSTALL PLUGIN rpl_semi_sync_master; Warnings: Warning 1620 Plugin is busy and will be uninstalled on shutdown diff --git a/mysql-test/suite/rpl/t/kill_race_condition.test b/mysql-test/suite/rpl/t/kill_race_condition.test index 4268c12cdbf..0f3b44864fe 100644 --- a/mysql-test/suite/rpl/t/kill_race_condition.test +++ b/mysql-test/suite/rpl/t/kill_race_condition.test @@ -2,27 +2,34 @@ source include/have_debug_sync.inc; source include/have_binlog_format_row.inc; source include/master-slave.inc; +connection master; +create table t1 (a int); +--sync_slave_with_master + connection slave; set global debug_dbug='d,rows_log_event_before_open_table'; -send set debug_sync='now WAIT_FOR before_open_table'; connection master; -create table t1 (a int); insert t1 values (1),(2),(3); connection slave; -reap; +set debug_sync='now WAIT_FOR before_open_table'; let $a=`select id from information_schema.processlist where state='debug sync point: now'`; replace_result $a slave_sql_thread; eval kill $a; set debug_sync='now SIGNAL go_ahead_sql'; +--let $slave_sql_errno= 1927 +--source include/wait_for_slave_sql_error.inc +let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); +--echo Last_SQL_Error = $error set global debug_dbug=''; set debug_sync='RESET'; - connection master; drop table t1; connection slave; -start slave; +--source include/start_slave.inc +let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); +--echo Last_SQL_Error = $error source include/rpl_end.inc; diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test b/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test index 360706922ea..58d79cf7ff0 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test @@ -63,8 +63,13 @@ select plugin_name,plugin_status from information_schema.plugins where plugin_na --connection master # The following is to catch errors if the next uninstall plugin would succeed -show global status like "Slave%_connect%"; - +let $slaves_connected_value= query_get_value(SHOW GLOBAL STATUS LIKE 'Slaves_connected', Value, 1); +if (`SELECT $slaves_connected_value <> 1`) +{ + SHOW GLOBAL STATUS LIKE 'Slave_connections'; + SHOW GLOBAL STATUS LIKE 'Slaves_connected'; + --die *** Unexpected number of connected slaves *** +} UNINSTALL PLUGIN rpl_semi_sync_master; select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%'; diff --git a/mysql-test/t/repair_symlink-5543.test b/mysql-test/t/repair_symlink-5543.test index 4c120334d05..ac7bb497f24 100644 --- a/mysql-test/t/repair_symlink-5543.test +++ b/mysql-test/t/repair_symlink-5543.test @@ -9,9 +9,9 @@ eval create table t1 (a int) engine=myisam data directory='$MYSQL_TMP_DIR'; insert t1 values (1); --system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t1.TMD ---echo # Some systems fail with errcode 40, when doing openat, while others ---echo # don't have openat and fail with errcode 20. ---replace_regex / '.*\/t1/ 'MYSQL_TMP_DIR\/t1/ /40/20/ /".*"/"<errmsg>"/ +--echo # Some systems fail with errcode 40, or 90 (MIPS) when doing openat, +--echo # while others don't have openat and fail with errcode 20. +--replace_regex / '.*\/t1/ 'MYSQL_TMP_DIR\/t1/ /[49]0/20/ /".*"/"<errmsg>"/ repair table t1; drop table t1; @@ -19,7 +19,7 @@ drop table t1; eval create table t2 (a int) engine=aria data directory='$MYSQL_TMP_DIR'; insert t2 values (1); --system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t2.TMD ---replace_regex / '.*\/t2/ 'MYSQL_TMP_DIR\/t2/ /40/20/ /".*"/"<errmsg>"/ +--replace_regex / '.*\/t2/ 'MYSQL_TMP_DIR\/t2/ /[49]0/20/ /".*"/"<errmsg>"/ repair table t2; drop table t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 2df53a2f0aa..2d91cecd98b 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -9833,6 +9833,26 @@ SELECT * FROM INFORMATION_SCHEMA.TABLES JOIN INFORMATION_SCHEMA.PARAMETERS; DROP FUNCTION f; DROP VIEW v; +--echo # +--echo # MDEV-17963: Assertion `field_pos < field_count' failed in Protocol_text::store, +--echo # Assertion `field_handlers == 0 || field_pos < field_count' +--echo # + +CREATE TABLE t1 (ct time); +INSERT INTO t1 VALUES ('16:11:28'); + +DELIMITER |; +--error ER_SP_NO_RETSET +CREATE FUNCTION f1 () RETURNS varchar(100) +BEGIN +DECLARE xxx varchar(100); +ANALYZE SELECT sum(ct) FROM t1 INTO xxx ; +RETURN xxx; +END| + +DELIMITER ;| +drop table t1; + --echo #End of 10.1 tests --echo # diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 0e2682a053c..b975608076f 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -700,6 +700,16 @@ SELECT 1 FROM t1 WHERE 20160101 > SOME (SELECT CAST(a AS DATETIME) FROM t1); SELECT * FROM t1 WHERE 20160101 > CAST(a AS DATETIME); DROP TABLE t1; + +--echo # +--echo # MDEV-17857 Assertion `tmp != ((long long) 0x8000000000000000LL)' failed in TIME_from_longlong_datetime_packed upon SELECT with GROUP BY +--echo # + +CREATE TABLE t1 (i INT, d DATETIME); +INSERT INTO t1 VALUES (3,NULL),(3,'1976-12-14 13:21:07'),(NULL,'1981-09-24 01:04:47'); +SELECT ExtractValue('foo','bar'), i, MIN(d) FROM t1 GROUP BY i; +DROP TABLE t1; + --echo # --echo # End of 10.1 tests --echo # |