Fix bug #61194 PDO should export compression flag with myslqnd

This commit is contained in:
Johannes Schlüter 2012-03-05 23:57:24 +00:00
parent 4c4a33e706
commit 048f1fa092
4 changed files with 6 additions and 6 deletions

View File

@ -596,8 +596,8 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
char *init_cmd = NULL;
#ifndef PDO_USE_MYSQLND
char *default_file = NULL, *default_group = NULL;
long compress = 0;
#endif
long compress = 0;
char *ssl_key = NULL, *ssl_cert = NULL, *ssl_ca = NULL, *ssl_capath = NULL, *ssl_cipher = NULL;
H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 1 TSRMLS_CC);
@ -676,7 +676,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
efree(default_group);
}
#endif
compress = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_COMPRESS, 0 TSRMLS_CC);
if (compress) {
if (mysql_options(H->server, MYSQL_OPT_COMPRESS, 0)) {
@ -684,7 +684,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
goto cleanup;
}
}
#endif
ssl_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_KEY, NULL TSRMLS_CC);
ssl_cert = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CERT, NULL TSRMLS_CC);
ssl_ca = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CA, NULL TSRMLS_CC);

View File

@ -108,8 +108,8 @@ static PHP_MINIT_FUNCTION(pdo_mysql)
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_MAX_BUFFER_SIZE", (long)PDO_MYSQL_ATTR_MAX_BUFFER_SIZE);
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_READ_DEFAULT_FILE", (long)PDO_MYSQL_ATTR_READ_DEFAULT_FILE);
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_READ_DEFAULT_GROUP", (long)PDO_MYSQL_ATTR_READ_DEFAULT_GROUP);
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_COMPRESS", (long)PDO_MYSQL_ATTR_COMPRESS);
#endif
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_COMPRESS", (long)PDO_MYSQL_ATTR_COMPRESS);
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);

View File

@ -161,8 +161,8 @@ enum {
PDO_MYSQL_ATTR_READ_DEFAULT_FILE,
PDO_MYSQL_ATTR_READ_DEFAULT_GROUP,
PDO_MYSQL_ATTR_MAX_BUFFER_SIZE,
PDO_MYSQL_ATTR_COMPRESS,
#endif
PDO_MYSQL_ATTR_COMPRESS,
PDO_MYSQL_ATTR_DIRECT_QUERY,
PDO_MYSQL_ATTR_FOUND_ROWS,
PDO_MYSQL_ATTR_IGNORE_SPACE,

View File

@ -20,13 +20,13 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
"MYSQL_ATTR_SSL_CA" => true,
"MYSQL_ATTR_SSL_CAPATH" => true,
"MYSQL_ATTR_SSL_CIPHER" => true,
"MYSQL_ATTR_COMPRESS" => true,
);
if (!MySQLPDOTest::isPDOMySQLnd()) {
$expected['MYSQL_ATTR_MAX_BUFFER_SIZE'] = true;
$expected['MYSQL_ATTR_READ_DEFAULT_FILE'] = true;
$expected['MYSQL_ATTR_READ_DEFAULT_GROUP'] = true;
$expected['MYSQL_ATTR_COMPRESS'] = true;
}
/*