johannes                Mon Oct 27 18:29:57 2008 UTC

  Modified files:              
    /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:
  Fix #44135 (PDO MySQL does not support CLIENT_FOUND_ROWS)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/mysql_driver.c?r1=1.83&r2=1.84&diff_format=u
Index: php-src/ext/pdo_mysql/mysql_driver.c
diff -u php-src/ext/pdo_mysql/mysql_driver.c:1.83 
php-src/ext/pdo_mysql/mysql_driver.c:1.84
--- php-src/ext/pdo_mysql/mysql_driver.c:1.83   Tue Oct 14 19:00:11 2008
+++ php-src/ext/pdo_mysql/mysql_driver.c        Mon Oct 27 18:29:56 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysql_driver.c,v 1.83 2008/10/14 19:00:11 johannes Exp $ */
+/* $Id: mysql_driver.c,v 1.84 2008/10/27 18:29:56 johannes Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -636,6 +636,14 @@
                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;
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/pdo_mysql.c?r1=1.22&r2=1.23&diff_format=u
Index: php-src/ext/pdo_mysql/pdo_mysql.c
diff -u php-src/ext/pdo_mysql/pdo_mysql.c:1.22 
php-src/ext/pdo_mysql/pdo_mysql.c:1.23
--- php-src/ext/pdo_mysql/pdo_mysql.c:1.22      Tue Oct 14 19:00:11 2008
+++ php-src/ext/pdo_mysql/pdo_mysql.c   Mon Oct 27 18:29:56 2008
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_mysql.c,v 1.22 2008/10/14 19:00:11 johannes Exp $ */
+/* $Id: pdo_mysql.c,v 1.23 2008/10/27 18:29:56 johannes Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -83,6 +83,8 @@
        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));
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/php_pdo_mysql_int.h?r1=1.25&r2=1.26&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.25 
php-src/ext/pdo_mysql/php_pdo_mysql_int.h:1.26
--- php-src/ext/pdo_mysql/php_pdo_mysql_int.h:1.25      Tue Oct 14 19:00:11 2008
+++ php-src/ext/pdo_mysql/php_pdo_mysql_int.h   Mon Oct 27 18:29:56 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_pdo_mysql_int.h,v 1.25 2008/10/14 19:00:11 johannes Exp $ */
+/* $Id: php_pdo_mysql_int.h,v 1.26 2008/10/27 18:29:56 johannes Exp $ */
 
 #ifndef PHP_PDO_MYSQL_INT_H
 #define PHP_PDO_MYSQL_INT_H
@@ -161,6 +161,8 @@
        PDO_MYSQL_ATTR_COMPRESS,
 #endif
        PDO_MYSQL_ATTR_DIRECT_QUERY,
+       PDO_MYSQL_ATTR_FOUND_ROWS,
+       PDO_MYSQL_ATTR_IGNORE_SPACE
 };
 
 #endif
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt?r1=1.2&r2=1.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.2 
php-src/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt:1.3
--- php-src/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt:1.2      Tue Oct 
14 19:00:11 2008
+++ php-src/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt  Mon Oct 27 
18:29:57 2008
@@ -12,6 +12,8 @@
                '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()) {



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

Reply via email to