#41083 [Asn->Csd]: mysql_ping cann't work

From: Date: Fri, 17 Aug 2007 09:51:36 +0000
Subject: #41083 [Asn->Csd]: mysql_ping cann't work
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969377559@lists.php.net to get a copy of this message
ID: 41083 Updated by: vrana@php.net Reported By: xiaojb at gmail dot com -Status: Assigned +Status: Closed Bug Type: Documentation problem Operating System: RedHat PHP Version: 5.2.1 Assigned To: georg New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. "Since MySQL 5.0.13, automatic reconnection feature is disabled." Previous Comments: ------------------------------------------------------------------------ [2007-04-23 09:25:33] tony2001@php.net Reverted and reclassified as docu problem. ------------------------------------------------------------------------ [2007-04-14 10:19:22] tony2001@php.net This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2007-04-14 01:15:38] xiaojb at gmail dot com if mysql server is 5.0.13 and later, mysql client MUST set option "MYSQL_OPT_RECONNECT" to TRUE, then mysql_ping will work. http://dev.mysql.com/doc/refman/5.0/en/mysql-options.html www@www215 /usr/local/src/php-5.2.1$ diff -u ext/mysql/php_mysql.c /tmp/php_mysql.c --- ext/mysql/php_mysql.c 2007-01-01 17:36:03.000000000 +0800 +++ /tmp/php_mysql.c 2007-04-14 08:39:30.000000000 +0800 @@ -672,6 +672,9 @@ mysql->active_result_id = 0; #if MYSQL_VERSION_ID > 32199 /* this lets us set the port number */ mysql_init(&mysql->conn); +#if MYSQL_VERSION_ID > 50012 + mysql_options(&mysql->conn, MYSQL_OPT_RECONNECT, "1"); +#endif if (connect_timeout != -1) mysql_options(&mysql->conn, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout); @@ -777,6 +780,9 @@ mysql->active_result_id = 0; #if MYSQL_VERSION_ID > 32199 /* this lets us set the port number */ mysql_init(&mysql->conn); +#if MYSQL_VERSION_ID > 50012 + mysql_options(&mysql->conn, MYSQL_OPT_RECONNECT, "1"); +#endif if (connect_timeout != -1) mysql_options(&mysql->conn, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout); ------------------------------------------------------------------------ [2007-04-14 01:06:19] xiaojb at gmail dot com Description: ------------ if mysql server is 5.0.13 and later, mysql client MUST set option "MYSQL_OPT_RECONNECT" to TRUE, then mysql_ping will work. http://dev.mysql.com/doc/refman/5.0/en/mysql-options.html www@www215 /usr/local/src/php-5.2.1$ diff ext/mysql/php_mysql.c /tmp/php_mysql.c 674a675,677 > #if MYSQL_VERSION_ID > 50012 > mysql_options(&mysql->conn, MYSQL_OPT_RECONNECT, "1"); > #endif 779a783,785 > #if MYSQL_VERSION_ID > 50012 > mysql_options(&mysql->conn, MYSQL_OPT_RECONNECT, "1"); > #endif www@www215 /usr/local/src/php-5.2.1$ diff -u ext/mysql/php_mysql.c /tmp/php_mysql.c --- ext/mysql/php_mysql.c 2007-01-01 17:36:03.000000000 +0800 +++ /tmp/php_mysql.c 2007-04-14 08:39:30.000000000 +0800 @@ -672,6 +672,9 @@ mysql->active_result_id = 0; #if MYSQL_VERSION_ID > 32199 /* this lets us set the port number */ mysql_init(&mysql->conn); +#if MYSQL_VERSION_ID > 50012 + mysql_options(&mysql->conn, MYSQL_OPT_RECONNECT, "1"); +#endif if (connect_timeout != -1) mysql_options(&mysql->conn, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout); @@ -777,6 +780,9 @@ mysql->active_result_id = 0; #if MYSQL_VERSION_ID > 32199 /* this lets us set the port number */ mysql_init(&mysql->conn); +#if MYSQL_VERSION_ID > 50012 + mysql_options(&mysql->conn, MYSQL_OPT_RECONNECT, "1"); +#endif if (connect_timeout != -1) mysql_options(&mysql->conn, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41083&edit=1

« previous php.doc (#969377559) next »