ID:               49761
 Updated by:       [email protected]
 Reported By:      oliviapurvis at yahoo dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         MySQLi related
 Operating System: CentOS 5.3
 PHP Version:      5.3.0


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

[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.

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

[2009-10-03 17:43:31] oliviapurvis at yahoo dot com

Description:
------------
I'm currently using Mysqli (mysqlnd) with persistent connection. When
checking the apache error log file I get lots of this warning:

[Thu Oct 01 00:38:38 2009] [error] [client 122.122.122.122] PHP
Warning:  Error while sending CHANGE_USER packet. PID=18133 in
/home/mysite/myscript.php on line 10

Line 10 of the script is:
$db=new mysqli('p:localhost','user','pass','mydb',3306);

The warning is not generated on every request to the script. It occurs
only once every few minutes.

Is this a bug?



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


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

Reply via email to