summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@sun.com>2010-04-21 15:32:27 -0700
committerMattias Jonsson <mattias.jonsson@sun.com>2010-04-21 15:32:27 -0700
commit2faf4ddfd483dc4d772a07a7fb29cdcd1cbf0e46 (patch)
tree62894285b3b756fdb84e837ed0f95cb758ec8868 /mysql-test/t
parent9ba731c29966831c0359cc05f442969870b34bef (diff)
downloadmariadb-git-2faf4ddfd483dc4d772a07a7fb29cdcd1cbf0e46.tar.gz
Bug#52815: LIST COLUMNS doesn't insert rows in correct
partition if muliple columns used Problem was that range scanning through the sorted array of the column list values did not use a correct index calculation. Fixed by also taking the number of columns in the calculation.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/partition_column.test26
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/t/partition_column.test b/mysql-test/t/partition_column.test
index d1d2d666a39..95a2be36395 100644
--- a/mysql-test/t/partition_column.test
+++ b/mysql-test/t/partition_column.test
@@ -8,6 +8,32 @@
drop table if exists t1;
--enable_warnings
+--echo #
+--echo # Bug#52815: LIST COLUMNS doesn't insert rows in correct partition
+--echo # if muliple columns used
+CREATE TABLE t1 (
+id INT NOT NULL,
+name VARCHAR(255),
+department VARCHAR(10),
+country VARCHAR(255)
+) PARTITION BY LIST COLUMNS (department, country) (
+PARTITION first_office VALUES IN (('dep1', 'Russia'), ('dep1', 'Croatia')),
+PARTITION second_office VALUES IN (('dep2', 'Russia'))
+);
+
+INSERT INTO t1 VALUES(1, 'Ann', 'dep1', 'Russia');
+INSERT INTO t1 VALUES(2, 'Bob', 'dep1', 'Croatia');
+INSERT INTO t1 VALUES(3, 'Cecil', 'dep2', 'Russia');
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
+INSERT INTO t1 VALUES(3, 'Dan', 'dep2', 'Croatia');
+SELECT PARTITION_NAME,TABLE_ROWS
+FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't1';
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 WHERE department = 'dep2' and country = 'Croatia';
+SELECT * FROM t1 WHERE department = 'dep1' and country = 'Croatia';
+DROP TABLE t1;
+
#
# Bug#51347: assertion with show create table + partition by columns
# on decimal column