Lines Matching refs:link
17 if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
20 if (mysqli_get_server_version($link) < 50606)
23 if (!($res = $link->query("SHOW PLUGINS"))) {
24 die(sprintf("skip [%d] %s\n", $link->errno, $link->error));
37 if (!($res = $link->query("SHOW STATUS LIKE 'Rsa_public_key'"))) {
38 die(sprintf("skip [%d] %s\n", $link->errno, $link->error));
42 die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error));
46 …"skip Server misconfiguration? RSA pub key is suspicious, [%d] %s\n", $link->errno, $link->error));
49 if (!$link->query("SET @@session.old_passwords=2")) {
50 die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error));
53 $link->query('DROP USER shatest');
54 $link->query("DROP USER shatest@localhost");
57 if (!$link->query('CREATE USER shatest@"%" IDENTIFIED WITH sha256_password') ||
58 !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) {
59 die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error));
62 if (!$link->query('SET PASSWORD FOR shatest@"%" = PASSWORD("shatest")') ||
63 !$link->query('SET PASSWORD FOR shatest@"localhost" = PASSWORD("shatest")')) {
64 die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error));
67 if (!$link->query("DROP TABLE IF EXISTS test") ||
68 !$link->query("CREATE TABLE test (id INT)") ||
69 !$link->query("INSERT INTO test(id) VALUES (1), (2), (3)"))
70 die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error));
73 if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db)) ||
74 !$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'localhost'", $db))) {
75 die(sprintf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link)));
78 $link->close();
84 if (!$link = my_mysqli_connect($host, 'shatest', 'shatest', $db, $port, $socket)) {
89 if (!$res = $link->query("SELECT id FROM test WHERE id = 1"))
90 printf("[002] [%d] %s\n", $link->errno, $link->error);
93 printf("[003] [%d] %s\n", $link->errno, $link->error);
101 $link->close();
109 $link->query('DROP USER shatest');
110 $link->query('DROP USER shatest@localhost');