????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 18.117.249.37 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/mysqli/tests/ |
Upload File : |
--TEST-- mysqli_reap_async_query() --SKIPIF-- <?php require_once('skipif.inc'); require_once('skipifemb.inc'); require_once('connect.inc'); require_once('skipifconnectfailure.inc'); if (!$IS_MYSQLND) die("skip mysqlnd only feature, compile PHP using --with-mysqli=mysqlnd"); ?> --FILE-- <?php require_once('connect.inc'); function get_connection() { global $host, $user, $passwd, $db, $port, $socket; if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); return $link; } if (!$link = get_connection()) printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (NULL !== ($tmp = @mysqli_reap_async_query())) printf("[002] Expecting NULL got %s\n", var_export($tmp, true)); $l = array($link); if (NULL !== ($tmp = @mysqli_reap_async_query($l))) printf("[003] Expecting NULL got %s\n", var_export($tmp, true)); if (NULL !== ($tmp = @mysqli_reap_async_query($link, $link))) printf("[004] Expecting NULL got %s\n", var_export($tmp, true)); function poll_async($offset, $link, $links, $errors, $reject, $exp_ready, $use_oo_syntax) { if ($exp_ready !== ($tmp = mysqli_poll($links, $errors, $reject, 0, 1000))) printf("[%03d + 1] There should be %d links ready to read from, %d ready\n", $offset, $exp_ready, $tmp); foreach ($links as $mysqli) { if ($use_oo_syntax) { $res = $mysqli->reap_async_query(); } else { $res = mysqli_reap_async_query($mysqli); } if (is_object($res)) { printf("[%03d + 2] %s\n", $offset, var_export($res->fetch_assoc(), true)); } 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(); $link->query("SELECT 1 AS _one", MYSQLI_ASYNC | MYSQLI_STORE_RESULT); $links = array($link); $errors = array($link); $reject = array($link); poll_async(12, $link, $links, $errors, $reject, 1, false); mysqli_close($link); $link = get_connection(); $link->query("SELECT 2 AS _two", MYSQLI_ASYNC | MYSQLI_USE_RESULT); $links = array($link); $errors = array($link); $reject = array($link); poll_async(13, $link, $links, $errors, $reject, 1, true); mysqli_close($link); print "done!"; ?> --EXPECTF-- [012 + 2] array ( '_one' => '1', ) [013 + 2] array ( '_two' => '2', ) done!