summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_wireprotocol.c
diff options
context:
space:
mode:
authorUlf Wendel <uw@php.net>2009-09-09 17:03:03 +0000
committerUlf Wendel <uw@php.net>2009-09-09 17:03:03 +0000
commit5254c6f37284007efd17acedc2036a3b0f1d542e (patch)
tree7141da211c789c02893dc245e24412ac30c4b1f6 /ext/mysqlnd/mysqlnd_wireprotocol.c
parent5b709c4718e2138171d8c6d9f7ca18ee4f3efb78 (diff)
downloadphp-git-5254c6f37284007efd17acedc2036a3b0f1d542e.tar.gz
Next attempt to fix http://bugs.php.net/bug.php?id=48745. Patch by Andrey.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_wireprotocol.c')
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 989cc87ed0..79c98741e8 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -1126,7 +1126,16 @@ php_mysqlnd_rset_field_read(void *_packet, MYSQLND *conn TSRMLS_DC)
if (packet->skip_parsing) {
DBG_RETURN(PASS);
}
- if (*p == 0xFE && packet->header.size < 8) {
+ if (*p == 0xFF) {
+ /* Error */
+ p++;
+ php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
+ packet->error_info.error, sizeof(packet->error_info.error),
+ &packet->error_info.error_no, packet->error_info.sqlstate
+ TSRMLS_CC);
+ DBG_ERR_FMT("Server error : (%d) %s", packet->error_info.error_no, packet->error_info.error);
+ DBG_RETURN(PASS);
+ } else if (*p == 0xFE && packet->header.size < 8) {
/* Premature EOF. That should be COM_FIELD_LIST */
DBG_INF("Premature EOF. That should be COM_FIELD_LIST");
packet->stupid_list_fields_eof = TRUE;