From 06eaf7232e9a920468c0f8d74dcf2fe8b555501c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 14:24:36 +0200 Subject: Adding upstream version 1:10.11.6. Signed-off-by: Daniel Baumann --- mysql-test/main/partition_truncate.test | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 mysql-test/main/partition_truncate.test (limited to 'mysql-test/main/partition_truncate.test') diff --git a/mysql-test/main/partition_truncate.test b/mysql-test/main/partition_truncate.test new file mode 100644 index 00000000..62ed5488 --- /dev/null +++ b/mysql-test/main/partition_truncate.test @@ -0,0 +1,33 @@ +# +# Simple tests to verify truncate partition syntax +# +--source include/have_partition.inc +--disable_warnings +drop table if exists t1, t2, t3, t4; +--enable_warnings + +create table t1 (a int) +partition by list (a) +(partition p1 values in (0)); +--error ER_WRONG_PARTITION_NAME +alter table t1 truncate partition p1,p1; +--error ER_UNKNOWN_PARTITION +alter table t1 truncate partition p0; +drop table t1; + +create table t1 (a int) +partition by list (a) +subpartition by hash (a) +subpartitions 1 +(partition p1 values in (1) + (subpartition sp1)); +--error ER_WRONG_PARTITION_NAME +alter table t1 truncate partition sp1; +drop table t1; + +create table t1 (a int); +insert into t1 values (1), (3), (8); +--error ER_PARTITION_MGMT_ON_NONPARTITIONED +alter table t1 truncate partition p0; +select count(*) from t1; +drop table t1; -- cgit v1.2.3