Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql 4.1 rollback ?

Status
Not open for further replies.

ulefr01

Programmer
Jan 15, 2005
6
BE
i have installed mysql-server-4.1.8a-4 and
mysql-client-4.1.8a-4 on Linux 2.6.9
mysql is working correctly;
the rollback is not working :

mysql> insert into tran_test (a,b) values (1,2);
Query OK, 1 row affected (0.01 sec)

mysql> select * from tran_test;
+------+------+
| a | b |
+------+------+
| 1 | 2 |
+------+------+
1 row in set (0.00 sec)

mysql> rollback;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> select * from tran_test;
+------+------+
| a | b |
+------+------+
| 1 | 2 |
+------+------+
1 row in set (0.00 sec)

mysql> quit
Normally after the rollback i should get here an empty table !
The AUTOCOMMIT is set off (SET AUTOCOMMIT = 0).
Any idea ?
 
I am missing the create table statement;
Attached the complete output:
mysql> use test;
Database changed
mysql> set autocommit = 0;
Query OK, 0 rows affected (0.00 sec)
mysql> create table tran_test (a int, b int) type = InnoDB;
Query OK, 0 rows affected, 2 warnings (0.04 sec)
mysql> begin;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into tran_test (a,b) values (1,2);
Query OK, 1 row affected (0.00 sec)
mysql> select * from tran_test;
+------+------+
| a | b |
+------+------+
| 1 | 2 |
+------+------+
1 row in set (0.00 sec)
mysql> rollback;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> select * from tran_test;
+------+------+
| a | b |
+------+------+
| 1 | 2 |
+------+------+
1 row in set (0.00 sec)
mysql> quit

the Rollback seems to be OK but there is 1 warning , what does it means ?
Normally i should have an empty table but i haven't, any idea ?
 
See the create table statement :
create table tran_test (a int, b int) type = InnoDB;

i use InnoDB
 
Rollback isn't working in my installation, either. It does from python and PHP, so I'm confused, too.
 
If i do exactly likes what is mention in section 15.7.1 page 807 of the MySQL Reference Manual 5.0.3-Alpha i get :
mysql> use test
Database changed
mysql> create table customer (a int, b char(20), index (a)) type=InnoDB;
Query OK, 0 rows affected, 2 warnings (0.05 sec)

mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> insert into customer values (10, 'Heikki');
Query OK, 1 row affected (0.03 sec)

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

mysql> set autocommit=0;
Query OK, 0 rows affected (0.00 sec)

mysql> insert into customer values (15, 'John');
Query OK, 1 row affected (0.02 sec)

mysql> rollback;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> select * from customer;
+------+--------+
| a | b |
+------+--------+
| 10 | Heikki |
| 15 | John |
+------+--------+
2 rows in set (0.00 sec)

mysql> quit

This is not what is mention in the manual ; the entry "15, John" may not occur after the ROLLBACK !
 
problem is solved now.
My my.cnf file contains the entry "skip-innodb"
If i adapt this file and put this entry in comment.
Restart mysqld
Redo test
It works now
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top