@@ -16,14 +16,14 @@ MySQLPDOTest::skipNotTransactionalEngine();
16
16
17
17
MySQLPDOTest::createTestTable ($ table , $ db , MySQLPDOTest::detect_transactional_mysql_engine ($ db ));
18
18
19
- if (1 !== $ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ))
19
+ if (true !== $ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ))
20
20
printf ("[001] Autocommit should be on by default \n" );
21
21
22
22
if (false == $ db ->beginTransaction ())
23
23
printf ("[002] Cannot start a transaction, [%s] [%s] \n" ,
24
24
$ db ->errorCode (), implode (' ' , $ db ->errorInfo ()));
25
25
26
- if (1 !== $ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ))
26
+ if (true !== $ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ))
27
27
printf ("[003] Autocommit should be on by default, beginTransaction() shall not impact it \n" );
28
28
29
29
if (0 == $ db ->exec ("DELETE FROM {$ table }" ))
@@ -50,7 +50,7 @@ MySQLPDOTest::skipNotTransactionalEngine();
50
50
if (!$ db ->commit ())
51
51
printf ("[008] [%s] %s \n" , $ db ->errorCode (), implode (' ' , $ db ->errorInfo ()));
52
52
53
- if (1 !== $ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ))
53
+ if (true !== $ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ))
54
54
printf ("[009] Autocommit should be on after commit() \n" );
55
55
56
56
if (!($ stmt = $ db ->query (sprintf ('SELECT id, label FROM %s WHERE id = %d ' , $ table , $ row ['id ' ]))))
@@ -91,7 +91,7 @@ MySQLPDOTest::skipNotTransactionalEngine();
91
91
if (!$ db ->rollback ())
92
92
printf ("[018] [%s] %s \n" , $ db ->errorCode (), implode (' ' , $ db ->errorInfo ()));
93
93
94
- if (1 !== $ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ))
94
+ if (true !== $ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ))
95
95
printf ("[019] Autocommit should be on after rollback \n" );
96
96
97
97
if (!($ stmt = $ db ->query (sprintf ('SELECT id, label FROM %s WHERE id = %d ' , $ table , $ row ['id ' ]))))
@@ -132,7 +132,7 @@ MySQLPDOTest::skipNotTransactionalEngine();
132
132
133
133
// Turn off autocommit using a server variable
134
134
$ db ->exec ('SET @@autocommit = 0 ' );
135
- if (1 === $ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ))
135
+ if (true === $ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ))
136
136
printf ("[028] I'm confused, how can autocommit be on? Didn't I say I want to manually control transactions? \n" );
137
137
138
138
if (!$ db ->beginTransaction ())
@@ -155,7 +155,7 @@ MySQLPDOTest::skipNotTransactionalEngine();
155
155
printf ("[031] Cannot start a transaction, [%s] [%s] \n" ,
156
156
$ db ->errorCode (), implode (' ' , $ db ->errorInfo ()));
157
157
158
- if (1 !== $ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ))
158
+ if (true !== $ db ->getAttribute (PDO ::ATTR_AUTOCOMMIT ))
159
159
printf ("[032] Autocommit should be on my default, beginTransaction() should not change that \n" );
160
160
161
161
if (0 == $ db ->exec ("DELETE FROM {$ table }" ))
0 commit comments