Skip to content

Commit

Permalink
mysql_shutdown is deprecated from mysql 5.7.9
Browse files Browse the repository at this point in the history
  • Loading branch information
berntm committed Sep 20, 2016
1 parent 891d3fa commit db47688
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mysql.xs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ _admin_internal(drh,dbh,command,dbname=NULL,host=NULL,port=NULL,user=NULL,passwo
MYSQL mysql;
int retval;
MYSQL* sock;
const char *shutdown = "SHUTDOWN";

/*
* Connect to the database, if required.
Expand All @@ -119,7 +120,11 @@ _admin_internal(drh,dbh,command,dbname=NULL,host=NULL,port=NULL,user=NULL,passwo
#if MYSQL_VERSION_ID < 40103
retval = mysql_shutdown(sock);
#else
#if MYSQL_VERSION_ID < 50709
retval = mysql_shutdown(sock, SHUTDOWN_DEFAULT);
#else
retval = mysql_real_query(sock, shutdown, strlen(shutdown));
#endif
#endif
else if (strEQ(command, "reload"))
retval = mysql_reload(sock);
Expand Down

0 comments on commit db47688

Please sign in to comment.