com php-src: Drop E_STRICT notice in mysqli extension : ext/mysqli/mysqli_api.c ext/mysqli/tests/bug31 668.phpt ext/mysqli/tests/gracefull_fail_on_emp
ty_result_set.phpt ext/mysqli/tests/mysqli_more_res ults.phpt ext/mysqli/tests/mysqli_multi_query.phpt ext/mysqli/tests/mysqli_next_result.phpt
| From: | George Peter Banyard | Date: | Sat, 31 Aug 2019 21:14:10 +0000 |
| Subject: | com php-src: Drop E_STRICT notice in mysqli extension : ext/mysqli/mysqli_api.c ext/mysqli/tests/bug31 668.phpt ext/mysqli/tests/gracefull_fail_on_emp ty_result_set.phpt ext/mysqli/tests/mysqli_more_res ults.phpt ext/mysqli/tests/mysqli_multi_query.phpt ext/mysqli/tests/mysqli_next_result.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-108168@lists.php.net to get a copy of this message | ||
Commit: e895e962867123aff6ea703ff41670b7eb5c47f1
Author: George Peter Banyard <girgias@php.net> Sun, 14 Jul 2019 21:31:21 +0200
Parents: 77a0fa101ed59f05ea07b03adb1cb66962fc45e7
Branches: PHP-7.4
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e895e962867123aff6ea703ff41670b7eb5c47f1
Log:
Drop E_STRICT notice in mysqli extension
Changed paths:
M ext/mysqli/mysqli_api.c
M ext/mysqli/tests/bug31668.phpt
A ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt
M ext/mysqli/tests/mysqli_more_results.phpt
M ext/mysqli/tests/mysqli_multi_query.phpt
M ext/mysqli/tests/mysqli_next_result.phpt
Diff:
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 96cad0d..ffbb841 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 9b769a1..40bf357 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--
<?php
require_once("connect.inc");
diff --git a/ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt
b/ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt
new file mode 100644
index 0000000..e37e228
--- /dev/null
+++ b/ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt
@@ -0,0 +1,59 @@
+--TEST--
+Fail gracefully on empty result set
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifemb.inc');
+require_once('skipifconnectfailure.inc');
+?>
+--FILE--
+<?php
+ require_once("connect.inc");
+ require('table.inc');
+
+ // Returns only one result set
+ $link->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--
+<?php
+ require_once("clean_table.inc");
+?>
+--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 4ce6a19..7f0a1f7 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 28898b1..05f5643 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 e01f507..6760cbb 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)