Skip to content

Commit 5f7bd52

Browse files
committed
MFH:Compile-in a string-to-int conversion for INT columns by default,
controlled by a ini setting.
1 parent 1474d9d commit 5f7bd52

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ext/mysqlnd/mysqlnd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
#define MYSQLND_VERSION_ID 50004
2828

2929
/* This forces inlining of some accessor functions */
30-
#define MYSQLND_USE_OPTIMISATIONS 0
30+
#define MYSQLND_USE_OPTIMISATIONS 1
3131

3232

33-
/* #define MYSQLND_STRING_TO_INT_CONVERSION */
33+
#define MYSQLND_STRING_TO_INT_CONVERSION
3434
/*
3535
This force mysqlnd to do a single (or more depending on ammount of data)
3636
non-blocking read() calls before sending a command to the server. Useful

ext/mysqlnd/mysqlnd_wireprotocol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
15641564
ZVAL_LONG(*current_field, v);
15651565
} else {
15661566
uint64 v = (uint64) atoll((char *) p);
1567-
zend_bool uns = packet->fields_metadata[i].flags & UNSIGNED_FLAG? TRUE:FALSE;
1567+
zend_bool uns = fields_metadata[i].flags & UNSIGNED_FLAG? TRUE:FALSE;
15681568
/* We have to make it ASCIIZ temporarily */
15691569
#if SIZEOF_LONG==8
15701570
if (uns == TRUE && v > 9223372036854775807L)
@@ -1581,7 +1581,7 @@ void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
15811581
}
15821582
*(p + len) = save;
15831583
} else
1584-
#endif
1584+
#endif /* MYSQLND_STRING_TO_INT_CONVERSION */
15851585
if (fields_metadata[i].type == MYSQL_TYPE_BIT) {
15861586
/*
15871587
BIT fields are specially handled. As they come as bit mask, we have

0 commit comments

Comments
 (0)