Skip to content

Commit e895e96

Browse files
committed
Drop E_STRICT notice in mysqli extension
1 parent 77a0fa1 commit e895e96

File tree

6 files changed

+60
-31
lines changed

6 files changed

+60
-31
lines changed

ext/mysqli/mysqli_api.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,12 +1605,6 @@ PHP_FUNCTION(mysqli_next_result) {
16051605
}
16061606
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
16071607

1608-
if (!mysql_more_results(mysql->mysql)) {
1609-
php_error_docref(NULL, E_STRICT, "There is no next result set. "
1610-
"Please, call mysqli_more_results()/mysqli::more_results() to check "
1611-
"whether to call this function/method");
1612-
}
1613-
16141608
RETURN_BOOL(!mysql_next_result(mysql->mysql));
16151609
}
16161610
/* }}} */
@@ -1643,12 +1637,6 @@ PHP_FUNCTION(mysqli_stmt_next_result) {
16431637
}
16441638
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
16451639

1646-
if (!mysqlnd_stmt_more_results(stmt->stmt)) {
1647-
php_error_docref(NULL, E_STRICT, "There is no next result set. "
1648-
"Please, call mysqli_stmt_more_results()/mysqli_stmt::more_results() to check "
1649-
"whether to call this function/method");
1650-
}
1651-
16521640
RETURN_BOOL(!mysql_stmt_next_result(stmt->stmt));
16531641
}
16541642
/* }}} */

ext/mysqli/tests/bug31668.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ Bug #31668 (multi_query works exactly every other time (multi_query was global,
55
require_once('skipif.inc');
66
require_once('skipifconnectfailure.inc');
77
?>
8-
--INI--
9-
error_reporting = E_ALL & ~E_STRICT
108
--FILE--
119
<?php
1210
require_once("connect.inc");
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
--TEST--
2+
Fail gracefully on empty result set
3+
--SKIPIF--
4+
<?php
5+
require_once('skipif.inc');
6+
require_once('skipifemb.inc');
7+
require_once('skipifconnectfailure.inc');
8+
?>
9+
--FILE--
10+
<?php
11+
require_once("connect.inc");
12+
require('table.inc');
13+
14+
// Returns only one result set
15+
$link->multi_query("SELECT 1");
16+
var_dump($link->next_result()); // should return false
17+
var_dump($link->store_result()); // now what happens here!?
18+
19+
20+
// Returns only one result set
21+
$link->multi_query("SELECT 1");
22+
var_dump($link->next_result());
23+
var_dump($link->use_result());
24+
25+
$link->close();
26+
?>
27+
=== DONE ===
28+
--CLEAN--
29+
<?php
30+
require_once("clean_table.inc");
31+
?>
32+
--EXPECT--
33+
bool(false)
34+
object(mysqli_result)#3 (5) {
35+
["current_field"]=>
36+
int(0)
37+
["field_count"]=>
38+
int(1)
39+
["lengths"]=>
40+
NULL
41+
["num_rows"]=>
42+
int(1)
43+
["type"]=>
44+
int(0)
45+
}
46+
bool(false)
47+
object(mysqli_result)#3 (5) {
48+
["current_field"]=>
49+
int(0)
50+
["field_count"]=>
51+
int(1)
52+
["lengths"]=>
53+
NULL
54+
["num_rows"]=>
55+
int(0)
56+
["type"]=>
57+
int(1)
58+
}
59+
=== DONE ===

ext/mysqli/tests/mysqli_more_results.phpt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,10 @@ bool(false)
7373
[006]
7474
1
7575
2
76-
77-
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
7876
[010]
7977
1
8078
2
8179

82-
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
83-
8480
Warning: mysqli_more_results(): Couldn't fetch mysqli in %s on line %d
8581
bool(false)
8682
done!

ext/mysqli/tests/mysqli_multi_query.phpt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ require_once('skipifconnectfailure.inc');
104104

105105
mysqli_free_result($res);
106106

107-
} while (@mysqli_next_result($link));
107+
} while (mysqli_next_result($link));
108108

109109
if ($res_num != 4)
110110
printf("[015] Expecting 3 result sets got %d result set[s]\n", $res_num);
@@ -120,12 +120,9 @@ require_once('skipifconnectfailure.inc');
120120
require_once("clean_table.inc");
121121
?>
122122
--EXPECTF--
123-
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
124123
[006] 3
125124
[008] 0
126125
[009] [2014] Commands out of sync; you can't run this command now
127-
128-
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
129126
[010] 7
130127

131128
Warning: mysqli_multi_query(): Couldn't fetch mysqli in %s on line %d

ext/mysqli/tests/mysqli_next_result.phpt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,6 @@ require_once('skipifconnectfailure.inc');
7373
require_once("clean_table.inc");
7474
?>
7575
--EXPECTF--
76-
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
77-
78-
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
79-
80-
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
81-
82-
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
83-
84-
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
8576

8677
Warning: mysqli_next_result(): Couldn't fetch mysqli in %s on line %d
8778
bool(false)

0 commit comments

Comments
 (0)