diff options
author | Georg Richter <georg@php.net> | 2005-12-29 09:49:19 +0000 |
---|---|---|
committer | Georg Richter <georg@php.net> | 2005-12-29 09:49:19 +0000 |
commit | a5acdfc5f22c753b7699abd45c98bd870b400efb (patch) | |
tree | f510a5ca3e1ad543e3f35261400ecf709e83c5fb /ext/mysqli/mysqli_api.c | |
parent | 3795f9d8bb6b0fac5ca48d98afe84941c7661b98 (diff) | |
download | php-git-a5acdfc5f22c753b7699abd45c98bd870b400efb.tar.gz |
Fix for bug #35517:
added missing unsigned flag for result buffer
fixed returncode in mysql_stmt_fetch for data truncation
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r-- | ext/mysqli/mysqli_api.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index b4cb8911b9..cbb1b486ed 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -299,6 +299,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result) bind[ofs].buffer_type = MYSQL_TYPE_LONG; bind[ofs].buffer = stmt->result.buf[ofs].val; bind[ofs].is_null = &stmt->result.is_null[ofs]; + bind[ofs].is_unsigned = (stmt->stmt->fields[ofs].flags & UNSIGNED_FLAG) ? 1 : 0; break; case MYSQL_TYPE_LONGLONG: @@ -309,6 +310,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result) bind[ofs].buffer = stmt->result.buf[ofs].val; bind[ofs].is_null = &stmt->result.is_null[ofs]; bind[ofs].buffer_length = stmt->result.buf[ofs].buflen; + bind[ofs].is_unsigned = (stmt->stmt->fields[ofs].flags & UNSIGNED_FLAG) ? 1 : 0; break; case MYSQL_TYPE_DATE: @@ -721,6 +723,13 @@ PHP_FUNCTION(mysqli_stmt_fetch) switch (ret) { case 0: +#ifdef MYSQL_DATA_TRUNCATED + /* according to SQL standard truncation (e.g. loss of precision is + not an error) - for detecting possible truncation you have to + check mysqli_stmt_warning + */ + case MYSQL_DATA_TRUNCATED: +#endif RETURN_TRUE; break; case 1: |