1
SET GLOBAL query_cache_size=1024*1024*8;
3
`uniqueId` INT NOT NULL,
4
`partitionId` INT NOT NULL,
5
PRIMARY KEY (`uniqueId`,`partitionId`)
6
) ENGINE=InnoDB PARTITION BY LIST (partitionId) (
7
PARTITION p01 VALUES IN (1),
8
PARTITION p02 VALUES IN (2)
10
INSERT INTO `test`(`uniqueId`,`partitionId`) VALUES(407237055, 2);
14
#Confirms 1 row in partition 'p02'
15
SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test';
16
TABLE_NAME PARTITION_NAME TABLE_ROWS
19
ALTER TABLE `test` TRUNCATE PARTITION `p02`;
20
#Confirms no more rows in partition 'p02'
21
SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test';
22
TABLE_NAME PARTITION_NAME TABLE_ROWS
25
#Before the patch, this returned the previously existing values.
28
SELECT SQL_CACHE * FROM `test`;
30
SELECT SQL_NO_CACHE * FROM `test`;
33
SET GLOBAL query_cache_size=DEFAULT;