diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-12-15 17:07:27 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-12-17 10:54:34 +0100 |
commit | c18b1aea289e8ed6edb3f6e6a135018976a034c6 (patch) | |
tree | b0e1811aa85920dfd09ce2921a104dcacb7e8305 /ext/pdo_mysql/php_pdo_mysql_int.h | |
parent | 33e904915ec9f19b697589d7b73c908953671020 (diff) | |
download | php-git-c18b1aea289e8ed6edb3f6e6a135018976a034c6.tar.gz |
PDO MySQL: Use native types for results
Previously, PDO MySQL only fetched data as native int/float if
native prepared statements were used. This patch updates PDO to
have the same behavior for emulated prepared statements, and thus
removes the largest remaining discrepancy between these two modes.
Note that PDO already has a ATTR_STRINGIFY_FETCHES option to control
whether native types are desired or not. The previous output can
be restored by enabling this option.
Most of the tests make use of that option, because this allows the
tests to work under libmysqlclient as well, which currently always
returns string results (independently of whether native or emulated
PS are used).
Diffstat (limited to 'ext/pdo_mysql/php_pdo_mysql_int.h')
-rw-r--r-- | ext/pdo_mysql/php_pdo_mysql_int.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h index 553437829e..e83ac735dc 100644 --- a/ext/pdo_mysql/php_pdo_mysql_int.h +++ b/ext/pdo_mysql/php_pdo_mysql_int.h @@ -120,12 +120,6 @@ typedef struct { pdo_mysql_db_handle *H; MYSQL_RES *result; const MYSQL_FIELD *fields; - MYSQL_ROW current_data; -#ifdef PDO_USE_MYSQLND - const size_t *current_lengths; -#else - unsigned long *current_lengths; -#endif pdo_mysql_error_info einfo; #ifdef PDO_USE_MYSQLND MYSQLND_STMT *stmt; @@ -137,10 +131,14 @@ typedef struct { #ifndef PDO_USE_MYSQLND my_bool *in_null; zend_ulong *in_length; -#endif PDO_MYSQL_PARAM_BIND *bound_result; my_bool *out_null; zend_ulong *out_length; + MYSQL_ROW current_data; + unsigned long *current_lengths; +#else + zval *current_row; +#endif unsigned max_length:1; /* Whether all result sets have been fully consumed. * If this flag is not set, they need to be consumed during destruction. */ |