From: Andrey Hristov Date: Mon, 15 Sep 2008 14:02:55 +0000 (+0000) Subject: Compile-in a string-to-int conversion for INT columns by default, X-Git-Tag: BEFORE_HEAD_NS_CHANGE~383 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=02ae7e8737bfcd430687b891b575fbc51009c028;p=php Compile-in a string-to-int conversion for INT columns by default, controlled by a ini setting. --- diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index cc6afab51c..817fef2c54 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -27,10 +27,10 @@ #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 diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index a8e7c764de..d6e4715483 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -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