--source include/have_falcon.inc
--source include/have_partition.inc

#
# Bug #22972: Falcon: Partitioned table with pending transaction
#             leads to strange error
#
--echo *** Bug #22972 ***

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

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

CREATE TABLE t1(a int) PARTITION BY LIST (a) (PARTITION p1 VALUES in (1));

--echo # Establish connection conn1 (root)
connect (conn1,localhost,root,,);

# ----------------------------------------------------- #
# --- Test                                          --- #
# ----------------------------------------------------- #
--echo # Switch to connection conn1
START TRANSACTION;
INSERT INTO t1 VALUES(1);

--echo # Switch to connection default
connection default;
--send DROP TABLE t1
--real_sleep 1

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

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

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

# ----------------------------------------------------- #
# --- Final cleanup                                 --- #
# ----------------------------------------------------- #
disconnect conn1;
