From e895e962867123aff6ea703ff41670b7eb5c47f1 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Sun, 14 Jul 2019 21:31:21 +0200 Subject: [PATCH] Drop E_STRICT notice in mysqli extension --- ext/mysqli/mysqli_api.c | 12 ---- ext/mysqli/tests/bug31668.phpt | 2 - .../gracefull_fail_on_empty_result_set.phpt | 59 +++++++++++++++++++ ext/mysqli/tests/mysqli_more_results.phpt | 4 -- ext/mysqli/tests/mysqli_multi_query.phpt | 5 +- ext/mysqli/tests/mysqli_next_result.phpt | 9 --- 6 files changed, 60 insertions(+), 31 deletions(-) create mode 100644 ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 96cad0dc5f..ffbb841c19 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1605,12 +1605,6 @@ PHP_FUNCTION(mysqli_next_result) { } MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); - if (!mysql_more_results(mysql->mysql)) { - php_error_docref(NULL, E_STRICT, "There is no next result set. " - "Please, call mysqli_more_results()/mysqli::more_results() to check " - "whether to call this function/method"); - } - RETURN_BOOL(!mysql_next_result(mysql->mysql)); } /* }}} */ @@ -1643,12 +1637,6 @@ PHP_FUNCTION(mysqli_stmt_next_result) { } MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); - if (!mysqlnd_stmt_more_results(stmt->stmt)) { - php_error_docref(NULL, E_STRICT, "There is no next result set. " - "Please, call mysqli_stmt_more_results()/mysqli_stmt::more_results() to check " - "whether to call this function/method"); - } - RETURN_BOOL(!mysql_stmt_next_result(stmt->stmt)); } /* }}} */ diff --git a/ext/mysqli/tests/bug31668.phpt b/ext/mysqli/tests/bug31668.phpt index 9b769a1bae..40bf357b6a 100644 --- a/ext/mysqli/tests/bug31668.phpt +++ b/ext/mysqli/tests/bug31668.phpt @@ -5,8 +5,6 @@ Bug #31668 (multi_query works exactly every other time (multi_query was global, require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); ?> ---INI-- -error_reporting = E_ALL & ~E_STRICT --FILE-- +--FILE-- +multi_query("SELECT 1"); + var_dump($link->next_result()); // should return false + var_dump($link->store_result()); // now what happens here!? + + + // Returns only one result set + $link->multi_query("SELECT 1"); + var_dump($link->next_result()); + var_dump($link->use_result()); + + $link->close(); +?> +=== DONE === +--CLEAN-- + +--EXPECT-- +bool(false) +object(mysqli_result)#3 (5) { + ["current_field"]=> + int(0) + ["field_count"]=> + int(1) + ["lengths"]=> + NULL + ["num_rows"]=> + int(1) + ["type"]=> + int(0) +} +bool(false) +object(mysqli_result)#3 (5) { + ["current_field"]=> + int(0) + ["field_count"]=> + int(1) + ["lengths"]=> + NULL + ["num_rows"]=> + int(0) + ["type"]=> + int(1) +} +=== DONE === diff --git a/ext/mysqli/tests/mysqli_more_results.phpt b/ext/mysqli/tests/mysqli_more_results.phpt index 4ce6a19c79..7f0a1f748b 100644 --- a/ext/mysqli/tests/mysqli_more_results.phpt +++ b/ext/mysqli/tests/mysqli_more_results.phpt @@ -73,14 +73,10 @@ bool(false) [006] 1 2 - -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d [010] 1 2 -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d - Warning: mysqli_more_results(): Couldn't fetch mysqli in %s on line %d bool(false) done! diff --git a/ext/mysqli/tests/mysqli_multi_query.phpt b/ext/mysqli/tests/mysqli_multi_query.phpt index 28898b1dcb..05f564313d 100644 --- a/ext/mysqli/tests/mysqli_multi_query.phpt +++ b/ext/mysqli/tests/mysqli_multi_query.phpt @@ -104,7 +104,7 @@ require_once('skipifconnectfailure.inc'); mysqli_free_result($res); - } while (@mysqli_next_result($link)); + } while (mysqli_next_result($link)); if ($res_num != 4) printf("[015] Expecting 3 result sets got %d result set[s]\n", $res_num); @@ -120,12 +120,9 @@ require_once('skipifconnectfailure.inc'); require_once("clean_table.inc"); ?> --EXPECTF-- -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d [006] 3 [008] 0 [009] [2014] Commands out of sync; you can't run this command now - -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d [010] 7 Warning: mysqli_multi_query(): Couldn't fetch mysqli in %s on line %d diff --git a/ext/mysqli/tests/mysqli_next_result.phpt b/ext/mysqli/tests/mysqli_next_result.phpt index e01f507c20..6760cbbadc 100644 --- a/ext/mysqli/tests/mysqli_next_result.phpt +++ b/ext/mysqli/tests/mysqli_next_result.phpt @@ -73,15 +73,6 @@ require_once('skipifconnectfailure.inc'); require_once("clean_table.inc"); ?> --EXPECTF-- -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d - -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d - -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d - -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d - -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d Warning: mysqli_next_result(): Couldn't fetch mysqli in %s on line %d bool(false) -- 2.40.0