mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
MFH: Fix #44135 (PDO MySQL does not support CLIENT_FOUND_ROWS)
This commit is contained in:
parent
806ea848f4
commit
40e42663f5
2
NEWS
2
NEWS
@ -51,6 +51,8 @@ PHP NEWS
|
||||
- Fixed bug #45392 (ob_start()/ob_end_clean() and memory_limit). (Ilia)
|
||||
- Fixed bug #45382 (timeout bug in stream_socket_enable_crypto).
|
||||
(vnegrier at optilian dot com, Ilia)
|
||||
- Fixed bug #44135 (PDO MySQL does not support CLIENT_FOUND_ROWS). (Johannes,
|
||||
chx1975 at gmail dot com)
|
||||
- Fixed bug #46192 (ArrayObject with objects as storage serialization).
|
||||
(Etienne)
|
||||
|
||||
|
@ -636,6 +636,14 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
|
||||
H->max_buffer_size = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MAX_BUFFER_SIZE, H->max_buffer_size TSRMLS_CC);
|
||||
#endif
|
||||
|
||||
if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_FOUND_ROWS, 0 TSRMLS_CC)) {
|
||||
connect_opts |= CLIENT_FOUND_ROWS;
|
||||
}
|
||||
|
||||
if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_IGNORE_SPACE, 0 TSRMLS_CC)) {
|
||||
connect_opts |= CLIENT_IGNORE_SPACE;
|
||||
}
|
||||
|
||||
if (mysql_options(H->server, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout)) {
|
||||
pdo_mysql_error(dbh);
|
||||
goto cleanup;
|
||||
|
@ -83,6 +83,8 @@ static PHP_MINIT_FUNCTION(pdo_mysql)
|
||||
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_COMPRESS", (long)PDO_MYSQL_ATTR_COMPRESS);
|
||||
#endif
|
||||
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_DIRECT_QUERY", (long)PDO_MYSQL_ATTR_DIRECT_QUERY);
|
||||
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_FOUND_ROWS", (long)PDO_MYSQL_ATTR_FOUND_ROWS);
|
||||
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_IGNORE_SPACE", (long)PDO_MYSQL_ATTR_IGNORE_SPACE);
|
||||
|
||||
#ifdef PDO_USE_MYSQLND
|
||||
pdo_mysqlnd_zval_cache = mysqlnd_palloc_init_cache(PDO_MYSQL_G(cache_size));
|
||||
|
@ -161,6 +161,8 @@ enum {
|
||||
PDO_MYSQL_ATTR_COMPRESS,
|
||||
#endif
|
||||
PDO_MYSQL_ATTR_DIRECT_QUERY,
|
||||
PDO_MYSQL_ATTR_FOUND_ROWS,
|
||||
PDO_MYSQL_ATTR_IGNORE_SPACE
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -12,6 +12,8 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
|
||||
'MYSQL_ATTR_USE_BUFFERED_QUERY' => true,
|
||||
'MYSQL_ATTR_LOCAL_INFILE' => true,
|
||||
'MYSQL_ATTR_DIRECT_QUERY' => true,
|
||||
'MYSQL_ATTR_FOUND_ROWS' => true,
|
||||
'MYSQL_ATTR_IGNORE_SPACE' => true,
|
||||
);
|
||||
|
||||
if (!MySQLPDOTest::isPDOMySQLnd()) {
|
||||
|
Loading…
Reference in New Issue
Block a user