????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.144.176.149 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_change_user() - table locks, GET_LOCK(), temporary tables --SKIPIF-- <?php require_once('skipif.inc'); require_once('skipifemb.inc'); require_once('skipifconnectfailure.inc'); die("skip - is the server still buggy?"); ?> --FILE-- <?php require_once('connect.inc'); require_once('table.inc'); if (!$link2 = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[001] Cannot create second connection handle, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, 'LOCK TABLE test WRITE')) printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); /* if ($res = mysqli_query($link2, 'SELECT COUNT(*) AS _num FROM test')) { printf("[003] Reading from test should not be possible due to a lock, [%d] %s\n", mysqli_errno($link2), mysqli_error($link2)); mysqli_free_result($res); } */ // LOCKS should be removed mysqli_change_user($link, $user, $passwd, $db); if (!$res = mysqli_query($link2, 'SELECT COUNT(*) AS _num FROM test')) printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!$row = mysqli_fetch_assoc($res)) printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if ($row['_num'] < 1) printf("[005] There should be some rows in the table test\n"); mysqli_free_result($res); mysqli_close($link2); if (!mysqli_query($link, 'DROP TABLE test')) printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!mysqli_query($link, 'CREATE TEMPORARY TABLE test(id INT)')) printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!mysqli_query($link, 'INSERT INTO test(id) VALUES (1), (2), (3)')) printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!$res = mysqli_query($link, 'SELECT COUNT(*) AS _num FROM test')) printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!$row = mysqli_fetch_assoc($res)) printf("[010] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if ($row['_num'] != 3) printf("[011] There should be three rows in the table test\n"); mysqli_free_result($res); // Temporary tables should be dropped mysqli_change_user($link, $user, $passwd, $db); if ($res = mysqli_query($link, 'SELECT COUNT(*) AS _num FROM test')) { printf("[012] There should be no table test any more, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_free_result($res); } if (!$res = mysqli_query($link, 'SELECT GET_LOCK("phptest", 2) AS _ok')) printf("[013] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!$row = mysqli_fetch_assoc($res)) printf("[014] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if ($row['_ok'] != 1) printf("[015] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_free_result($res); // GET_LOCK("phptest") should be released mysqli_change_user($link, $user, $passwd, $db); if (!$res = mysqli_query($link, 'SELECT IS_FREE_LOCK("phptest") AS _ok')) printf("[016] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!$row = mysqli_fetch_assoc($res)) printf("[017] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if ($row['_ok'] != 1) printf("[018] Lock 'phptest' should have been released, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_free_result($res); mysqli_close($link); print "done!"; ?> --CLEAN-- <?php require_once("clean_table.inc"); ?> --EXPECTF-- done!