Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/mysqli mysqli_nonapi.c

2007-04-23 Thread Georg Richter
Antony Dovgal wrote:

Tony,

why do you set reconnect as default? If someone needs to reconnect, he
should set mysqli.reconnect.

Your change will break BC: mysql_ping now tries to reconnect
automatically which has bad side effects: Several values of the
connection are reset and the php application doesn't know about.

Please revert!

/Georg
-- 
Georg Richter, Development Manager - Connectors  Client Connectivity
MySQL GmbH, Radlkoferstr. 2, D-81373 München, www.mysql.com
Geschäftsführer: Hans von Bell, Kaj Arnö - HRB München 162140

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/mysqli mysqli_nonapi.c

2007-04-23 Thread Antony Dovgal

On 04/23/2007 11:59 AM, Georg Richter wrote:

Antony Dovgal wrote:

Tony,

why do you set reconnect as default? If someone needs to reconnect, he
should set mysqli.reconnect.

Your change will break BC: mysql_ping now tries to reconnect
automatically which has bad side effects: Several values of the
connection are reset and the php application doesn't know about.


No, my change was supposed to make the function behave as documented.
The BC has been broken long before, in MySQL API. 


--
Wbr, 
Antony Dovgal


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/mysqli mysqli_nonapi.c

2007-04-23 Thread Georg Richter
Antony Dovgal wrote:
 
 No, my change was supposed to make the function behave as documented.
 The BC has been broken long before, in MySQL API.

This change is documented in mysql api documentation - however we need
to update PHP docs.

/Georg
-- 
Georg Richter, Development Manager - Connectors  Client Connectivity
MySQL GmbH, Radlkoferstr. 2, D-81373 München, www.mysql.com
Geschäftsführer: Hans von Bell, Kaj Arnö - HRB München 162140

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/mysqli mysqli_nonapi.c

2007-04-15 Thread Andrey Hristov
 Privet,
Antony Dovgal wrote:
 On 04/15/2007 12:11 AM, Andrey Hristov wrote:
 http://php.net/mysqli_ping
 mysqli_ping, mysqli-ping() — Pings a server connection, or
 *tries to
 reconnect if the connection has gone down*

 Then the fix is wrong, it should set reconnect only for the mysql_ping
 call, if reconnect is off.
 
 Could you please be more verbose? What's wrong setting it always? The
 docs say it's off by default.

mysqli.reconnect ini setting is not respected, it's set to off, by
default. You set during connect reconnect to 1, which is not what is
wanted. mysql(i) is an interface on top of libmysql (so far in released
versions) and follows the rules of libmysql. The documentation should be
fixed that as of libmysql 5.0.3 mysqli_ping() won't reestablish the
connection if the ini variable mysqli.reconnect is off.


 As far as I understand, there is no way to fix it in versions between
 5.0.3 and 5.0.13 because of MySQLI API breakage.


 It's just about setting mysql-reconnect in this cases. This versions
 won't change anyway, they are released.
 
 Right. We need to set it somehow, but MYSQL_OPT_RECONNECT is missing in
 these versions.
 If you know how to do it - let me know.

No need to patch, documentation has to be fixed.

Andrey

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/mysqli mysqli_nonapi.c

2007-04-14 Thread Antony Dovgal
tony2001Sat Apr 14 10:35:05 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mysqli mysqli_nonapi.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.54.2.7.2.2r2=1.54.2.7.2.3diff_format=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.54.2.7.2.2 
php-src/ext/mysqli/mysqli_nonapi.c:1.54.2.7.2.3
--- php-src/ext/mysqli/mysqli_nonapi.c:1.54.2.7.2.2 Mon Jan  1 09:36:03 2007
+++ php-src/ext/mysqli/mysqli_nonapi.c  Sat Apr 14 10:35:05 2007
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_nonapi.c,v 1.54.2.7.2.2 2007/01/01 09:36:03 sebastian Exp $ 
+  $Id: mysqli_nonapi.c,v 1.54.2.7.2.3 2007/04/14 10:35:05 tony2001 Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -39,6 +39,9 @@
char*hostname = NULL, *username=NULL, 
*passwd=NULL, *dbname=NULL, *socket=NULL;
unsigned inthostname_len = 0, username_len = 0, passwd_len 
= 0, dbname_len = 0, socket_len = 0;
longport=0;
+#if MYSQL_VERSION_ID  50012
+   my_bool my_true = 1;
+#endif
 
if (getThis()  !ZEND_NUM_ARGS()) {
RETURN_NULL();
@@ -84,6 +87,10 @@
}
 #endif
 
