From: Zak Greant Date: Sun, 30 Dec 2001 10:00:26 +0000 (+0000) Subject: Corrected bug in php_mysql_fetch_hash() that prevented columns with NULL values from... X-Git-Tag: PRE_ISSET_PATCH~357 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ac1646ef2004f42f39f9cd5da07aa262c053dd6;p=php Corrected bug in php_mysql_fetch_hash() that prevented columns with NULL values from having both numeric and associative indexes. (Bug 14291) --- 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); + } } } }