SET STORAGE_ENGINE='Falcon';
#
# Mantis bug #200: ROLLBACK does not work correctly
#
--echo *** Bug #200 ***
--disable_warnings
DROP TABLE IF EXISTS testSavepoints;
--enable_warnings

SET autocommit=1;
CREATE TABLE testSavepoints (field1 int);
SET autocommit=0;
INSERT INTO testSavepoints VALUES (1);
SAVEPOINT `afterInsert`;
UPDATE testSavepoints SET field1=2;
SAVEPOINT `afterUpdate`;
DELETE FROM testSavepoints;
SELECT count(*) FROM testSavepoints;
ROLLBACK TO SAVEPOINT afterUpdate;
SELECT count(*) FROM testSavepoints;

# Final cleanup.
DROP TABLE testSavepoints;
