summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/connect.result28
-rw-r--r--mysql-test/main/connect.test50
-rw-r--r--mysql-test/main/flush_read_lock.result18
-rw-r--r--mysql-test/main/flush_read_lock.test26
-rw-r--r--mysql-test/main/myisam_mrr,32bit.rdiff13
-rw-r--r--mysql-test/main/myisam_mrr,64bit.rdiff31
-rw-r--r--mysql-test/main/myisam_mrr.result8
-rw-r--r--mysql-test/suite/galera/r/MDEV-16509.result3
-rw-r--r--mysql-test/suite/galera/t/MDEV-16509.test5
9 files changed, 129 insertions, 53 deletions
diff --git a/mysql-test/main/connect.result b/mysql-test/main/connect.result
index 89e10d221d2..49d76c5c576 100644
--- a/mysql-test/main/connect.result
+++ b/mysql-test/main/connect.result
@@ -408,3 +408,31 @@ test
test
drop procedure p1;
SET global secure_auth=default;
+#
+# MDEV-19282: Log more specific warning with log_warnings=2 if
+# connection is aborted prior to authentication
+# MDEV-19277: Add status variable that gets incremented if
+# connection is aborted prior to authentication
+#
+flush status;
+SHOW GLOBAL STATUS LIKE 'Aborted_connects%';
+Variable_name Value
+Aborted_connects 0
+Aborted_connects_preauth 0
+SET GLOBAL log_warnings=2;
+NOT FOUND /This connection closed normally without authentication/ in mysqld.1.err
+SHOW GLOBAL STATUS LIKE 'Aborted_connects%';
+Variable_name Value
+Aborted_connects 1
+Aborted_connects_preauth 1
+FOUND 1 /This connection closed normally without authentication/ in mysqld.1.err
+SET @save_connect_timeout= @@connect_timeout;
+SET GLOBAL connect_timeout=2;
+SHOW GLOBAL STATUS LIKE 'Aborted_connects%';
+Variable_name Value
+Aborted_connects 2
+Aborted_connects_preauth 2
+FOUND 2 /This connection closed normally without authentication/ in mysqld.1.err
+SET GLOBAL log_warnings=default;
+SET GLOBAL connect_timeout= @save_connect_timeout;
+# End of 10.4 tests
diff --git a/mysql-test/main/connect.test b/mysql-test/main/connect.test
index b0461a5afac..aad0103f773 100644
--- a/mysql-test/main/connect.test
+++ b/mysql-test/main/connect.test
@@ -453,3 +453,53 @@ call p1(2);
drop procedure p1;
SET global secure_auth=default;
+
+--echo #
+--echo # MDEV-19282: Log more specific warning with log_warnings=2 if
+--echo # connection is aborted prior to authentication
+--echo # MDEV-19277: Add status variable that gets incremented if
+--echo # connection is aborted prior to authentication
+--echo #
+
+flush status;
+SHOW GLOBAL STATUS LIKE 'Aborted_connects%';
+
+SET GLOBAL log_warnings=2;
+--let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err
+--let SEARCH_PATTERN= This connection closed normally without authentication
+--source include/search_pattern_in_file.inc
+
+--perl
+use Socket;
+use autodie;
+socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname("tcp"));
+connect(SOCK, pack_sockaddr_in($ENV{MASTER_MYPORT}, inet_aton("localhost")));
+exit(0);
+EOF
+
+SHOW GLOBAL STATUS LIKE 'Aborted_connects%';
+
+--let SEARCH_PATTERN= This connection closed normally without authentication
+--source include/search_pattern_in_file.inc
+
+SET @save_connect_timeout= @@connect_timeout;
+SET GLOBAL connect_timeout=2;
+
+--perl
+use Socket;
+use autodie;
+socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname("tcp"));
+connect(SOCK, pack_sockaddr_in($ENV{MASTER_MYPORT}, inet_aton("localhost")));
+sleep 3;
+exit(0);
+EOF
+
+SHOW GLOBAL STATUS LIKE 'Aborted_connects%';
+
+--let SEARCH_PATTERN= This connection closed normally without authentication
+--source include/search_pattern_in_file.inc
+
+SET GLOBAL log_warnings=default;
+SET GLOBAL connect_timeout= @save_connect_timeout;
+
+--echo # End of 10.4 tests
diff --git a/mysql-test/main/flush_read_lock.result b/mysql-test/main/flush_read_lock.result
index f74937cb304..db92344cfbd 100644
--- a/mysql-test/main/flush_read_lock.result
+++ b/mysql-test/main/flush_read_lock.result
@@ -1736,26 +1736,30 @@ SET DEBUG_SYNC= 'RESET';
# MDEV-19384 Deadlock between FTWRL under open HANDLER, LOCK TABLE
# and DROP DATABASE
#
+SET DEBUG_SYNC= 'ftwrl_before_lock SIGNAL ready WAIT_FOR go';
CREATE DATABASE mysqltest;
CREATE TABLE mysqltest.t1(a INT);
HANDLER mysqltest.t1 OPEN as t1;
connect con1,localhost,root,,;
-SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL ready';
+SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL ready1';
LOCK TABLE mysqltest.t1 WRITE;
connect con2,localhost,root,,;
-SET DEBUG_SYNC= 'now WAIT_FOR ready';
-SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL ready';
+SET DEBUG_SYNC= 'now WAIT_FOR ready1';
+SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL ready2';
DROP DATABASE mysqltest;
connect con3,localhost,root,,;
+SET DEBUG_SYNC= 'now WAIT_FOR ready2';
+connection default;
+FLUSH TABLES WITH READ LOCK;
+connection con3;
SET DEBUG_SYNC= 'now WAIT_FOR ready';
disconnect con3;
+connection con1;
+SET DEBUG_SYNC= 'now SIGNAL go';
+disconnect con1;
connection default;
-FLUSH TABLES WITH READ LOCK;
UNLOCK TABLES;
HANDLER t1 CLOSE;
-connection con1;
-UNLOCK TABLES;
-disconnect con1;
connection con2;
disconnect con2;
connection default;
diff --git a/mysql-test/main/flush_read_lock.test b/mysql-test/main/flush_read_lock.test
index f537339ad6c..80512deac4e 100644
--- a/mysql-test/main/flush_read_lock.test
+++ b/mysql-test/main/flush_read_lock.test
@@ -2100,32 +2100,40 @@ SET DEBUG_SYNC= 'RESET';
--echo # and DROP DATABASE
--echo #
+SET DEBUG_SYNC= 'ftwrl_before_lock SIGNAL ready WAIT_FOR go';
CREATE DATABASE mysqltest;
CREATE TABLE mysqltest.t1(a INT);
HANDLER mysqltest.t1 OPEN as t1;
connect (con1,localhost,root,,);
-SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL ready';
+SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL ready1';
--send LOCK TABLE mysqltest.t1 WRITE
+
connect (con2,localhost,root,,);
-SET DEBUG_SYNC= 'now WAIT_FOR ready';
-SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL ready';
+SET DEBUG_SYNC= 'now WAIT_FOR ready1';
+SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL ready2';
--send DROP DATABASE mysqltest
connect (con3,localhost,root,,);
+SET DEBUG_SYNC= 'now WAIT_FOR ready2';
+
+connection default;
+send FLUSH TABLES WITH READ LOCK;
+
+connection con3;
SET DEBUG_SYNC= 'now WAIT_FOR ready';
disconnect con3;
-connection default;
-FLUSH TABLES WITH READ LOCK;
-UNLOCK TABLES;
-HANDLER t1 CLOSE;
connection con1;
-
--error 0,ER_NO_SUCH_TABLE
reap;
-UNLOCK TABLES;
+SET DEBUG_SYNC= 'now SIGNAL go';
disconnect con1;
+
+connection default;
+reap;
+UNLOCK TABLES;
+HANDLER t1 CLOSE;
connection con2;
reap;
disconnect con2;
diff --git a/mysql-test/main/myisam_mrr,32bit.rdiff b/mysql-test/main/myisam_mrr,32bit.rdiff
new file mode 100644
index 00000000000..746bf48dedd
--- /dev/null
+++ b/mysql-test/main/myisam_mrr,32bit.rdiff
@@ -0,0 +1,13 @@
+--- main/myisam_mrr.result 2019-05-14 15:44:52.232663568 +0530
++++ main/myisam_mrr.reject 2019-05-14 15:51:37.123563538 +0530
+@@ -617,8 +617,8 @@
+ show status like 'handler_mrr%';
+ Variable_name Value
+ Handler_mrr_init 1
+-Handler_mrr_key_refills 1
+-Handler_mrr_rowid_refills 1
++Handler_mrr_key_refills 0
++Handler_mrr_rowid_refills 0
+ set join_buffer_size=10;
+ explain select sum(t1.b) from t0,t1 where t0.a=t1.a;
+ id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/main/myisam_mrr,64bit.rdiff b/mysql-test/main/myisam_mrr,64bit.rdiff
deleted file mode 100644
index feb97548ad8..00000000000
--- a/mysql-test/main/myisam_mrr,64bit.rdiff
+++ /dev/null
@@ -1,31 +0,0 @@
---- main/myisam_mrr.result 2019-04-27 21:46:07.000000000 +0530
-+++ main/myisam_mrr,64bit.reject 2019-05-11 20:40:32.000000000 +0530
-@@ -188,7 +188,7 @@
- select * from t4 where a IS NULL and b IS NULL and (c IS NULL or c='no-such-row1'
- or c='no-such-row2');
- id select_type table type possible_keys key key_len ref rows Extra
--1 SIMPLE t4 range idx1 idx1 29 NULL 10 Using index condition; Using where; Rowid-ordered scan
-+1 SIMPLE t4 range idx1 idx1 29 NULL 10 Using index condition; Rowid-ordered scan
- select * from t4 where a IS NULL and b IS NULL and (c IS NULL or c='no-such-row1'
- or c='no-such-row2');
- a b c filler
-@@ -210,7 +210,7 @@
- explain
- select * from t4 where (a ='b-1' or a='bb-1') and b IS NULL and (c='c-1' or c='cc-2');
- id select_type table type possible_keys key key_len ref rows Extra
--1 SIMPLE t4 range idx1 idx1 29 NULL 20 Using index condition; Using where; Rowid-ordered scan
-+1 SIMPLE t4 range idx1 idx1 29 NULL 20 Using index condition; Rowid-ordered scan
- select * from t4 where (a ='b-1' or a='bb-1') and b IS NULL and (c='c-1' or c='cc-2');
- a b c filler
- b-1 NULL c-1 NULL-15
-@@ -617,8 +617,8 @@
- show status like 'handler_mrr%';
- Variable_name Value
- Handler_mrr_init 1
--Handler_mrr_key_refills 0
--Handler_mrr_rowid_refills 0
-+Handler_mrr_key_refills 1
-+Handler_mrr_rowid_refills 1
- set join_buffer_size=10;
- explain select sum(t1.b) from t0,t1 where t0.a=t1.a;
- id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/main/myisam_mrr.result b/mysql-test/main/myisam_mrr.result
index 95aa93eb40e..873260bbc3a 100644
--- a/mysql-test/main/myisam_mrr.result
+++ b/mysql-test/main/myisam_mrr.result
@@ -188,7 +188,7 @@ explain
select * from t4 where a IS NULL and b IS NULL and (c IS NULL or c='no-such-row1'
or c='no-such-row2');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 range idx1 idx1 29 NULL 10 Using index condition; Using where; Rowid-ordered scan
+1 SIMPLE t4 range idx1 idx1 29 NULL 10 Using index condition; Rowid-ordered scan
select * from t4 where a IS NULL and b IS NULL and (c IS NULL or c='no-such-row1'
or c='no-such-row2');
a b c filler
@@ -210,7 +210,7 @@ NULL NULL NULL NULL-1
explain
select * from t4 where (a ='b-1' or a='bb-1') and b IS NULL and (c='c-1' or c='cc-2');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 range idx1 idx1 29 NULL 20 Using index condition; Using where; Rowid-ordered scan
+1 SIMPLE t4 range idx1 idx1 29 NULL 20 Using index condition; Rowid-ordered scan
select * from t4 where (a ='b-1' or a='bb-1') and b IS NULL and (c='c-1' or c='cc-2');
a b c filler
b-1 NULL c-1 NULL-15
@@ -617,8 +617,8 @@ sum(t1.b)
show status like 'handler_mrr%';
Variable_name Value
Handler_mrr_init 1
-Handler_mrr_key_refills 0
-Handler_mrr_rowid_refills 0
+Handler_mrr_key_refills 1
+Handler_mrr_rowid_refills 1
set join_buffer_size=10;
explain select sum(t1.b) from t0,t1 where t0.a=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/suite/galera/r/MDEV-16509.result b/mysql-test/suite/galera/r/MDEV-16509.result
index 571952ddf96..b56622da2c0 100644
--- a/mysql-test/suite/galera/r/MDEV-16509.result
+++ b/mysql-test/suite/galera/r/MDEV-16509.result
@@ -63,8 +63,9 @@ SET DEBUG_SYNC = "now WAIT_FOR agac_reached_2";
wsrep_last_seen_gtid_no_match
1
SET DEBUG_SYNC = "now SIGNAL agac_continue_1";
-SET DEBUG_SYNC = "now SIGNAL agac_continue_2";
connection node_1;
+connection ctrl;
+SET DEBUG_SYNC = "now SIGNAL agac_continue_2";
connection node_1a;
connection ctrl;
SET DEBUG_SYNC = "RESET";
diff --git a/mysql-test/suite/galera/t/MDEV-16509.test b/mysql-test/suite/galera/t/MDEV-16509.test
index 2242ef6aff3..dddd8ede293 100644
--- a/mysql-test/suite/galera/t/MDEV-16509.test
+++ b/mysql-test/suite/galera/t/MDEV-16509.test
@@ -124,10 +124,13 @@ SET DEBUG_SYNC = "now WAIT_FOR agac_reached_2";
--enable_query_log
SET DEBUG_SYNC = "now SIGNAL agac_continue_1";
-SET DEBUG_SYNC = "now SIGNAL agac_continue_2";
--connection node_1
--reap
+
+--connection ctrl
+SET DEBUG_SYNC = "now SIGNAL agac_continue_2";
+
--connection node_1a
--reap