mariadb/mysql-test/t/partition_truncate.test
Mattias Jonsson 25ae81f133 Bug#49907: ALTER TABLE ... TRUNCATE PARTITION does not wait for
locks on the table

Fixing the partitioning specifics after TRUNCATE TABLE in
bug-42643 was fixed.

Reorganize of code to decrease the size of the giant switch
in mysql_execute_command, and to prepare for future parser
reengineering. Moved code into Sql_statement objects.

Updated patch according to davi's review comments.
2010-08-16 14:53:30 +02:00

33 lines
809 B
Text

#
# 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_WRONG_PARTITION_NAME
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;