Skip to content

Commit 7f8187b

Browse files
committed
fix tcp disconnect and perl
1 parent 04fa127 commit 7f8187b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

mysql-test/main/connect.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,10 @@ Aborted_connects 0
421421
Aborted_connects_preauth 0
422422
SET GLOBAL log_warnings=2;
423423
NOT FOUND /This connection closed normally without authentication/ in mysqld.1.err
424+
# let tcp to detect disconnect
425+
select sleep(1);
426+
sleep(1)
427+
0
424428
SHOW GLOBAL STATUS LIKE 'Aborted_connects%';
425429
Variable_name Value
426430
Aborted_connects 1

mysql-test/main/connect.test

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,14 @@ SET GLOBAL log_warnings=2;
471471

472472
--perl
473473
use Socket;
474-
use autodie;
475-
socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname("tcp"));
476-
connect(SOCK, pack_sockaddr_in($ENV{MASTER_MYPORT}, inet_aton("localhost")));
474+
socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname("tcp"))
475+
or die "Can't create a tcp socket!\n";
476+
connect(SOCK, pack_sockaddr_in($ENV{MASTER_MYPORT}, inet_aton("localhost")))
477+
or die "Can't connect to port $ENV{MASTER_MYPORT}!\n";
477478
exit(0);
478479
EOF
480+
--echo # let tcp to detect disconnect
481+
select sleep(1);
479482

480483
SHOW GLOBAL STATUS LIKE 'Aborted_connects%';
481484

@@ -490,7 +493,7 @@ use Socket;
490493
socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname("tcp"))
491494
or die "Can't create a tcp socket!\n";
492495
connect(SOCK, pack_sockaddr_in($ENV{MASTER_MYPORT}, inet_aton("localhost")))
493-
or die "Can't connect to port $ENV{MASTER_MYPORT}!\n";;
496+
or die "Can't connect to port $ENV{MASTER_MYPORT}!\n";
494497
sleep 3;
495498
exit(0);
496499
EOF

0 commit comments

Comments
 (0)