summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_connection.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2016-07-23 00:26:26 +0300
committerNikita Popov <nikic@php.net>2016-07-25 21:59:27 +0200
commitb27ff62ee0a40b3784cc032f2431e974a77b28c2 (patch)
tree5f31be09165b8ba582a0f999c9f683121647df33 /ext/mysqlnd/mysqlnd_connection.c
parentac0bbea3a89334b47995315cd37ca342e89486f2 (diff)
downloadphp-git-b27ff62ee0a40b3784cc032f2431e974a77b28c2.tar.gz
Fix for bug #71863 Segfault when EXPLAIN with "Unknown column" error
The reason was that after the big refactoring of mysqlnd at the end of last year code that is initializing the error_info structure in the result set was not added. It existed already for connections and PS. The code that segfaults is hit only with MariaDB because MariaDB sends full metadata about the EXPLAIN query + EOF packet and only then it sends an error packet. MySQL doesn't do that but sends directly an error which is caught (by different code path). As errors during execution (which means after sending meta) are pretty rare there was no test case of MySQL to catch it.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_connection.c')
-rw-r--r--ext/mysqlnd/mysqlnd_connection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/mysqlnd/mysqlnd_connection.c b/ext/mysqlnd/mysqlnd_connection.c
index 701bc282e1..a3300dc6d9 100644
--- a/ext/mysqlnd/mysqlnd_connection.c
+++ b/ext/mysqlnd/mysqlnd_connection.c
@@ -215,11 +215,11 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_connection_state)
MYSQLND_CLASS_METHODS_END;
-/* {{{ mysqlnd_upsert_status_init */
+/* {{{ mysqlnd_connection_state_init */
PHPAPI void
mysqlnd_connection_state_init(struct st_mysqlnd_connection_state * const state)
{
- DBG_ENTER("mysqlnd_error_info_init");
+ DBG_ENTER("mysqlnd_connection_state_init");
state->m = &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_connection_state);
state->state = CONN_ALLOCED;
DBG_VOID_RETURN;