Lines Matching refs:link
8 $link = mysqli_connect_or_skip();
9 if (!have_innodb($link))
10 die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
15 if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
19 if (!mysqli_query($link, 'DROP TABLE IF EXISTS test'))
20 printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
22 if (!mysqli_query($link, 'CREATE TABLE test(id INT) ENGINE = InnoDB'))
23 … printf("[009] Cannot create test table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
25 if (true !== ($tmp = mysqli_autocommit($link, true)))
29 if (true !== ($tmp = mysqli_begin_transaction($link)))
30 printf("[011] Got %s - [%d] %s\n", $tmp, mysqli_errno($link), mysqli_error($link));
32 if (!mysqli_query($link, 'INSERT INTO test(id) VALUES (1)'))
33 printf("[012] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
35 $tmp = mysqli_rollback($link);
40 $res = mysqli_query($link, "SELECT * FROM test");
46 if (mysqli_get_server_version($link) >= 50605) {
53 if (!mysqli_begin_transaction($link, $flag, sprintf("flag %d", $flag))) {
54 printf("[014] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
56 if (!mysqli_query($link, 'SELECT * FROM test') || !mysqli_rollback($link)) {
57 printf("[015] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
62 if (mysqli_get_server_version($link) >= 50605) {
63 … if (!mysqli_begin_transaction($link, MYSQLI_TRANS_START_READ_ONLY, sprintf("flag %d", $flag))) {
64 printf("[016] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
66 if (mysqli_query($link, "INSERT INTO test(id) VALUES (2)")) {
67 printf("[017] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
68 } else if (!mysqli_commit($link)) {
69 printf("[018] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
71 mysqli_query($link, "SELECT id FROM test WHERE id = 2");
76 mysqli_begin_transaction($link, -1);
77 printf("[019] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
82 if (mysqli_get_server_version($link) >= 50605) {
84 if (@!$link->begin_transaction(MYSQLI_TRANS_START_READ_WRITE, "*/trick me?\n\0"))
85 printf("[020] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
88 if (@!$link->begin_transaction(MYSQLI_TRANS_START_READ_WRITE, "az09"))
89 printf("[021] [%d] %s\n", mysqli_errno($link), mysqli_error($link));