@@ -17,18 +17,22 @@ echo "========== not in transaction ==========\n";
1717
1818echo "auto commit ON from ON \n" ;
1919$ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , true );
20+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
2021echo "Success \n\n" ;
2122
2223echo "auto commit OFF from ON \n" ;
2324$ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , false );
25+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
2426echo "Success \n\n" ;
2527
2628echo "auto commit OFF from OFF \n" ;
2729$ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , false );
30+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
2831echo "Success \n\n" ;
2932
3033echo "auto commit ON from OFF \n" ;
3134$ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , true );
35+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
3236echo "Success \n\n" ;
3337
3438echo "========== in transaction ========== \n" ;
@@ -41,13 +45,15 @@ echo "auto commit ON from ON, expect error\n";
4145try {
4246 $ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , true );
4347} catch (PDOException $ e ) {
48+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
4449 echo $ e ->getMessage ()."\n\n" ;
4550}
4651
4752echo "auto commit OFF from ON, expect error \n" ;
4853try {
4954 $ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , false );
5055} catch (PDOException $ e ) {
56+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
5157 echo $ e ->getMessage ()."\n\n" ;
5258}
5359
@@ -65,13 +71,15 @@ echo "auto commit ON from OFF, expect error\n";
6571try {
6672 $ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , true );
6773} catch (PDOException $ e ) {
74+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
6875 echo $ e ->getMessage ()."\n\n" ;
6976}
7077
7178echo "auto commit OFF from OFF, expect error \n" ;
7279try {
7380 $ db ->setAttribute (PDO ::ATTR_AUTOCOMMIT , false );
7481} catch (PDOException $ e ) {
82+ var_dump ($ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ));
7583 echo $ e ->getMessage ()."\n\n" ;
7684}
7785
@@ -84,34 +92,42 @@ echo "done!";
8492--EXPECT--
8593========== not in transaction ==========
8694auto commit ON from ON
95+ bool(true)
8796Success
8897
8998auto commit OFF from ON
99+ bool(false)
90100Success
91101
92102auto commit OFF from OFF
103+ bool(false)
93104Success
94105
95106auto commit ON from OFF
107+ bool(true)
96108Success
97109
98110========== in transaction ==========
99111begin transaction
100112
101113auto commit ON from ON, expect error
114+ bool(true)
102115SQLSTATE[HY000]: General error: Cannot change autocommit mode while a transaction is already open
103116
104117auto commit OFF from ON, expect error
118+ bool(true)
105119SQLSTATE[HY000]: General error: Cannot change autocommit mode while a transaction is already open
106120
107121end transaction
108122auto commit OFF
109123begin transaction
110124
111125auto commit ON from OFF, expect error
126+ bool(false)
112127SQLSTATE[HY000]: General error: Cannot change autocommit mode while a transaction is already open
113128
114129auto commit OFF from OFF, expect error
130+ bool(false)
115131SQLSTATE[HY000]: General error: Cannot change autocommit mode while a transaction is already open
116132
117133end transaction
0 commit comments