mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: Drop E_STRICT notice in mysqli extension
This commit is contained in:
commit
c072ef71ee
6 changed files with 60 additions and 31 deletions
|
@ -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));
|
||||
}
|
||||
/* }}} */
|
||||
|
|
|
@ -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");
|
||||
|
|
59
ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt
Normal file
59
ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt
Normal file
|
@ -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 ===
|
|
@ -64,14 +64,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!
|
||||
|
|
|
@ -95,7 +95,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);
|
||||
|
@ -111,12 +111,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
|
||||
|
|
|
@ -64,15 +64,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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue