diff options
author | Andi Gutmans <andi@php.net> | 2005-02-17 20:11:20 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2005-02-17 20:11:20 +0000 |
commit | 27b13ba47cef74699b6b2d11cf8d9f1c29d45194 (patch) | |
tree | b0ca4856b0b99ea24ed37057afb25cb29cc0da12 /ext/msql/php_msql.c | |
parent | f2eb0acfcf3f484cd1650cfc3861f2519102a751 (diff) | |
download | php-git-27b13ba47cef74699b6b2d11cf8d9f1c29d45194.tar.gz |
- Fix Bug #31960: msql_fetch_row() and msql_fetch_array() dropping columns with NULL values
Diffstat (limited to 'ext/msql/php_msql.c')
-rw-r--r-- | ext/msql/php_msql.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/msql/php_msql.c b/ext/msql/php_msql.c index 93522865b2..6a7231bba2 100644 --- a/ext/msql/php_msql.c +++ b/ext/msql/php_msql.c @@ -958,9 +958,14 @@ static void php_msql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) add_assoc_stringl(return_value, msql_field->name, data, data_len, should_copy); } } else { - /* - add_get_index_stringl(return_value, i, "", 0, (void **) &pval_ptr, 1); - */ + /* NULL value. */ + if (result_type & MSQL_NUM) { + add_index_null(return_value, i); + } + + if (result_type & MSQL_ASSOC) { + add_assoc_null(return_value, msql_field->name); + } } } } |