views:

246

answers:

3

Simple doubt, the title says it all. =)

+2  A: 

InnoDB supports SAVEPOINTS.

You can do the following:

CREATE TABLE t_test (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;

START TRANSACTION;

INSERT
INTO    t_test
VALUES  (1);

SELECT  *
FROM    t_test;

 id
---
  1

SAVEPOINT tran2;

INSERT
INTO    t_test
VALUES  (2);

SELECT  *
FROM    t_test;

 id
---
  1
  2

ROLLBACK TO tran2;

SELECT  *
FROM    t_test;

 id
---
  1

ROLLBACK;

SELECT  *
FROM    t_test;

 id
---
Quassnoi
Thanks, I'll keep this in mind for future reference.
Alix Axel
A: 

Have you tried it? It should only take you a few seconds, and then you would have your answer.

Marius
The problem with "try it" approaches is it might appear to work in some scenarios and not others. I wouldn't base an important and complex concept such as transactions with a "let's see what happens" approach.
nos
@Marius, No I haven't. The box where I'm at doesn't have a MySQL installed.
Alix Axel
+1  A: 

Actually they started to do:

Nested transaction scopes were not supported. MySQL Connector/NET 6.3.xx now implements nested transaction scopes. A per-thread stack of scopes is maintained, which is necessary in order to handle nested scopes with the RequiresNew or Suppress options.

http://dev.mysql.com/doc/refman/5.5/en/connector-net-news-6-3-0.html

jalchr