diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-08-06 14:30:41 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-09-03 13:29:30 +0200 |
commit | 41a4379cb45419a376043ca5f8c5a2bca82cea7c (patch) | |
tree | 38229682092ef6422dbcbfb28838c7ffc7d56bf4 | |
parent | 9c3b7ccda5e3737c779e019eb1468213edaa2e39 (diff) | |
download | php-git-41a4379cb45419a376043ca5f8c5a2bca82cea7c.tar.gz |
Fix #41997: SP call yields additional empty result set
When stored procedures are called, the "final result set is a status
result that includes no result set". Calling `::nextRowset()` on the
actual last result set should return FALSE, since there is actually no
further result set to be processed.
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | ext/pdo_mysql/mysql_statement.c | 4 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/bug_39858.phpt | 2 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/bug_41997.phpt | 2 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt | 2 |
5 files changed, 5 insertions, 8 deletions
@@ -18,6 +18,9 @@ PHP NEWS - ODBC: . Fixed bug #78473 (odbc_close() closes arbitrary resources). (cmb) +- PDO_MySQL: + . Fixed bug #41997 (SP call yields additional empty result set). (cmb) + 29 Aug 2019, PHP 7.2.22 - Core: diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index e230cfbf05..950aa64f07 100644 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -425,14 +425,14 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */ pdo_mysql_error_stmt(stmt); PDO_DBG_RETURN(0); } else { - PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt)); + PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt) && stmt->row_count); } #else if (mysql_next_result(H->server) > 0) { pdo_mysql_error_stmt(stmt); PDO_DBG_RETURN(0); } else { - PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt)); + PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt) && stmt->row_count); } #endif } diff --git a/ext/pdo_mysql/tests/bug_39858.phpt b/ext/pdo_mysql/tests/bug_39858.phpt index 896519f8ab..aaf0f3e9f9 100644 --- a/ext/pdo_mysql/tests/bug_39858.phpt +++ b/ext/pdo_mysql/tests/bug_39858.phpt @@ -18,8 +18,6 @@ if ($version < 50000) die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", $matches[0], $matches[1], $matches[2], $version)); ?> ---XFAIL-- -nextRowset() problem with stored proc & emulation mode & mysqlnd --FILE-- <?php require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); diff --git a/ext/pdo_mysql/tests/bug_41997.phpt b/ext/pdo_mysql/tests/bug_41997.phpt index f001eec7d0..69ba9e7c4c 100644 --- a/ext/pdo_mysql/tests/bug_41997.phpt +++ b/ext/pdo_mysql/tests/bug_41997.phpt @@ -1,7 +1,5 @@ --TEST-- PDO MySQL Bug #41997 (stored procedure call returning single rowset blocks future queries) ---XFAIL-- -nextRowset() problem with stored proc & emulation mode & mysqlnd --SKIPIF-- <?php require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc'); diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt index e58d4a6578..94544e2120 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt @@ -1,7 +1,5 @@ --TEST-- MySQL Prepared Statements and different column counts ---XFAIL-- -nextRowset() problem with stored proc & emulation mode & mysqlnd --SKIPIF-- <?php require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc'); |