Lines Matching refs:link
15 if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
18 if (mysqli_get_server_version($link) < 50606)
21 if (!($res = $link->query("SHOW PLUGINS"))) {
22 die(sprintf("skip [%d] %s\n", $link->errno, $link->error));
35 if (!($res = $link->query("SHOW STATUS LIKE 'Rsa_public_key'"))) {
36 die(sprintf("skip [%d] %s\n", $link->errno, $link->error));
40 die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error));
44 …"skip Server misconfiguration? RSA pub key is suspicious, [%d] %s\n", $link->errno, $link->error));
48 $link->query("SET @@session.old_passwords=2");
50 $link->query('DROP USER shatest');
51 $link->query("DROP USER shatest@localhost");
54 if (!$link->query('CREATE USER shatest@"%" IDENTIFIED WITH sha256_password') ||
55 !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) {
56 die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error));
59 if (!$link->query('SET PASSWORD FOR shatest@"%" = "shatest"') ||
60 !$link->query('SET PASSWORD FOR shatest@"localhost" = "shatest"')) {
61 die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error));
64 if (!$link->query("DROP TABLE IF EXISTS test") ||
65 !$link->query("CREATE TABLE test (id INT)") ||
66 !$link->query("INSERT INTO test(id) VALUES (1), (2), (3)"))
67 die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error));
70 if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db)) ||
71 !$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'localhost'", $db))) {
72 …die(sprintf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link)));
75 $link->close();
82 if (!$link = my_mysqli_connect($host, 'shatest', 'shatest', $db, $port, $socket)) {
87 if (!$res = $link->query("SELECT id FROM test WHERE id = 1"))
88 printf("[002] [%d] %s\n", $link->errno, $link->error);
91 printf("[003] [%d] %s\n", $link->errno, $link->error);
99 $link->close();
107 $link->query('DROP USER shatest');
108 $link->query('DROP USER shatest@localhost');