summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/truncate.test
blob: 16a3b06a8ae66439ee4f0ea3e35bd9e342196834 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--source include/have_innodb.inc

CREATE TABLE t (a SERIAL) ENGINE=InnoDB;

connect (dml,localhost,root);
# At the end of this statement, close_thread_tables()
# should add the open table handle to the table definition cache (tdc).
select * from t;

connection default;
# This should purge the handle from the tdc;
# otherwise ha_innobase::truncate() would hang,
# waiting for the reference count to drop to 0.
TRUNCATE TABLE t;
disconnect dml;

DROP TABLE t;

--echo #
--echo # MDEV-17816 Crash in TRUNCATE TABLE when table creation fails
--echo #
CREATE TABLE t1 (c VARCHAR(1024), KEY(c)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t1 SET c='character';
# FIXME: MDEV-17833 ALTER TABLE is not enforcing prefix index size limit
ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
--error ER_INDEX_COLUMN_TOO_LONG
TRUNCATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;

--echo #
--echo # MDEV-17831 TRUNCATE TABLE removes ROW_FORMAT=COMPRESSED
--echo #
CREATE TABLE t1 (a SERIAL) ENGINE=InnoDB KEY_BLOCK_SIZE=4;
TRUNCATE TABLE t1;
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
SHOW TABLE STATUS;
DROP TABLE t1;