Lines Matching refs:db
16 $db = MySQLPDOTest::factory();
17 $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
18 $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
19 return $db;
22 $db = createDB();
24 $db->query('CREATE TABLE test_79375 (first INT) ENGINE = InnoDB');
25 $db->query('INSERT INTO test_79375 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9)');
27 function testNormalQuery(PDO $db, string $name) {
28 $db->exec("SET innodb_lock_wait_timeout = 1");
29 $db->exec("START TRANSACTION");
33 $stmt = $db->query($query);
40 function testPrepareExecute(PDO $db, string $name) {
41 $db->exec("SET innodb_lock_wait_timeout = 1");
42 $db->exec("START TRANSACTION");
45 $stmt = $db->prepare($query);
54 function testUnbuffered(PDO $db, string $name) {
55 $db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
56 $db->exec("SET innodb_lock_wait_timeout = 1");
57 $db->exec("START TRANSACTION");
60 $stmt = $db->prepare($query);
71 testNormalQuery($db, 'first connection');
73 unset($db);
77 $db = createDB();
79 testPrepareExecute($db, 'first connection');
81 unset($db);
85 $db = createDB();
87 testUnbuffered($db, 'first connection');
89 unset($db);
97 $db = MySQLPDOTest::factory();
98 $db->exec('DROP TABLE IF EXISTS test_79375');