~ubuntu-branches/ubuntu/utopic/mariadb-5.5/utopic-security

« back to all changes in this revision

Viewing changes to mysql-test/r/truncate-stale-6500.result

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2015-06-13 21:09:48 UTC
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: package-import@ubuntu.com-20150613210948-0un6au1f6ujj37lv
Tags: upstream-5.5.44
Import upstream version 5.5.44

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
SET GLOBAL query_cache_size=1024*1024*8;
 
2
CREATE TABLE `test` (
 
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)
 
9
);
 
10
INSERT INTO `test`(`uniqueId`,`partitionId`) VALUES(407237055, 2);
 
11
SELECT * FROM `test`;
 
12
uniqueId        partitionId
 
13
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
 
17
test    p01     0
 
18
test    p02     1
 
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
 
23
test    p01     0
 
24
test    p02     0
 
25
#Before the patch, this returned the previously existing values.
 
26
SELECT * FROM `test`;
 
27
uniqueId        partitionId
 
28
SELECT SQL_CACHE * FROM `test`;
 
29
uniqueId        partitionId
 
30
SELECT SQL_NO_CACHE * FROM `test`;
 
31
uniqueId        partitionId
 
32
DROP TABLE test;
 
33
SET GLOBAL query_cache_size=DEFAULT;