From: Georg Richter Date: Sat, 31 Jan 2004 07:51:03 +0000 (+0000) Subject: Corrected binding: X-Git-Tag: php-5.0.0b4RC1~215 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cccb92b23354337c16e05f76025204d64e4671aa;p=php Corrected binding: if column has type DECIMAL it will converted to string now. Thanks to Brian Aker for pointing this out. --- diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index ac23dde850..6d1432ebf8 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -258,7 +258,6 @@ PHP_FUNCTION(mysqli_bind_result) col_type = (stmt->stmt->fields) ? stmt->stmt->fields[ofs].type : MYSQL_TYPE_STRING; switch (col_type) { - case MYSQL_TYPE_DECIMAL: case MYSQL_TYPE_DOUBLE: case MYSQL_TYPE_FLOAT: convert_to_double_ex(args[i]); @@ -300,6 +299,7 @@ PHP_FUNCTION(mysqli_bind_result) case MYSQL_TYPE_STRING: case MYSQL_TYPE_BLOB: case MYSQL_TYPE_TIMESTAMP: + case MYSQL_TYPE_DECIMAL: stmt->result.buf[ofs].type = IS_STRING; stmt->result.buf[ofs].buflen = (stmt->stmt->fields) ? stmt->stmt->fields[ofs].length + 1: 256; stmt->result.buf[ofs].buffer = (char *)emalloc(stmt->result.buf[ofs].buflen);