svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/tests/bug49442.phpt branches/PHP_5_3/ext/mysqlnd/mysqlnd.h branches/PHP_5_3/ext/mysqlnd/mysqlnd_priv.h
branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c trunk/ext/mysqli/tests/bug49442.phpt trunk/ext/mysqlnd/mysqlnd.h trunk/ext/mysqlnd/mysqlnd_priv.h
trunk/ext/mysqlnd/mysqlnd_wireprotocol.c
| From: | Ulf Wendel | Date: | Wed, 16 Sep 2009 17:03:44 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/tests/bug49442.phpt branches/PHP_5_3/ext/mysqlnd/mysqlnd.h branches/PHP_5_3/ext/mysqlnd/mysqlnd_priv.h branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c trunk/ext/mysqli/tests/bug49442.phpt trunk/ext/mysqlnd/mysqlnd.h trunk/ext/mysqlnd/mysqlnd_priv.h trunk/ext/mysqlnd/mysqlnd_wireprotocol.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-60409@lists.php.net to get a copy of this message | ||
uw Wed, 16 Sep 2009 17:03:44 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=288379
Log:
Fix (by Andrey) and test for bug #49442 . Don't use efree() for memory allocated with
malloc()... If a connection gets created by mysqli_init(), mysqlnd makes it 'persistent'.
'Persistent' means that mysqlnd uses malloc(). mysqlnd does use malloc() instead of
ealloc() because it is unknown if the connection will become a true persistent connection in the
sense of ext/mysqli. It is unknown if the user wants a persistent connection or not until the user
calls mysqli_real_connect(). To avoid tricky conversions mysqlnd uses malloc(), which sets a private
persistent flag in the mysqlnd structures. A precondition for the crash to happen was that the
private persistent flag is set. The flag is also set when creating a real persistent connection (in
the sense of ext/mysqli) and so the bug can happen with mysql_init()/mysqli_real_connect() and
mysql_connect('p:<host>', ...). Therefore we test both cases. Note the (tricky?)
difference between the implementation detail'mysqlnd private !
persistent flag = use malloc()' and persistent connections from a user perspective. Although
mysqlnd will always set its private persistent flag and use malloc() for connections created with
mysqli_init() it is still up to the user to decide in mysqli_real_connect() if the connection shall
become a (true) persistent connection or not.
Bug: http://bugs.php.net/49442 (Assigned) Some queries crash
PHP with mysqli_real_connect()
Changed paths:
A php/php-src/branches/PHP_5_3/ext/mysqli/tests/bug49442.phpt
U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h
U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_priv.h
U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
A php/php-src/trunk/ext/mysqli/tests/bug49442.phpt
U php/php-src/trunk/ext/mysqlnd/mysqlnd.h
U php/php-src/trunk/ext/mysqlnd/mysqlnd_priv.h
U php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c
Attachment: [text/x-diff] svn-diffs-288379.txt
Attachment: [text/x-diff] svn-diffs-288379.txt