summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql/mysql_driver.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-03-05 17:17:04 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-03-05 17:17:04 +0000
commitd9b2a3372e7d7955d8ea1ef45ef09ce69ee00c32 (patch)
treec20585c7eec81ddbebd7552975e2d3aa4466dcd9 /ext/pdo_mysql/mysql_driver.c
parent1fad64d6dcda7b977fa2f009bb16d2589e9d0409 (diff)
downloadphp-git-d9b2a3372e7d7955d8ea1ef45ef09ce69ee00c32.tar.gz
Fixed bug #36572 (Added PDO::MYSQL_ATTR_DIRECT_QUERY constant that show be
set when executing internal queries such as "show master status" via MySQL). Added missing constant for MAX_BUFFER_SIZE.
Diffstat (limited to 'ext/pdo_mysql/mysql_driver.c')
-rwxr-xr-xext/pdo_mysql/mysql_driver.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index 3c7b0c5851..5114ca573f 100755
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -160,6 +160,10 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len,
stmt->driver_data = S;
stmt->methods = &mysql_stmt_methods;
+ if (H->emulate_prepare) {
+ goto end;
+ }
+
/* TODO: add runtime check to determine if the server we are talking to supports
* prepared statements; if it doesn't, we should set stmt->supports_placeholders
* to PDO_PLACEHOLDER_NONE, and have the rest of the code look at S->stmt to
@@ -221,6 +225,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len,
fallback:
#endif
+end:
stmt->supports_placeholders = PDO_PLACEHOLDER_NONE;
return 1;
@@ -303,7 +308,9 @@ static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_D
case PDO_MYSQL_ATTR_USE_BUFFERED_QUERY:
((pdo_mysql_db_handle *)dbh->driver_data)->buffered = Z_BVAL_P(val);
return 1;
-
+ case PDO_MYSQL_ATTR_DIRECT_QUERY:
+ ((pdo_mysql_db_handle *)dbh->driver_data)->emulate_prepare = Z_BVAL_P(val);
+ return 1;
default:
return 0;
}