| tony2001@php.net 2007-04-23, 7:59 am |
| ID: 41083
Updated by: tony2001@php.net
Reported By: xiaojb at gmail dot com
-Status: Closed
+Status: Assigned
-Bug Type: MySQL related
+Bug Type: Documentation problem
Operating System: RedHat
PHP Version: 5.2.1
-Assigned To:
+Assigned To: georg
New Comment:
Reverted and reclassified as docu problem.
Previous Comments:
------------------------------------------------------------------------
[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...ql-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...ql-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
|