Author: ahristov
Date: 2007-03-29 10:40:17 +0200 (Thu, 29 Mar 2007)
New Revision: 302
Modified:
trunk/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c
Log:
Make enough room to read the error packet, that might come in
error packet.
Modified: trunk/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c
===================================================================
--- trunk/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c 2007-03-28 19:43:36 UTC (rev 301)
+++ trunk/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c 2007-03-29 08:40:17 UTC (rev 302)
@@ -719,9 +719,15 @@
static enum_func_status
php_mysqlnd_eof_read(void *_packet, MYSQLND *conn TSRMLS_DC)
{
- zend_uchar buf[5]; /* EOF packet is since 4.1 five bytes long*/
+ /*
+ EOF packet is since 4.1 five bytes long,
+ but we can get also an error, make it bigger.
+
+ Error : error_code + '#' + sqlstate + MYSQLND_ERRMSG_SIZE
+ */
+ php_mysql_packet_eof *packet= (php_mysql_packet_eof *) _packet;
+ zend_uchar buf[5 + 10 + sizeof(packet->sqlstate) + sizeof(packet->error)];
zend_uchar *p= buf;
- php_mysql_packet_eof *packet= (php_mysql_packet_eof *) _packet;
PACKET_READ_HEADER_AND_BODY(packet, conn, buf, sizeof(buf), "EOF");
| Thread |
|---|
| • PHP mysqlnd svn commit: r302 - trunk/ext/mysqli/mysqlnd | ahristov | 29 Mar |