iliaa Wed Aug 31 21:56:37 2005 EDT Modified files: /php-src/ext/pdo_mysql mysql_statement.c Log: 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.49&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.49 --- 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:56:36 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.49 2005/09/01 01:56:36 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];
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php