Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PHP-8.2: Add NEWS entry for #9841 Add a temporary fix for insufficient buffer size in mysqlnd (#9835) mysqli_query throws warning despite using silenced error mode (#9842)
- Loading branch information
Showing
3 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--TEST-- | ||
Bug GH-9841 (mysqli_query throws warning despite using silenced error mode) | ||
--EXTENSIONS-- | ||
mysqli | ||
--SKIPIF-- | ||
<?php | ||
require_once 'skipifconnectfailure.inc'; | ||
?> | ||
--FILE-- | ||
<?php | ||
|
||
require_once 'connect.inc'; | ||
|
||
mysqli_report(MYSQLI_REPORT_OFF); | ||
|
||
$mysqli = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket); | ||
|
||
$mysqli->query("SELECT ( | ||
SELECT 1 AS val | ||
UNION ALL | ||
SELECT 2 | ||
) FROM dual"); | ||
|
||
$mysqli->query("SELECT ( | ||
SELECT 1 AS val | ||
UNION ALL | ||
SELECT 2 | ||
) FROM dual", MYSQLI_ASYNC); | ||
$mysqli->reap_async_query(); | ||
|
||
$mysqli->real_query("SELECT ( | ||
SELECT 1 AS val | ||
UNION ALL | ||
SELECT 2 | ||
) FROM dual"); | ||
$result = new mysqli_result($mysqli); | ||
|
||
// now make sure the errors are thrown when not using silent mode | ||
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); | ||
|
||
try { | ||
$mysqli->query("SELECT ( | ||
SELECT 1 AS val | ||
UNION ALL | ||
SELECT 2 | ||
) FROM dual"); | ||
} catch (mysqli_sql_exception $e) { | ||
echo $e->getMessage()."\n"; | ||
} | ||
|
||
$mysqli->query("SELECT ( | ||
SELECT 1 AS val | ||
UNION ALL | ||
SELECT 2 | ||
) FROM dual", MYSQLI_ASYNC); | ||
try { | ||
$mysqli->reap_async_query(); | ||
} catch (mysqli_sql_exception $e) { | ||
echo $e->getMessage()."\n"; | ||
} | ||
|
||
$mysqli->real_query("SELECT ( | ||
SELECT 1 AS val | ||
UNION ALL | ||
SELECT 2 | ||
) FROM dual"); | ||
try { | ||
$result = new mysqli_result($mysqli); | ||
} catch (mysqli_sql_exception $e) { | ||
echo $e->getMessage()."\n"; | ||
} | ||
|
||
print "done!"; | ||
?> | ||
--EXPECTF-- | ||
Subquery returns more than 1 row | ||
Subquery returns more than 1 row | ||
Subquery returns more than 1 row | ||
done! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters