summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb_fts/t/truncate.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/innodb_fts/t/truncate.test')
-rw-r--r--mysql-test/suite/innodb_fts/t/truncate.test50
1 files changed, 50 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb_fts/t/truncate.test b/mysql-test/suite/innodb_fts/t/truncate.test
new file mode 100644
index 00000000000..46ba732b019
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/t/truncate.test
@@ -0,0 +1,50 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+--echo #
+--echo # Bug#25053705 - INVALID I/O ON TABLE AFTER TRUNCATE
+--echo #
+
+CREATE TABLE t1 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b),
+FULLTEXT fts2(c));
+
+TRUNCATE TABLE t1;
+
+INSERT INTO t1 (a,d,b,c) VALUES (
+'79795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
+repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc
+cuullucocraloracurooulrooauuar','1'));
+
+# The following CREATE TABLE and INSERTs are used to remove the pages related to table t1
+# from the buffer pool.
+CREATE TABLE t2 (a INT, d INT, b VARCHAR(198), c CHAR(158), FULLTEXT fts1(c,b));
+
+INSERT INTO t2 VALUES (1, 1, repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
+repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorccuullucocraloracurooulrooauuar','1'));
+
+delimiter |;
+create procedure insert_t2(IN total int)
+begin
+ declare i int default 1;
+ while (i <= total) DO
+ insert into t2 select * from t2;
+ set i = i + 1;
+ end while;
+end|
+delimiter ;|
+
+CALL insert_t2(15);
+
+SET @save_dbug = @@SESSION.DEBUG_DBUG;
+SET DEBUG_DBUG = '+d,innodb_invalid_read_after_truncate';
+
+INSERT INTO t1 (a,d,b,c) VALUES (
+'7795','6',repeat('uololoaroolccaaruolraloouuoocorrcorurlu','1'),
+repeat('orouculcaocuocloooolooloooaorlroclouulrrucclulalouaulrluorooaclllluuorc
+cuullucocraloracurooulrooauuar','1'));
+
+SET DEBUG_DBUG = @save_dbug;
+
+DROP PROCEDURE insert_t2;
+
+DROP TABLE t1,t2;