]> granicus.if.org Git - php/commitdiff
Compile-in a string-to-int conversion for INT columns by default,
authorAndrey Hristov <andrey@php.net>
Mon, 15 Sep 2008 14:02:55 +0000 (14:02 +0000)
committerAndrey Hristov <andrey@php.net>
Mon, 15 Sep 2008 14:02:55 +0000 (14:02 +0000)
controlled by a ini setting.

ext/mysqlnd/mysqlnd.h
ext/mysqlnd/mysqlnd_wireprotocol.c

index cc6afab51cc100487c9be320a0155b6e3dda6c46..817fef2c549c8d8ab45367e8fda779372865f00f 100644 (file)
 #define MYSQLND_VERSION_ID 50004
 
 /* This forces inlining of some accessor functions */
-#define MYSQLND_USE_OPTIMISATIONS 0
+#define MYSQLND_USE_OPTIMISATIONS 1
 
 
-/* #define MYSQLND_STRING_TO_INT_CONVERSION */
+#define MYSQLND_STRING_TO_INT_CONVERSION
 /*
   This force mysqlnd to do a single (or more depending on ammount of data)
   non-blocking read() calls before sending a command to the server. Useful
index a8e7c764de1f910b57bd6950bcac4b577292abfb..d6e4715483095e12782d9a1278449d1d62b71ba7 100644 (file)
@@ -1564,7 +1564,7 @@ void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
                                        ZVAL_LONG(*current_field, v);
                                } else {
                                        uint64 v = (uint64) atoll((char *) p);
-                                       zend_bool uns = packet->fields_metadata[i].flags & UNSIGNED_FLAG? TRUE:FALSE;
+                                       zend_bool uns = fields_metadata[i].flags & UNSIGNED_FLAG? TRUE:FALSE;
                                        /* We have to make it ASCIIZ temporarily */
 #if SIZEOF_LONG==8
                                        if (uns == TRUE && v > 9223372036854775807L)
@@ -1581,7 +1581,7 @@ void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
                                }
                                *(p + len) = save;
                        } else
-#endif
+#endif /* MYSQLND_STRING_TO_INT_CONVERSION */
                        if (fields_metadata[i].type == MYSQL_TYPE_BIT) {
                                /*
                                  BIT fields are specially handled. As they come as bit mask, we have