Bug #45310 Doesn't work with php session handler plugin session_mysql
Submitted: 3 Jun 2009 19:04 Modified: 5 Jul 2009 7:02
Reporter: Oleg Polovinkin Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Proxy: Core Severity:S2 (Serious)
Version:0.7.1 OS:Linux (Fedora9 x64)
Assigned to: Assigned Account CPU Architecture:Any
Tags: php session_mysql client connection

[3 Jun 2009 19:04] Oleg Polovinkin
Description:
I've used mysql-proxy 0.6.1 for connections to database from php-code and for session handling (with session_mysql php plugin). Everything worked relatively good. Now I'm trying to switch to version 0.7.1 and strange thing happens - all requests from my php code work fine, but session_mysql doesn't work at all. I turned on debug and see only the following string on log:

2009-06-03 13:12:10: (debug) [network-mysqld.c:784]: error on a connection (fd: -1 event: 0). closing client connection.

Nothing from lua script, though debug in lua script is turned on (local is_debug = true). I tried with scripts rw_splitting.lua and ro-pooling.lua with just one backend defined.

Command line looks like this:

/usr/local/mysql-proxy/sbin/mysql-proxy --max-open-files=8192 --proxy-backend-addresses=127.0.0.1:3306 --proxy-lua-script=/usr/loc
al/mysql-proxy/script/ro-pooling.lua --proxy-address=:4080 --log-file=/tmp/mysql-proxy-test.log --log-level=debug --admin-address=
:4081 --daemon --log-backtrace-on-crash

OS: Fedora 9 x64
Kernel: 2.6.27.12
MySQL version: 5.0.51a

I tried mysql-proxy 0.7.1 downloaded from http://dev.mysql.com/downloads/mysql-proxy/, especially precompiled version for RedHat Enterprise Server 5 (AMD64 / Intel EM64T). Also tried compiled source (configure has been called with parameters --prefix=/usr/local/mysql-proxy --with-mysql --with-lua). Results identical.

If I use direct connection to DB from session_mysql - everything works fine. 

How to repeat:
Install php with addon session_mysql.
Configure php to use it for session handling.
Configure session_mysql to connect to mysql-proxy.
Write any php code, using sessions.

Suggested fix:
unknown
[5 Jun 2009 7:02] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior assuming session_mysql is PECL extension. Please provide session_mysql options from php.ini and example of PHP script problem is repeatable with.

I used default options and script:

<?php
session_start();
if (isset($_SESSION['foo']))
	$x = $_SESSION['foo'];
else
	$x = 0;
	
$_SESSION['foo'] = time();
var_dump($x);
?>
[11 Jun 2009 14:52] Jan Kneschke
Please run mysql-proxy with strace and attach the output to the bug-report:

  $ strace -o bug-45310.txt -ff -tt -s 512 mysql-proxy ...
[5 Jul 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".