Skip to content

Commit bb90553

Browse files
author
Aaron Trevena
committed
add tests for ping on disconnected handle, issue perl5-dbi#306
1 parent e6312de commit bb90553

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

t/10connect.t

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ my $info_hashref = $dbh->{mysql_dbd_stats};
6262

6363
ok($dbh->disconnect(), 'Disconnected');
6464

65+
ok( ! $dbh->ping(), 'dbh is disconnected and did not segv');
66+
6567
# dbi docs state:
6668
# The username and password can also be specified using the attributes
6769
# Username and Password, in which case they take precedence over the $username

t/15reconnect.t

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ ok($dbh->disconnect(), "disconnecting active handle");
4444

4545
ok(!$dbh->{Active}, "checking for inactive handle");
4646

47+
ok( ! $dbh->ping(), 'dbh is disconnected and did not segv');
48+
4749
ok(!$dbh->do("SELECT 1"), "implicitly reconnecting handle with 'do'");
4850

4951
ok(!$dbh->{Active}, "checking for reactivated handle");

0 commit comments

Comments
 (0)