@@ -17,41 +17,40 @@ $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
45
$ db ->exec ('DROP PROCEDURE IF EXISTS nores ' );
47
- $ db ->exec ('CREATE PROCEDURE nores() BEGIN DELETE FROM test WHERE first=6; END; ' );
46
+ $ db ->exec ('CREATE PROCEDURE nores() BEGIN DELETE FROM test_80458 WHERE first=6; END; ' );
48
47
$ stmt4 = $ db ->prepare ('CALL nores() ' );
49
48
$ stmt4 ->execute ();
50
49
var_dump ($ stmt4 ->fetchAll ());
51
50
$ db ->exec ('DROP PROCEDURE IF EXISTS nores ' );
52
51
53
52
$ db ->exec ('DROP PROCEDURE IF EXISTS ret ' );
54
- $ db ->exec ('CREATE PROCEDURE ret() BEGIN SELECT first FROM test WHERE first=7; END; ' );
53
+ $ db ->exec ('CREATE PROCEDURE ret() BEGIN SELECT first FROM test_80458 WHERE first=7; END; ' );
55
54
$ stmt5 = $ db ->prepare ('CALL ret() ' );
56
55
$ stmt5 ->execute ();
57
56
var_dump ($ stmt5 ->fetchAll ());
@@ -63,36 +62,36 @@ $db->exec('DROP PROCEDURE IF EXISTS ret');
63
62
print ("Emulated prepares \n" );
64
63
$ db ->setAttribute (PDO ::ATTR_EMULATE_PREPARES , true );
65
64
66
- $ stmt = $ db ->prepare ('DELETE FROM test WHERE first=8 ' );
65
+ $ stmt = $ db ->prepare ('DELETE FROM test_80458 WHERE first=8 ' );
67
66
$ stmt ->execute ();
68
67
var_dump ($ stmt ->fetchAll ());
69
68
70
- $ res = $ db ->query ('DELETE FROM test WHERE first=9 ' );
69
+ $ res = $ db ->query ('DELETE FROM test_80458 WHERE first=9 ' );
71
70
var_dump ($ res ->fetchAll ());
72
71
73
- $ stmt2 = $ db ->prepare ('DELETE FROM test WHERE first=10 ' );
72
+ $ stmt2 = $ db ->prepare ('DELETE FROM test_80458 WHERE first=10 ' );
74
73
$ stmt2 ->execute ();
75
74
foreach ($ stmt2 as $ row ){
76
75
// expect nothing
77
76
}
78
77
79
- $ stmt3 = $ db ->prepare ('DELETE FROM test WHERE first=11 ' );
78
+ $ stmt3 = $ db ->prepare ('DELETE FROM test_80458 WHERE first=11 ' );
80
79
$ stmt3 ->execute ();
81
80
var_dump ($ stmt3 ->fetch (PDO ::FETCH_ASSOC ));
82
81
83
- $ stmt = $ db ->prepare ('SELECT first FROM test WHERE first=12 ' );
82
+ $ stmt = $ db ->prepare ('SELECT first FROM test_80458 WHERE first=12 ' );
84
83
$ stmt ->execute ();
85
84
var_dump ($ stmt ->fetchAll ());
86
85
87
86
$ db ->exec ('DROP PROCEDURE IF EXISTS nores ' );
88
- $ db ->exec ('CREATE PROCEDURE nores() BEGIN DELETE FROM test WHERE first=13; END; ' );
87
+ $ db ->exec ('CREATE PROCEDURE nores() BEGIN DELETE FROM test_80458 WHERE first=13; END; ' );
89
88
$ stmt4 = $ db ->prepare ('CALL nores() ' );
90
89
$ stmt4 ->execute ();
91
90
var_dump ($ stmt4 ->fetchAll ());
92
91
$ db ->exec ('DROP PROCEDURE IF EXISTS nores ' );
93
92
94
93
$ db ->exec ('DROP PROCEDURE IF EXISTS ret ' );
95
- $ db ->exec ('CREATE PROCEDURE ret() BEGIN SELECT first FROM test WHERE first=14; END; ' );
94
+ $ db ->exec ('CREATE PROCEDURE ret() BEGIN SELECT first FROM test_80458 WHERE first=14; END; ' );
96
95
$ stmt5 = $ db ->prepare ('CALL ret() ' );
97
96
$ stmt5 ->execute ();
98
97
var_dump ($ stmt5 ->fetchAll ());
@@ -103,19 +102,20 @@ $db->exec('DROP PROCEDURE IF EXISTS ret');
103
102
$ db ->setAttribute (PDO ::ATTR_EMULATE_PREPARES , false );
104
103
$ db ->setAttribute (PDO ::MYSQL_ATTR_USE_BUFFERED_QUERY , false );
105
104
106
- $ stmt = $ db ->prepare ('DELETE FROM test WHERE first=15 ' );
105
+ $ stmt = $ db ->prepare ('DELETE FROM test_80458 WHERE first=15 ' );
107
106
$ stmt ->execute ();
108
107
var_dump ($ stmt ->fetchAll ());
109
108
110
- $ stmt = $ db ->prepare ('SELECT first FROM test WHERE first=16 ' );
109
+ $ stmt = $ db ->prepare ('SELECT first FROM test_80458 WHERE first=16 ' );
111
110
$ stmt ->execute ();
112
111
var_dump ($ stmt ->fetchAll ());
113
112
114
113
?>
115
114
--CLEAN--
116
115
<?php
117
116
require __DIR__ . '/mysql_pdo_test.inc ' ;
118
- MySQLPDOTest::dropTestTable ();
117
+ $ db = MySQLPDOTest::factory ();
118
+ $ db ->exec ('DROP TABLE IF EXISTS test_80458 ' );
119
119
?>
120
120
--EXPECT--
121
121
array(0) {
0 commit comments