1--TEST--
2mysqli_reap_async_query() error reporting
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8?>
9--FILE--
10<?php
11require_once 'connect.inc';
12
13mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
14$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
15
16$link->query(')', MYSQLI_ASYNC | MYSQLI_USE_RESULT);
17$reads = $errors = $rejects = [$link];
18mysqli::poll($reads, $errors, $rejects, 1);
19$link = $reads[0];
20
21try {
22    $rs = $link->reap_async_query();
23} catch (mysqli_sql_exception $exception) {
24    echo $exception->getMessage() . "\n";
25}
26
27print "done!";
28?>
29--EXPECTF--
30You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near ')' at line 1
31done!
32