summaryrefslogtreecommitdiff
path: root/mysql-test/main/truncate-stale-6500.result
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2018-03-09 14:05:35 +0200
committerMonty <monty@mariadb.org>2018-03-29 13:59:44 +0300
commita7abddeffa6a760ce948c2dfb007cdf3f1a369d5 (patch)
tree70eb743fa965a17380bbc0ac88ae79ca1075b896 /mysql-test/main/truncate-stale-6500.result
parentab1941266c59a19703a74b5593cf3f508a5752d7 (diff)
downloadmariadb-git-a7abddeffa6a760ce948c2dfb007cdf3f1a369d5.tar.gz
Create 'main' test directory and move 't' and 'r' there
Diffstat (limited to 'mysql-test/main/truncate-stale-6500.result')
-rw-r--r--mysql-test/main/truncate-stale-6500.result33
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/main/truncate-stale-6500.result b/mysql-test/main/truncate-stale-6500.result
new file mode 100644
index 00000000000..b6222716953
--- /dev/null
+++ b/mysql-test/main/truncate-stale-6500.result
@@ -0,0 +1,33 @@
+SET GLOBAL query_cache_size=1024*1024*8;
+CREATE TABLE `test` (
+`uniqueId` INT NOT NULL,
+`partitionId` INT NOT NULL,
+PRIMARY KEY (`uniqueId`,`partitionId`)
+) ENGINE=InnoDB PARTITION BY LIST (partitionId) (
+PARTITION p01 VALUES IN (1),
+PARTITION p02 VALUES IN (2)
+);
+INSERT INTO `test`(`uniqueId`,`partitionId`) VALUES(407237055, 2);
+SELECT * FROM `test`;
+uniqueId partitionId
+407237055 2
+#Confirms 1 row in partition 'p02'
+SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test';
+TABLE_NAME PARTITION_NAME TABLE_ROWS
+test p01 0
+test p02 1
+ALTER TABLE `test` TRUNCATE PARTITION `p02`;
+#Confirms no more rows in partition 'p02'
+SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test';
+TABLE_NAME PARTITION_NAME TABLE_ROWS
+test p01 0
+test p02 0
+#Before the patch, this returned the previously existing values.
+SELECT * FROM `test`;
+uniqueId partitionId
+SELECT SQL_CACHE * FROM `test`;
+uniqueId partitionId
+SELECT SQL_NO_CACHE * FROM `test`;
+uniqueId partitionId
+DROP TABLE test;
+SET GLOBAL query_cache_size=DEFAULT;