diff options
Diffstat (limited to 'storage/tokudb/mysql-test/tokudb_add_index/t/falcon_bug_23818_1.test')
-rw-r--r-- | storage/tokudb/mysql-test/tokudb_add_index/t/falcon_bug_23818_1.test | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/storage/tokudb/mysql-test/tokudb_add_index/t/falcon_bug_23818_1.test b/storage/tokudb/mysql-test/tokudb_add_index/t/falcon_bug_23818_1.test new file mode 100644 index 00000000000..e23dbdb9915 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_add_index/t/falcon_bug_23818_1.test @@ -0,0 +1,36 @@ +--source include/have_tokudb.inc +SET @@DEFAULT_STORAGE_ENGINE = tokudb; +# +# Bug #23818 Falcon: crash with random updates of long varchar columns +# First part. Original bug reports loops 100000 times. +# Use UCS2 which uses two bytes for every char. +# +--echo *** Bug #23818_I *** +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP PROCEDURE IF EXISTS p1; +--enable_warnings + + /* Does not fail with "b varchar(256) character set ucs2" */ +CREATE TABLE t1 (a int, b varchar(1000) character set ucs2, c varchar(10000)); +INSERT INTO t1 VALUES (null,null,null),(1,'',''),(2,'a','a'); +CREATE INDEX i1 ON t1 (b(550)); + +DELIMITER //; +CREATE PROCEDURE p1 () +BEGIN + declare v int default 0; + while v < 100 do + SET @x = concat('update t1 set a = ', v,', b = repeat(0x', hex(rand()*10000),',rand()*549), c = repeat(0x', hex(rand()*255), ',rand()*9999)'); + /* select v,@x; */ + PREPARE stmt1 FROM @x; + EXECUTE stmt1; + SET v = v + 1; + END while; + END// +CALL p1()// + +# Final cleanup. +DELIMITER ;// +DROP TABLE t1; +DROP PROCEDURE p1; |