Rollback does not work for me....[solved]
Posted: Thu Apr 06, 2006 11:25 am
I am making an insert command and trying to rollback but it is still inserted...
Code: Select all
rollback problem:
mysql> select version();
+------------+
| version() |
+------------+
| 5.0.15-log |
+------------+
mysql> select @@autocommit;
+--------------+
| @@autocommit |
+--------------+
| 1 |
+--------------+
1 row in set
mysql> set autocommit = 0;
Query OK, 0 rows affected
mysql> select @@autocommit;
+--------------+
| @@autocommit |
+--------------+
| 0 |
+--------------+
1 row in set
mysql> insert into Country values ('tempC', 'tempCountryName');
Query OK, 1 row affected
mysql> select * from Country where code = 'tempC';
+-------+-----------------+
| code | name |
+-------+-----------------+
| tempC | tempCountryName |
+-------+-----------------+
1 row in set
mysql> rollback;
Query OK, 0 rows affected
mysql> select * from Country where code = 'tempC';
+-------+-----------------+
| code | name |
+-------+-----------------+
| tempC | tempCountryName |
+-------+-----------------+
1 row in set
mysql>