#
# Record cache memory leak test second version. Inspired by Kevin.
#
# Note: Do not run in ramdisk!
#
SET STORAGE_ENGINE = 'Falcon';
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

CREATE TABLE t1 (c1 varchar(100));
INSERT INTO t1 VALUES (repeat('A', 100));
INSERT INTO t1 VALUES (repeat('B', 100));
INSERT INTO t1 VALUES (repeat('C', 100));
COMMIT;

--disable_query_log
let $i= 25000;
while ($i) 
{
    BEGIN;
    UPDATE t1 SET c1 = lower(c1);
    UPDATE t1 SET c1 = upper(c1);
    UPDATE t1 SET c1 = lower(c1);
    UPDATE t1 SET c1 = upper(c1);
    UPDATE t1 SET c1 = lower(c1);
    UPDATE t1 SET c1 = upper(c1);
    UPDATE t1 SET c1 = lower(c1);
    UPDATE t1 SET c1 = upper(c1);
    COMMIT;

    dec $i;
}
--enable_query_log


# Final cleanup
DROP TABLE t1;
