--TEST-- int mysqli_poll() simple --SKIPIF-- --FILE-- reap_async_query(); } else { $res = mysqli_reap_async_query($mysqli); } if (is_object($res)) { printf("[%03d + 2] Can fetch resultset although no query has been run!\n", $offset); } else if (mysqli_errno($mysqli) > 0) { printf("[%03d + 3] Error indicated through links array: %d/%s", $offset, mysqli_errno($mysqli), mysqli_error($mysqli)); } else { printf("[%03d + 4] Cannot fetch and no error set - non resultset query (no SELECT)!\n", $offset); } } foreach ($errors as $mysqli) printf("[%03d + 5] Error on %d: %d/%s\n", $offset, mysqli_thread_id($mysqli), mysqli_errno($mysqli), mysqli_error($mysqli)); foreach ($reject as $mysqli) printf("[%03d + 6] Rejecting thread %d: %d/%s\n", $offset, mysqli_thread_id($mysqli), mysqli_errno($mysqli), mysqli_error($mysqli)); } // Connections on which no query has been send - 1 $link = get_connection(); $links = array($link); $errors = array($link); $reject = array($link); poll_async(12, $link, $links, $errors, $reject, 0, false); mysqli_close($link); $link = get_connection(); $links = array($link); $errors = array($link); $reject = array($link); poll_async(13, $link, $links, $errors, $reject, 0, true); mysqli_close($link); // Connections on which no query has been send - 2 // Difference: pass $links twice $link = get_connection(); $links = array($link, $link); $errors = array($link, $link); $reject = array(); poll_async(14, $link, $links, $errors, $reject, 0, false); // Connections on which no query has been send - 3 // Difference: pass two connections $link = get_connection(); $links = array($link, get_connection()); $errors = array($link, $link); $reject = array(); poll_async(15, $link, $links, $errors, $reject, 0, false); // Reference mess... $link = get_connection(); $links = array($link); $errors = array($link); $ref_errors =& $errors; $reject = array(); poll_async(16, $link, $links, $ref_errors, $reject, 0, false); print "done!"; ?> --EXPECTF-- Warning: mysqli_poll(): Negative values passed for sec and/or usec in %s on line %d Warning: mysqli_poll(): Negative values passed for sec and/or usec in %s on line %d [012 + 6] Rejecting thread %d: 0/ [013 + 6] Rejecting thread %d: 0/ [014 + 6] Rejecting thread %d: 0/ [014 + 6] Rejecting thread %d: 0/ [015 + 6] Rejecting thread %d: 0/ [015 + 6] Rejecting thread %d: 0/ [016 + 6] Rejecting thread %d: 0/ done!