]> granicus.if.org Git - php/commitdiff
Corrected binding:
authorGeorg Richter <georg@php.net>
Sat, 31 Jan 2004 07:51:03 +0000 (07:51 +0000)
committerGeorg Richter <georg@php.net>
Sat, 31 Jan 2004 07:51:03 +0000 (07:51 +0000)
  if column has type DECIMAL it will converted to string now.
  Thanks to Brian Aker for pointing this out.

ext/mysqli/mysqli_api.c

index ac23dde85001b15ab861f508cb8e57546f9f8773..6d1432ebf8f2d035041877dc7366a906cffd62f9 100644 (file)
@@ -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);