Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
implement ping method for mysql backend
  • Loading branch information
moritz committed Mar 24, 2013
1 parent 1cb4082 commit 60438cf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/DBDish/mysql.pm6
Expand Up @@ -122,6 +122,11 @@ sub mysql_stmt_prepare( OpaquePointer $mysql_stmt, Str, Int $length )
is native('libmysqlclient')
{ * }

sub mysql_ping(OpaquePointer $mysql_client)
returns int
is native('libmysqlclient')
{ * }

#-----------------------------------------------------------------------

class DBDish::mysql::StatementHandle does DBDish::StatementHandle {
Expand Down Expand Up @@ -260,6 +265,10 @@ class DBDish::mysql::Connection does DBDish::Connection {
# but Parrot NCI cannot return an unsigned long long :-(
}

method ping() {
0 == mysql_ping($!mysql_client);
}

method disconnect() {
mysql_close($!mysql_client);
True
Expand Down

0 comments on commit 60438cf

Please sign in to comment.