summaryrefslogtreecommitdiff
path: root/ext/mysql/php_mysql.c
diff options
context:
space:
mode:
authorZak Greant <zak@php.net>2001-12-30 10:00:26 +0000
committerZak Greant <zak@php.net>2001-12-30 10:00:26 +0000
commit3ac1646ef2004f42f39f9cd5da07aa262c053dd6 (patch)
tree72d013b9093009a8ee8292779658a95edf7d0f9b /ext/mysql/php_mysql.c
parent59a45acca6b045baaaf3a3421158a8b405ae8148 (diff)
downloadphp-git-3ac1646ef2004f42f39f9cd5da07aa262c053dd6.tar.gz
Corrected bug in php_mysql_fetch_hash() that prevented columns with NULL values from having both numeric and associative indexes. (Bug 14291)
Diffstat (limited to 'ext/mysql/php_mysql.c')
-rw-r--r--ext/mysql/php_mysql.c7
1 files 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);
+ }
}
}
}