mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	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.
		
			
				
	
	
		
			27 lines
		
	
	
		
			739 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			739 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| drop table if exists t1, t2, t3, t4;
 | |
| create table t1 (a int)
 | |
| partition by list (a)
 | |
| (partition p1 values in (0));
 | |
| alter table t1 truncate partition p1,p1;
 | |
| ERROR HY000: Incorrect partition name
 | |
| alter table t1 truncate partition p0;
 | |
| ERROR HY000: Incorrect partition name
 | |
| 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));
 | |
| alter table t1 truncate partition sp1;
 | |
| ERROR HY000: Incorrect partition name
 | |
| drop table t1;
 | |
| create table t1 (a int);
 | |
| insert into t1 values (1), (3), (8);
 | |
| alter table t1 truncate partition p0;
 | |
| ERROR HY000: Partition management on a not partitioned table is not possible
 | |
| select count(*) from t1;
 | |
| count(*)
 | |
| 3
 | |
| drop table t1;
 |