@@ -17,18 +17,22 @@ echo "========== not in transaction ==========\n";
17
17
18
18
echo "auto commit ON from ON \n" ;
19
19
$ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , true );
20
+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
20
21
echo "Success \n\n" ;
21
22
22
23
echo "auto commit OFF from ON \n" ;
23
24
$ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , false );
25
+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
24
26
echo "Success \n\n" ;
25
27
26
28
echo "auto commit OFF from OFF \n" ;
27
29
$ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , false );
30
+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
28
31
echo "Success \n\n" ;
29
32
30
33
echo "auto commit ON from OFF \n" ;
31
34
$ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , true );
35
+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
32
36
echo "Success \n\n" ;
33
37
34
38
echo "========== in transaction ========== \n" ;
@@ -41,13 +45,15 @@ echo "auto commit ON from ON, expect error\n";
41
45
try {
42
46
$ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , true );
43
47
} catch (PDOException $ e ) {
48
+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
44
49
echo $ e ->getMessage ()."\n\n" ;
45
50
}
46
51
47
52
echo "auto commit OFF from ON, expect error \n" ;
48
53
try {
49
54
$ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , false );
50
55
} catch (PDOException $ e ) {
56
+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
51
57
echo $ e ->getMessage ()."\n\n" ;
52
58
}
53
59
@@ -65,13 +71,15 @@ echo "auto commit ON from OFF, expect error\n";
65
71
try {
66
72
$ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , true );
67
73
} catch (PDOException $ e ) {
74
+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
68
75
echo $ e ->getMessage ()."\n\n" ;
69
76
}
70
77
71
78
echo "auto commit OFF from OFF, expect error \n" ;
72
79
try {
73
80
$ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , false );
74
81
} catch (PDOException $ e ) {
82
+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
75
83
echo $ e ->getMessage ()."\n\n" ;
76
84
}
77
85
@@ -84,34 +92,42 @@ echo "done!";
84
92
--EXPECT--
85
93
========== not in transaction ==========
86
94
auto commit ON from ON
95
+ bool(true)
87
96
Success
88
97
89
98
auto commit OFF from ON
99
+ bool(false)
90
100
Success
91
101
92
102
auto commit OFF from OFF
103
+ bool(false)
93
104
Success
94
105
95
106
auto commit ON from OFF
107
+ bool(true)
96
108
Success
97
109
98
110
========== in transaction ==========
99
111
begin transaction
100
112
101
113
auto commit ON from ON, expect error
114
+ bool(true)
102
115
SQLSTATE[HY000]: General error: Cannot change autocommit mode while a transaction is already open
103
116
104
117
auto commit OFF from ON, expect error
118
+ bool(true)
105
119
SQLSTATE[HY000]: General error: Cannot change autocommit mode while a transaction is already open
106
120
107
121
end transaction
108
122
auto commit OFF
109
123
begin transaction
110
124
111
125
auto commit ON from OFF, expect error
126
+ bool(false)
112
127
SQLSTATE[HY000]: General error: Cannot change autocommit mode while a transaction is already open
113
128
114
129
auto commit OFF from OFF, expect error
130
+ bool(false)
115
131
SQLSTATE[HY000]: General error: Cannot change autocommit mode while a transaction is already open
116
132
117
133
end transaction
0 commit comments