diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-02-20 22:25:42 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-02-20 22:25:42 +0300 |
commit | 71d41ca6bb3a9d888b39f34a30f994ac1cf88873 (patch) | |
tree | 3a11365b77b332c078440204fb82549d34237a35 /ext/pdo_mysql/mysql_driver.c | |
parent | 2d50280dd013556e51b6f275ca965fe7b530029b (diff) | |
parent | 1ceec3a053647865493ab417d3ce401b9bc42450 (diff) | |
download | php-71d41ca6bb3a9d888b39f34a30f994ac1cf88873.tar.gz |
Merge branch 'master-5.6' of git://anonscm.debian.org/pkg-php/php
Conflicts:
debian/changelog
debian/patches/series
Diffstat (limited to 'ext/pdo_mysql/mysql_driver.c')
-rw-r--r-- | ext/pdo_mysql/mysql_driver.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 581766b38..f19875310 100644 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -458,6 +458,7 @@ static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value ZVAL_LONG(return_value, H->buffered); break; + case PDO_ATTR_EMULATE_PREPARES: case PDO_MYSQL_ATTR_DIRECT_QUERY: ZVAL_LONG(return_value, H->emulate_prepare); break; @@ -551,15 +552,20 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ #ifdef CLIENT_MULTI_RESULTS |CLIENT_MULTI_RESULTS #endif -#ifdef CLIENT_MULTI_STATEMENTS - |CLIENT_MULTI_STATEMENTS -#endif ; - #if defined(PDO_USE_MYSQLND) int dbname_len = 0; int password_len = 0; #endif + +#ifdef CLIENT_MULTI_STATEMENTS + if (!driver_options) { + connect_opts |= CLIENT_MULTI_STATEMENTS; + } else if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MULTI_STATEMENTS, 1 TSRMLS_CC)) { + connect_opts |= CLIENT_MULTI_STATEMENTS; + } +#endif + PDO_DBG_ENTER("pdo_mysql_handle_factory"); PDO_DBG_INF_FMT("dbh=%p", dbh); #ifdef CLIENT_MULTI_RESULTS @@ -737,9 +743,14 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ if(vars[3].optval) { port = atoi(vars[3].optval); } - if (vars[2].optval && !strcmp("localhost", vars[2].optval)) { - unix_socket = vars[4].optval; - } + +#ifdef PHP_WIN32 + if (vars[2].optval && !strcmp(".", vars[2].optval)) { +#else + if (vars[2].optval && !strcmp("localhost", vars[2].optval)) { +#endif + unix_socket = vars[4].optval; + } /* TODO: - Check zval cache + ZTS */ #ifdef PDO_USE_MYSQLND |