johannes                Tue Oct 14 19:00:53 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/pdo_mysql      mysql_driver.c pdo_mysql.c 
                                php_pdo_mysql_int.h 
    /php-src/ext/pdo_mysql/tests        pdo_mysql_class_constants.phpt 
  Log:
  MFH: Add PDO::MYSQL_ATTR_COMPRESS connection flag [DOC]
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/mysql_driver.c?r1=1.59.2.13.2.5.2.4&r2=1.59.2.13.2.5.2.5&diff_format=u
Index: php-src/ext/pdo_mysql/mysql_driver.c
diff -u php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.13.2.5.2.4 
php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.13.2.5.2.5
--- php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.13.2.5.2.4      Sun Aug  3 
12:15:47 2008
+++ php-src/ext/pdo_mysql/mysql_driver.c        Tue Oct 14 19:00:53 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysql_driver.c,v 1.59.2.13.2.5.2.4 2008/08/03 12:15:47 jani Exp $ */
+/* $Id: mysql_driver.c,v 1.59.2.13.2.5.2.5 2008/10/14 19:00:53 johannes Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -623,6 +623,7 @@
                long local_infile = pdo_attr_lval(driver_options, 
PDO_MYSQL_ATTR_LOCAL_INFILE, 0 TSRMLS_CC);
 #ifndef PDO_USE_MYSQLND
                char *init_cmd = NULL, *default_file = NULL, *default_group = 
NULL;
+               long compress = 0;
 #endif
                H->buffered = pdo_attr_lval(driver_options, 
PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 1 TSRMLS_CC);
 
@@ -692,6 +693,14 @@
                        }
                        efree(default_group);
                }
+
+               compress = pdo_attr_lval(driver_options, 
PDO_MYSQL_ATTR_COMPRESS, 0 TSRMLS_CC);
+               if (compress) {
+                       if (mysql_options(H->server, MYSQL_OPT_COMPRESS, 0)) {
+                               pdo_mysql_error(dbh);
+                               goto cleanup;
+                       }
+               }
 #endif
        }
 
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/pdo_mysql.c?r1=1.8.2.13.2.1.2.5&r2=1.8.2.13.2.1.2.6&diff_format=u
Index: php-src/ext/pdo_mysql/pdo_mysql.c
diff -u php-src/ext/pdo_mysql/pdo_mysql.c:1.8.2.13.2.1.2.5 
php-src/ext/pdo_mysql/pdo_mysql.c:1.8.2.13.2.1.2.6
--- php-src/ext/pdo_mysql/pdo_mysql.c:1.8.2.13.2.1.2.5  Mon Sep 29 21:20:50 2008
+++ php-src/ext/pdo_mysql/pdo_mysql.c   Tue Oct 14 19:00:53 2008
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_mysql.c,v 1.8.2.13.2.1.2.5 2008/09/29 21:20:50 johannes Exp $ */
+/* $Id: pdo_mysql.c,v 1.8.2.13.2.1.2.6 2008/10/14 19:00:53 johannes Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -80,6 +80,7 @@
        REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_INIT_COMMAND", 
(long)PDO_MYSQL_ATTR_INIT_COMMAND);
        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_DIRECT_QUERY", 
(long)PDO_MYSQL_ATTR_DIRECT_QUERY);
 
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/php_pdo_mysql_int.h?r1=1.16.2.4.2.1.2.3&r2=1.16.2.4.2.1.2.4&diff_format=u
Index: php-src/ext/pdo_mysql/php_pdo_mysql_int.h
diff -u php-src/ext/pdo_mysql/php_pdo_mysql_int.h:1.16.2.4.2.1.2.3 
php-src/ext/pdo_mysql/php_pdo_mysql_int.h:1.16.2.4.2.1.2.4
--- php-src/ext/pdo_mysql/php_pdo_mysql_int.h:1.16.2.4.2.1.2.3  Mon Jul 21 
13:09:27 2008
+++ php-src/ext/pdo_mysql/php_pdo_mysql_int.h   Tue Oct 14 19:00:53 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_pdo_mysql_int.h,v 1.16.2.4.2.1.2.3 2008/07/21 13:09:27 johannes 
Exp $ */
+/* $Id: php_pdo_mysql_int.h,v 1.16.2.4.2.1.2.4 2008/10/14 19:00:53 johannes 
Exp $ */
 
 #ifndef PHP_PDO_MYSQL_INT_H
 #define PHP_PDO_MYSQL_INT_H
@@ -158,6 +158,7 @@
        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_DIRECT_QUERY,
 };
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
diff -u php-src/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt:1.1.2.2 
php-src/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt:1.1.2.3
--- php-src/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt:1.1.2.2  Mon Jul 
21 13:09:28 2008
+++ php-src/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt  Tue Oct 14 
19:00:53 2008
@@ -19,7 +19,7 @@
                $expected['MYSQL_ATTR_INIT_COMMAND']                            
= true;
                $expected['MYSQL_ATTR_READ_DEFAULT_FILE']       = true;
                $expected['MYSQL_ATTR_READ_DEFAULT_GROUP']      = true;
-
+               $expected['MYSQL_ATTR_COMPRESS']                        = true;
        }
 
        /*
@@ -75,4 +75,4 @@
 
        print "done!";
 --EXPECT--
-done!
\ No newline at end of file
+done!



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to