@@ -17,41 +17,38 @@ $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
17
17
$ db ->setAttribute (PDO ::ATTR_EMULATE_PREPARES , false );
18
18
$ db ->setAttribute (PDO ::ATTR_STRINGIFY_FETCHES , true );
19
19
20
- $ db ->query ('DROP TABLE IF EXISTS test ' );
21
- $ db ->query ('CREATE TABLE test (first int) ENGINE = InnoDB ' );
22
- $ res = $ db ->query ('INSERT INTO test(first) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16) ' );
20
+ $ db ->query ('CREATE TABLE test_80458 (first int) ENGINE = InnoDB ' );
21
+ $ res = $ db ->query ('INSERT INTO test_80458(first) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16) ' );
23
22
var_dump ($ res ->fetchAll ());
24
23
25
- $ stmt = $ db ->prepare ('DELETE FROM test WHERE first=1 ' );
24
+ $ stmt = $ db ->prepare ('DELETE FROM test_80458 WHERE first=1 ' );
26
25
$ stmt ->execute ();
27
26
var_dump ($ stmt ->fetchAll ());
28
27
29
- $ res = $ db ->query ('DELETE FROM test WHERE first=2 ' );
28
+ $ res = $ db ->query ('DELETE FROM test_80458 WHERE first=2 ' );
30
29
var_dump ($ res ->fetchAll ());
31
30
32
- $ stmt2 = $ db ->prepare ('DELETE FROM test WHERE first=3 ' );
31
+ $ stmt2 = $ db ->prepare ('DELETE FROM test_80458 WHERE first=3 ' );
33
32
$ stmt2 ->execute ();
34
33
foreach ($ stmt2 as $ row ){
35
34
// expect nothing
36
35
}
37
36
38
- $ stmt3 = $ db ->prepare ('DELETE FROM test WHERE first=4 ' );
37
+ $ stmt3 = $ db ->prepare ('DELETE FROM test_80458 WHERE first=4 ' );
39
38
$ stmt3 ->execute ();
40
39
var_dump ($ stmt3 ->fetch (PDO ::FETCH_ASSOC ));
41
40
42
- $ stmt = $ db ->prepare ('SELECT first FROM test WHERE first=5 ' );
41
+ $ stmt = $ db ->prepare ('SELECT first FROM test_80458 WHERE first=5 ' );
43
42
$ stmt ->execute ();
44
43
var_dump ($ stmt ->fetchAll ());
45
44
46
- $ db ->exec ('DROP PROCEDURE IF EXISTS nores ' );
47
- $ db ->exec ('CREATE PROCEDURE nores() BEGIN DELETE FROM test WHERE first=6; END; ' );
45
+ $ db ->exec ('CREATE PROCEDURE nores() BEGIN DELETE FROM test_80458 WHERE first=6; END; ' );
48
46
$ stmt4 = $ db ->prepare ('CALL nores() ' );
49
47
$ stmt4 ->execute ();
50
48
var_dump ($ stmt4 ->fetchAll ());
51
49
$ db ->exec ('DROP PROCEDURE IF EXISTS nores ' );
52
50
53
- $ db ->exec ('DROP PROCEDURE IF EXISTS ret ' );
54
- $ db ->exec ('CREATE PROCEDURE ret() BEGIN SELECT first FROM test WHERE first=7; END; ' );
51
+ $ db ->exec ('CREATE PROCEDURE ret() BEGIN SELECT first FROM test_80458 WHERE first=7; END; ' );
55
52
$ stmt5 = $ db ->prepare ('CALL ret() ' );
56
53
$ stmt5 ->execute ();
57
54
var_dump ($ stmt5 ->fetchAll ());
@@ -63,36 +60,32 @@ $db->exec('DROP PROCEDURE IF EXISTS ret');
63
60
print ("Emulated prepares \n" );
64
61
$ db ->setAttribute (PDO ::ATTR_EMULATE_PREPARES , true );
65
62
66
- $ stmt = $ db ->prepare ('DELETE FROM test WHERE first=8 ' );
63
+ $ stmt = $ db ->prepare ('DELETE FROM test_80458 WHERE first=8 ' );
67
64
$ stmt ->execute ();
68
65
var_dump ($ stmt ->fetchAll ());
69
66
70
- $ res = $ db ->query ('DELETE FROM test WHERE first=9 ' );
67
+ $ res = $ db ->query ('DELETE FROM test_80458 WHERE first=9 ' );
71
68
var_dump ($ res ->fetchAll ());
72
69
73
- $ stmt2 = $ db ->prepare ('DELETE FROM test WHERE first=10 ' );
70
+ $ stmt2 = $ db ->prepare ('DELETE FROM test_80458 WHERE first=10 ' );
74
71
$ stmt2 ->execute ();
75
72
foreach ($ stmt2 as $ row ){
76
73
// expect nothing
77
74
}
78
75
79
- $ stmt3 = $ db ->prepare ('DELETE FROM test WHERE first=11 ' );
76
+ $ stmt3 = $ db ->prepare ('DELETE FROM test_80458 WHERE first=11 ' );
80
77
$ stmt3 ->execute ();
81
78
var_dump ($ stmt3 ->fetch (PDO ::FETCH_ASSOC ));
82
79
83
- $ stmt = $ db ->prepare ('SELECT first FROM test WHERE first=12 ' );
80
+ $ stmt = $ db ->prepare ('SELECT first FROM test_80458 WHERE first=12 ' );
84
81
$ stmt ->execute ();
85
82
var_dump ($ stmt ->fetchAll ());
86
83
87
- $ db ->exec ('DROP PROCEDURE IF EXISTS nores ' );
88
- $ db ->exec ('CREATE PROCEDURE nores() BEGIN DELETE FROM test WHERE first=13; END; ' );
84
+ $ db ->exec ('CREATE PROCEDURE nores() BEGIN DELETE FROM test_80458 WHERE first=13; END; ' );
89
85
$ stmt4 = $ db ->prepare ('CALL nores() ' );
90
86
$ stmt4 ->execute ();
91
87
var_dump ($ stmt4 ->fetchAll ());
92
- $ db ->exec ('DROP PROCEDURE IF EXISTS nores ' );
93
-
94
- $ db ->exec ('DROP PROCEDURE IF EXISTS ret ' );
95
- $ db ->exec ('CREATE PROCEDURE ret() BEGIN SELECT first FROM test WHERE first=14; END; ' );
88
+ $ db ->exec ('CREATE PROCEDURE ret() BEGIN SELECT first FROM test_80458 WHERE first=14; END; ' );
96
89
$ stmt5 = $ db ->prepare ('CALL ret() ' );
97
90
$ stmt5 ->execute ();
98
91
var_dump ($ stmt5 ->fetchAll ());
@@ -103,19 +96,22 @@ $db->exec('DROP PROCEDURE IF EXISTS ret');
103
96
$ db ->setAttribute (PDO ::ATTR_EMULATE_PREPARES , false );
104
97
$ db ->setAttribute (PDO ::MYSQL_ATTR_USE_BUFFERED_QUERY , false );
105
98
106
- $ stmt = $ db ->prepare ('DELETE FROM test WHERE first=15 ' );
99
+ $ stmt = $ db ->prepare ('DELETE FROM test_80458 WHERE first=15 ' );
107
100
$ stmt ->execute ();
108
101
var_dump ($ stmt ->fetchAll ());
109
102
110
- $ stmt = $ db ->prepare ('SELECT first FROM test WHERE first=16 ' );
103
+ $ stmt = $ db ->prepare ('SELECT first FROM test_80458 WHERE first=16 ' );
111
104
$ stmt ->execute ();
112
105
var_dump ($ stmt ->fetchAll ());
113
106
114
107
?>
115
108
--CLEAN--
116
109
<?php
117
110
require __DIR__ . '/mysql_pdo_test.inc ' ;
118
- MySQLPDOTest::dropTestTable ();
111
+ $ db = MySQLPDOTest::factory ();
112
+ MySQLPDOTest::dropTestTable ($ db , 'test_80458 ' );
113
+ $ db ->exec ('DROP PROCEDURE IF EXISTS nores ' );
114
+ $ db ->exec ('DROP PROCEDURE IF EXISTS ret ' );
119
115
?>
120
116
--EXPECT--
121
117
array(0) {
0 commit comments