--source include/have_falcon.inc

#
# Bug #24024: wrong error message when drop table
#             (used by pending transaction) fails
#
# This test is a derivate of a subtestcase in mix2.inc.
# Therefore please delete this test when mix2_falcon is pushed.
#
--echo *** Bug #24024 ***

# ----------------------------------------------------- #
# --- Initialisation                                --- #
# ----------------------------------------------------- #
let $engine = 'Falcon';
eval SET @@storage_engine = $engine;

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

SET @@autocommit = 0;
CREATE TABLE t1(a int, b int, primary key(a));
INSERT INTO t1(a) VALUES (1);
COMMIT;

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

# ----------------------------------------------------- #
# --- Test                                          --- #
# ----------------------------------------------------- #
--echo # Switch to connection default
connection default;
UPDATE t1 SET b = 5 WHERE a = 1;

--echo # Switch to connection conn1
connection conn1;
INSERT INTO t1(a) VALUES(7);
COMMIT;
SELECT * FROM t1;
--send DROP TABLE t1
--real_sleep 1

--echo # Switch to connection default
connection default;
COMMIT;

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


# ----------------------------------------------------- #
# --- Check                                         --- #
# ----------------------------------------------------- #
# Final check not applicable here.
#SELECT count(*) FROM t1;

# ----------------------------------------------------- #
# --- Final cleanup                                 --- #
# ----------------------------------------------------- #
--echo # Switch to connection default
connection default;
disconnect conn1;
