MFH: Fix #44135 (PDO MySQL does not support CLIENT_FOUND_ROWS)

This commit is contained in:
Johannes Schlüter 2008-10-27 18:32:08 +00:00
parent 806ea848f4
commit 40e42663f5
5 changed files with 16 additions and 0 deletions

2
NEWS
View File

@ -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)

View File

@ -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;

View File

@ -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));

View File

@ -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

View File

@ -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()) {