ID:               49761
 Updated by:       [email protected]
 Reported By:      oliviapurvis at yahoo dot com
-Status:           Assigned
+Status:           Closed
 Bug Type:         MySQLi related
 Operating System: CentOS 5.3
 PHP Version:      5.3.0
 Assigned To:      uw
 New Comment:

I have comittet a change to silence CHANGE_USER when reusing pooled
persistent connections. The warning should no longer appear. 

The change should either make it into 5.3.1 or 5.3.2 - that is up to
the release manager to decide. It is not a critical change. 


Previous Comments:
------------------------------------------------------------------------

[2009-10-15 20:46:08] [email protected]

Automatic comment from SVN on behalf of uw
Revision: http://svn.php.net/viewvc/?view=revision&revision=289684
Log: Making mysqlnd emit no warnings when fetching pooled persistent
connections that have timed out or are unusable for any other reason -
bug #49761

------------------------------------------------------------------------

[2009-10-04 18:34:47] [email protected]

5.1.37 should be fine to my knowledge.

The timeouts should be described in the MySQL manual. Their values
appear "normal" to me. Please ask on one of the discussion lists what
value may be best - in the end this is a bug system not a discussion
list. 

As said, I believe that you get the warning because you occasionally
hit a connection that has timed out or similar - nothing to worry about:
PHP simply picks the next connection from the pool or opens a new one.
The same can happen with ext/mysql. The only difference is that
ext/mysqli @ mysqlnd is a bit more verbose...

The only question here is if a) libmysql also barks and b) if we want
that warning or not. Maybe the warning should be suppressed because its
handled internally.

Assigning to myself to discuss with Andrey and Johannes.

------------------------------------------------------------------------

[2009-10-04 16:25:29] oliviapurvis at yahoo dot com

I'm using MySQL 5.1.37.

I have 2 variables set in mysqld that might have affected this:
wait_timeout = 300
interactive_timeout = 300

Are these too low and do they have any connection with the PHP warning?

------------------------------------------------------------------------

[2009-10-03 18:41:21] [email protected]

No it is not a bug, 98% quite sure about that.

COM_CHANGE_USER is a re-authentication command send from mysqlnd to the
MySQL server. COM_CHANGE_USER is there to check that the user who wants
to use the persistent connection is a) still allowed to connect to MySQL
and b) it resets all session related data (reset user variables, close
open transactions and so on - the MySQL manual has details on it).

ext/mysqli @ mysqlnd does send a COM_CHANGE_USER unlike ext/mysql.
ext/mysql does not properly reset persistent connections, ext/mysqli
does. All ext/mysql does is send a ping to check if the connection is
still alive. If you want the ext/mysql behaviour, recompile PHP with
-DMYSQLI_NO_CHANGE_USER_ON_PCONNECT .

I assume that every couple of minutes you hit a closed (timeout,
whatever...) connection in the pool connection. mysqlnd tries to send a
COM_CHANGE_USER, fails and bails. ext/mysqli recognizes the failure and
continues as it should. Its the same procedure as with ext/mysql and a
failing ping - just a bit more verbose...

What MySQL version are you running? Very old and very early 5.1
(<5.1.10 or something like that) servers had issues with
COM_CHANGE_USER.


------------------------------------------------------------------------

[2009-10-03 17:48:01] oliviapurvis at yahoo dot com

By the way, the script runs without warning if not using persistent
connection.

Also, when using persistent connection, the script works fine (as
intended) even though there is a warning in the log file.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/49761

-- 
Edit this bug report at http://bugs.php.net/?id=49761&edit=1

Reply via email to