cvs: php-src(PHP_5_1) / NEWS /ext/pdo_mysql mysql_statement.c
| From: | Ilia Alshanetsky | Date: | Thu, 01 Sep 2005 01:57:02 +0000 |
| Subject: | cvs: php-src(PHP_5_1) / NEWS /ext/pdo_mysql mysql_statement.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-33723@lists.php.net to get a copy of this message | ||
iliaa Wed Aug 31 21:57:02 2005 EDT
Modified files: (Branch: PHP_5_1)
/php-src/ext/pdo_mysql mysql_statement.c
/php-src NEWS
Log:
MFH: Fixed bug #34001 (pdo_mysql truncates numberic fields at 4 chars)
http://cvs.php.net/diff.php/php-src/ext/pdo_mysql/mysql_statement.c?r1=1.48&r2=1.48.2.1&ty=u
Index: php-src/ext/pdo_mysql/mysql_statement.c
diff -u php-src/ext/pdo_mysql/mysql_statement.c:1.48
php-src/ext/pdo_mysql/mysql_statement.c:1.48.2.1
--- php-src/ext/pdo_mysql/mysql_statement.c:1.48 Wed Jul 20 00:30:14 2005
+++ php-src/ext/pdo_mysql/mysql_statement.c Wed Aug 31 21:57:01 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysql_statement.c,v 1.48 2005/07/20 04:30:14 iliaa Exp $ */
+/* $Id: mysql_statement.c,v 1.48.2.1 2005/09/01 01:57:01 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -121,9 +121,27 @@
mysql_stmt_attr_set(S->stmt, STMT_ATTR_UPDATE_MAX_LENGTH, &on);
calc_max_length = 0;
}
- S->bound_result[i].buffer_length =
- S->fields[i].max_length? S->fields[i].max_length:
- S->fields[i].length;
+ switch (S->fields[i].type) {
+ case FIELD_TYPE_INT24:
+ S->bound_result[i].buffer_length = MAX_MEDIUMINT_WIDTH;
+ break;
+ case FIELD_TYPE_LONG:
+ S->bound_result[i].buffer_length = MAX_INT_WIDTH;
+ break;
+ case FIELD_TYPE_LONGLONG:
+ S->bound_result[i].buffer_length = MAX_BIGINT_WIDTH;
+ break;
+ case FIELD_TYPE_TINY:
+ S->bound_result[i].buffer_length = MAX_TINYINT_WIDTH;
+ break;
+ case FIELD_TYPE_SHORT:
+ S->bound_result[i].buffer_length = MAX_SMALLINT_WIDTH;
+ break;
+ default:
+ S->bound_result[i].buffer_length =
+ S->fields[i].max_length? S->fields[i].max_length:
+ S->fields[i].length;
+ }
S->bound_result[i].buffer = emalloc(S->bound_result[i].buffer_length);
S->bound_result[i].is_null = &S->out_null[i];
S->bound_result[i].length = &S->out_length[i];
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.36&r2=1.2027.2.37&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.36 php-src/NEWS:1.2027.2.37
--- php-src/NEWS:1.2027.2.36 Wed Aug 31 10:58:22 2005
+++ php-src/NEWS Wed Aug 31 21:57:01 2005
@@ -39,6 +39,7 @@
- Fixed bug #34062 (Crash in catch block when many arguments are used).
(Dmitry)
- Fixed bug #34045 (Buffer overflow with serialized object). (Dmitry)
+- Fixed bug #34001 (pdo_mysql truncates numberic fields at 4 chars). (Ilia)
- Fixed bug #33999 (object remains object when cast to int). (Dmitry)
- Fixed bug #33996 (No information given for fatal error on passing invalid
value to typed argument). (Dmitry)