]> granicus.if.org Git - php/commitdiff
Fix bug #61194 PDO should export compression flag with myslqnd
authorJohannes Schlüter <johannes@php.net>
Mon, 5 Mar 2012 23:57:24 +0000 (23:57 +0000)
committerJohannes Schlüter <johannes@php.net>
Mon, 5 Mar 2012 23:57:24 +0000 (23:57 +0000)
NEWS
ext/pdo_mysql/mysql_driver.c
ext/pdo_mysql/pdo_mysql.c
ext/pdo_mysql/php_pdo_mysql_int.h
ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt

diff --git a/NEWS b/NEWS
index 224c0db2bcbffceae2b3a61a53dac6db2635057e..11ad4f6308dc4ad9ce6d0b25da5c2b193c47aae2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,12 @@ PHP                                                                        NEWS
 - Firebird Database extension (ibase):
   . Fixed bug #60802 (ibase_trans() gives segfault when passing params).
 
+- PDO_mysql
+  . Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't
+    always work). (Johannes)
+  . Fixed bug #61194 (PDO should export compression flag with myslqnd).
+    (Johannes)
+
 - Phar:
   . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL bytes). (Nikic)
 
index fa55b6b0863719d9d1929659a0f5b392346f2bf5..727357a03a47983944f341aa7f2629aa4239c426 100755 (executable)
@@ -624,8 +624,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;
 #if defined(HAVE_MYSQL_STMT_PREPARE) || defined(PDO_USE_MYSQLND)
                char *ssl_key = NULL, *ssl_cert = NULL, *ssl_ca = NULL, *ssl_capath = NULL, *ssl_cipher = NULL;
 #endif
@@ -706,7 +706,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)) {
@@ -714,7 +714,6 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
                                goto cleanup;
                        }
                }
-#endif
 #if defined(HAVE_MYSQL_STMT_PREPARE) || defined(PDO_USE_MYSQLND)
                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);
index e6c39a78a8262ef734ca9dcfd05931a3b42507b9..36bbf9d6e497551ea581a7dd0b3b291c614d5adf 100755 (executable)
@@ -84,8 +84,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);
index a65a018ce6d170859521564f594b1d06d38ad687..f8caa9f6ebfe77d72820d82412e744b80fe48c36 100755 (executable)
@@ -163,8 +163,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,
index e99385799f8caf47a5dd3da7d05f13d619840154..17fa5d6059353e27db6cfc6b976a79aaa2d74ba2 100644 (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;
        }
 
        /*