Skip to content

Commit 50c7512

Browse files
mysqli_result::__construct should throw exceptions (#7855)
1 parent f2b5015 commit 50c7512

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/mysqli/mysqli.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,12 @@ PHP_METHOD(mysqli_result, __construct)
980980
}
981981

982982
if (!result) {
983+
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
983984
RETURN_FALSE;
984985
}
986+
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
987+
php_mysqli_report_index("from previous query", mysqli_server_status(mysql->mysql));
988+
}
985989

986990
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
987991
mysqli_resource->ptr = (void *)result;

0 commit comments

Comments
 (0)