diff options
author | Ulf Wendel <uw@php.net> | 2009-09-11 12:28:47 +0000 |
---|---|---|
committer | Ulf Wendel <uw@php.net> | 2009-09-11 12:28:47 +0000 |
commit | a69c19879090afb7f58008c5ca3d95bab1f81fdf (patch) | |
tree | 1c832f8a5e4e59fa41eb0750879a32a06705549e | |
parent | 9af451ff4948bf3561716eeca670d345b6bc235b (diff) | |
download | php-git-a69c19879090afb7f58008c5ca3d95bab1f81fdf.tar.gz |
Stepping back to PHP 5.2.x and earlier logic of allocating even huge pieces of memory for large BLOB types to avoid data truncation. This fixes the test failure of 005.phpt when using MySQL Client
Library (libmysql). The test does pass with mysqlnd because mysqlnd does not have any issues here.
-rw-r--r-- | ext/mysqli/mysqli_api.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index f69f6e7634..7d367e670c 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -395,7 +395,9 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval ***args, unsigned int argc, different lengths and you will see that we get different lengths in stmt->stmt->fields[ofs].length The just take 256 and saves us from realloc-ing. */ - stmt->result.buf[ofs].buflen = 256; + stmt->result.buf[ofs].buflen = + (stmt->stmt->fields) ? (stmt->stmt->fields[ofs].length) ? stmt->stmt->fields[ofs].length + 1: 256: 256; + } else { /* the user has called store_result(). if he does not there is no way to determine the |