summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-05-19 20:48:39 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2019-05-19 20:48:39 +0200
commit7f8187bc432f79afe4c0549d68845a68e6c159ab (patch)
tree1003c6a3bb2ba15c7e6567736fdbab06cce2a816 /mysql-test
parent04fa127bc936d5278bff7515363326ebd9f4f518 (diff)
downloadmariadb-git-7f8187bc432f79afe4c0549d68845a68e6c159ab.tar.gz
fix tcp disconnect and perl
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/connect.result4
-rw-r--r--mysql-test/main/connect.test11
2 files changed, 11 insertions, 4 deletions
diff --git a/mysql-test/main/connect.result b/mysql-test/main/connect.result
index 49d76c5c576..54893edd340 100644
--- a/mysql-test/main/connect.result
+++ b/mysql-test/main/connect.result
@@ -421,6 +421,10 @@ Aborted_connects 0
Aborted_connects_preauth 0
SET GLOBAL log_warnings=2;
NOT FOUND /This connection closed normally without authentication/ in mysqld.1.err
+# let tcp to detect disconnect
+select sleep(1);
+sleep(1)
+0
SHOW GLOBAL STATUS LIKE 'Aborted_connects%';
Variable_name Value
Aborted_connects 1
diff --git a/mysql-test/main/connect.test b/mysql-test/main/connect.test
index 2c6e4ae17a2..d0683cf7a4a 100644
--- a/mysql-test/main/connect.test
+++ b/mysql-test/main/connect.test
@@ -471,11 +471,14 @@ SET GLOBAL log_warnings=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")));
+socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname("tcp"))
+ or die "Can't create a tcp socket!\n";
+connect(SOCK, pack_sockaddr_in($ENV{MASTER_MYPORT}, inet_aton("localhost")))
+ or die "Can't connect to port $ENV{MASTER_MYPORT}!\n";
exit(0);
EOF
+--echo # let tcp to detect disconnect
+select sleep(1);
SHOW GLOBAL STATUS LIKE 'Aborted_connects%';
@@ -490,7 +493,7 @@ use Socket;
socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname("tcp"))
or die "Can't create a tcp socket!\n";
connect(SOCK, pack_sockaddr_in($ENV{MASTER_MYPORT}, inet_aton("localhost")))
- or die "Can't connect to port $ENV{MASTER_MYPORT}!\n";;
+ or die "Can't connect to port $ENV{MASTER_MYPORT}!\n";
sleep 3;
exit(0);
EOF