SET storage_engine = Falcon;
#
# Bug #22845:
#
--echo *** Bug #22845 ***
--disable_warnings
DROP DATABASE IF EXISTS db1;
--enable_warnings
CREATE DATABASE db1;
USE db1;

--echo # Establish connection conn1
connect (conn1,localhost,root,,);
USE db1;
SET storage_engine = Falcon;
SET @@autocommit = 0;

--echo # Switch to connection default
connection default;
SET @@autocommit = 0;

CREATE TABLE t1 (a int)
  PARTITION BY LIST (a) (
    PARTITION p1 VALUES IN (1),
    PARTITION p2 VALUES IN (2),
    PARTITION p3 VALUES IN (null)
);
START TRANSACTION;

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

--echo # Switch to connection default
connection default;
--error 1296
ALTER TABLE t1 DROP PARTITION p2;

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

--echo # Switch to connection default
connection default;
ALTER TABLE t1 DROP PARTITION p2;
COMMIT;

# Final cleanup.
connection default;
disconnect conn1;
DROP DATABASE db1;
