*** Bug #22150 ***
SET @@storage_engine = 'Falcon';
DROP TABLE IF EXISTS t1;
DROP PROCEDURE IF EXISTS p1;
# Establish connection conn1 (user = root)
SET @@autocommit = 1;
# Switch to connection default
SET @@autocommit = 1;
CREATE TABLE t1 (a int(11), KEY a (a));
CREATE PROCEDURE p1()
BEGIN
DECLARE v1 int default 0;
DECLARE v2 int;
DECLARE CONTINUE HANDLER FOR 1020 BEGIN END;
DECLARE CONTINUE HANDLER FOR 1213 BEGIN END;
WHILE v1 < 100000 DO
/* SELECT 'insert', v1; */
INSERT INTO t1 VALUES (v1);
SET v2 = rand() * 10000;
UPDATE t1 SET a = v2 WHERE a = v1;
/* SELECT ' update', v1; */
SET v1 = v1 + 1;
IF v1 MOD 50 = 0 THEN
/* SELECT ' delete'; */
DELETE FROM t1;
END IF;
END WHILE;
END//
# Sent call p1() to the server but do not pull the results
CALL p1();
# Switch to connection conn1
CALL p1();
# Switch to connection default
# Pull the results of the preceeding call p1()
# Sent call p1() to the server but do not pull the results
CALL p1();
# Switch to connection conn1
CALL p1();
# Switch to connection default
# Pull the results of the preceeding call p1()
SELECT count(*) FROM t1;
count(*)
0
# Disconnect conn1
DROP TABLE t1;
DROP PROCEDURE p1;
