diff options
Diffstat (limited to 'ext/pdo_mysql')
| -rwxr-xr-x | ext/pdo_mysql/mysql_driver.c | 2 | ||||
| -rwxr-xr-x | ext/pdo_mysql/mysql_statement.c | 10 | ||||
| -rw-r--r-- | ext/pdo_mysql/tests/pecl_bug_5780.phpt | 8 |
3 files changed, 9 insertions, 11 deletions
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 01a9b19fa6..53a9fb76e3 100755 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -471,7 +471,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ dbh->driver_data = H; H->max_buffer_size = 1024*1024; - H->emulate_prepare = 1; + H->buffered = H->emulate_prepare = 1; /* handle MySQL options */ if (driver_options) { diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index 856b23286c..8605bad9c0 100755 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -273,15 +273,15 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* No more results */ return 0; } else { - if ((my_ulonglong)-1 == (row_count = mysql_affected_rows(H->server))) { - pdo_mysql_error_stmt(stmt); - return 0; - } - if (!H->buffered) { S->result = mysql_use_result(H->server); + row_count = 0; } else { S->result = mysql_store_result(H->server); + if ((my_ulonglong)-1 == (row_count = mysql_affected_rows(H->server))) { + pdo_mysql_error_stmt(stmt); + return 0; + } } if (NULL == S->result) { diff --git a/ext/pdo_mysql/tests/pecl_bug_5780.phpt b/ext/pdo_mysql/tests/pecl_bug_5780.phpt index ef94db13cc..e6b79a1daa 100644 --- a/ext/pdo_mysql/tests/pecl_bug_5780.phpt +++ b/ext/pdo_mysql/tests/pecl_bug_5780.phpt @@ -33,10 +33,8 @@ array(2) { [1]=> string(7) "testing" } -bool(false) -array(2) { +bool(true) +array(1) { [0]=> - string(5) "HY000" - [1]=> - int(2014) + string(5) "00000" } |