+#if MYSQL_VERSION_ID  50012
+   mysql_options(mysql-mysql, MYSQL_OPT_RECONNECT, (const char 
*)my_true);
+#endif
+
if (!socket) {
socket = MyG(default_socket);
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/mysqli mysqli_nonapi.c

2007-04-14 Thread Andrey Hristov
  Hi Tony,
Antony Dovgal wrote:
 tony2001  Sat Apr 14 10:35:05 2007 UTC
 
   Modified files:  (Branch: PHP_5_2)
 /php-src/ext/mysqli   mysqli_nonapi.c 
   Log:
   MFH
   
   
 http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.54.2.7.2.2r2=1.54.2.7.2.3diff_format=u
 Index: php-src/ext/mysqli/mysqli_nonapi.c
 diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.54.2.7.2.2 
 php-src/ext/mysqli/mysqli_nonapi.c:1.54.2.7.2.3
 --- php-src/ext/mysqli/mysqli_nonapi.c:1.54.2.7.2.2   Mon Jan  1 09:36:03 2007
 +++ php-src/ext/mysqli/mysqli_nonapi.cSat Apr 14 10:35:05 2007
 @@ -15,7 +15,7 @@
| Author: Georg Richter [EMAIL PROTECTED]
 |
+--+
  
 -  $Id: mysqli_nonapi.c,v 1.54.2.7.2.2 2007/01/01 09:36:03 sebastian Exp $ 
 +  $Id: mysqli_nonapi.c,v 1.54.2.7.2.3 2007/04/14 10:35:05 tony2001 Exp $ 
  */
  
  #ifdef HAVE_CONFIG_H
 @@ -39,6 +39,9 @@
   char*hostname = NULL, *username=NULL, 
 *passwd=NULL, *dbname=NULL, *socket=NULL;
   unsigned inthostname_len = 0, username_len = 0, passwd_len 
 = 0, dbname_len = 0, socket_len = 0;
   longport=0;
 +#if MYSQL_VERSION_ID  50012
 + my_bool my_true = 1;
 +#endif
  
   if (getThis()  !ZEND_NUM_ARGS()) {
   RETURN_NULL();
 @@ -84,6 +87,10 @@
   }
  #endif
  
 +#if MYSQL_VERSION_ID  50012
 + mysql_options(mysql-mysql, MYSQL_OPT_RECONNECT, (const char 
 *)my_true);
 +#endif
 +
   if (!socket) {
   socket = MyG(default_socket);
   }
 

doing this is definitely bad. Probably it makes mysql_ping() to work but
having reconnect being disabled has its reasons. Once connection is
broken TXs are lost, connection variables too. Reconnecting under the
hood is bad behavior. mysql_ping() can work without mysql-reconnect
being set to 1. It will just won't reconnect and return an error. Which
I think is pretty normal. The app should check and decide whether to
reconnect or die. Thus, please _revert_ the patches you committed to
ext/mysql and ext/mysqli. The report is bogus.
Even if the report wasn't bogus, the fix is not complete, as for
5.0.3  libmysql  5.0.13 , it doesn't work.

Andrey

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/mysqli mysqli_nonapi.c

2007-04-14 Thread Antony Dovgal

On 04/14/2007 07:30 PM, Andrey Hristov wrote:

doing this is definitely bad. Probably it makes mysql_ping() to work but
having reconnect being disabled has its reasons. 


http://php.net/mysqli_ping
mysqli_ping, mysqli-ping() — Pings a server connection, or *tries to reconnect 
if the connection has gone down*


Once connection is
broken TXs are lost, connection variables too. Reconnecting under the
hood is bad behavior. mysql_ping() can work without mysql-reconnect
being set to 1. It will just won't reconnect and return an error. Which
I think is pretty normal. 


It's not because it's expected to reconnect.


The app should check and decide whether to
reconnect or die. Thus, please _revert_ the patches you committed to
ext/mysql and ext/mysqli. The report is bogus.
Even if the report wasn't bogus, the fix is not complete, as for
5.0.3  libmysql  5.0.13 , it doesn't work.


As far as I understand, there is no way to fix it in versions between 5.0.3 and 
5.0.13 because of MySQLI API breakage.

--
Wbr, 
Antony Dovgal


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/mysqli mysqli_nonapi.c

2007-04-14 Thread Andrey Hristov
  Hi,
Antony Dovgal wrote:
 On 04/14/2007 07:30 PM, Andrey Hristov wrote:
 doing this is definitely bad. Probably it makes mysql_ping() to work but
 having reconnect being disabled has its reasons. 
 
 http://php.net/mysqli_ping
 mysqli_ping, mysqli-ping() — Pings a server connection, or *tries to
 reconnect if the connection has gone down*

Then the fix is wrong, it should set reconnect only for the mysql_ping
call, if reconnect is off.

 Once connection is
 broken TXs are lost, connection variables too. Reconnecting under the
 hood is bad behavior. mysql_ping() can work without mysql-reconnect
 being set to 1. It will just won't reconnect and return an error. Which
 I think is pretty normal. 
 
 It's not because it's expected to reconnect.
 
 The app should check and decide whether to
 reconnect or die. Thus, please _revert_ the patches you committed to
 ext/mysql and ext/mysqli. The report is bogus.
 Even if the report wasn't bogus, the fix is not complete, as for
 5.0.3  libmysql  5.0.13 , it doesn't work.
 
 As far as I understand, there is no way to fix it in versions between
 5.0.3 and 5.0.13 because of MySQLI API breakage.
 

It's just about setting mysql-reconnect in this cases. This versions
won't change anyway, they are released.

Andrey

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/mysqli mysqli_nonapi.c

2007-04-14 Thread Antony Dovgal

On 04/15/2007 12:11 AM, Andrey Hristov wrote:

http://php.net/mysqli_ping
mysqli_ping, mysqli-ping() — Pings a server connection, or *tries to
reconnect if the connection has gone down*


Then the fix is wrong, it should set reconnect only for the mysql_ping
call, if reconnect is off.


Could you please be more verbose? What's wrong setting it always? 
The docs say it's off by default.



As far as I understand, there is no way to fix it in versions between
5.0.3 and 5.0.13 because of MySQLI API breakage.



It's just about setting mysql-reconnect in this cases. This versions
won't change anyway, they are released.


Right. We need to set it somehow, but MYSQL_OPT_RECONNECT is missing in these 
versions.
If you know how to do it - let me know.

--
Wbr, 
Antony Dovgal


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php