From 3ac1646ef2004f42f39f9cd5da07aa262c053dd6 Mon Sep 17 00:00:00 2001 From: Zak Greant Date: Sun, 30 Dec 2001 10:00:26 +0000 Subject: [PATCH] Corrected bug in php_mysql_fetch_hash() that prevented columns with NULL values from having both numeric and associative indexes. (Bug 14291) --- ext/mysql/php_mysql.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index e73e6c0357..e2a48830b6 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -1633,10 +1633,13 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, } } else { /* NULL value. */ - if (result_type & MYSQL_NUM) + if (result_type & MYSQL_NUM) { add_index_null(return_value, i); - else + } + + if (result_type & MYSQL_ASSOC) { add_assoc_null(return_value, mysql_field->name); + } } } } -- 2.50.1