SET @@storage_engine = Falcon;
#
# Mantis bug #263: ROLLBACK fails with two interleaving transactions
#
--echo *** Bug #263 ***
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

--echo # Establish connection conn1 (user = root)
connect (conn1,localhost,root,,);
SET @@storage_engine = Falcon;

--echo # Switch to connection default
connection default;
CREATE TABLE t1 (a int, primary key (a));
SET @@autocommit = 0;
START TRANSACTION;
INSERT INTO t1 VALUES (0);
SAVEPOINT s1;
INSERT INTO t1 VALUES (5);

--echo # Switch to connection conn1
connection conn1;
SET @@autocommit = 0;
START TRANSACTION;
--send INSERT INTO t1 VALUES (5)

--echo # Switch to connection default
connection default;
ROLLBACK TO SAVEPOINT s1;
COMMIT;

--echo # Switch to connection conn1
connection conn1;
reap;
COMMIT;

--echo # Switch to connection default
connection default;

# Final cleanup
disconnect conn1;
DROP TABLE t1;
