cvs: php-src(PHP_5_2) /ext/pdo_mysql mysql_driver.c

From: Date: Sun, 03 Dec 2006 23:29:03 +0000
Subject: cvs: php-src(PHP_5_2) /ext/pdo_mysql mysql_driver.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-41855@lists.php.net to get a copy of this message
iliaa Sun Dec 3 23:29:03 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/pdo_mysql mysql_driver.c Log: Default to buffered queries (much faster) Default to prepared statement emulation to avoid hitting MySQL bugs http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/mysql_driver.c?r1=1.59.2.13.2.1&r2=1.59.2.13.2.2&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.1 php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.13.2.2 --- php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.13.2.1 Mon Oct 2 22:09:49 2006 +++ php-src/ext/pdo_mysql/mysql_driver.c Sun Dec 3 23:29:03 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mysql_driver.c,v 1.59.2.13.2.1 2006/10/02 22:09:49 tony2001 Exp $ */ +/* $Id: mysql_driver.c,v 1.59.2.13.2.2 2006/12/03 23:29:03 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -461,19 +461,8 @@ H->einfo.errcode = 0; H->einfo.errmsg = NULL; - /* at the time of writing, the mysql documentation states: - * http://mysql.localhost.net.ar/doc/refman/5.0/en/query-cache-how.html - * "A query also is not cached under these conditions: - * ... - * It was issued as a prepared statement, even if no placeholders were employed." - * - * We default to emulating prepared statements - * in order to take advantage of the query cache -FIXME: H->emulate_prepare = 1; a bit risky to do this so late in the RC, so defer it. - */ - /* allocate an environment */ - + /* handle for the server */ if (!(H->server = mysql_init(NULL))) { pdo_mysql_error(dbh); @@ -482,6 +471,7 @@ dbh->driver_data = H; H->max_buffer_size = 1024*1024; + H->emulate_prepare = 1; /* handle MySQL options */ if (driver_options) { @@ -489,7 +479,7 @@ long local_infile = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0 TSRMLS_CC); char *init_cmd = NULL, *default_file = NULL, *default_group = NULL; - H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 0 TSRMLS_CC); + H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 1 TSRMLS_CC); H->emulate_prepare = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_DIRECT_QUERY, H->emulate_prepare TSRMLS_CC);

« previous php.cvs (#41855) next »