summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@sun.com>2009-10-08 15:58:17 +0200
committerMattias Jonsson <mattias.jonsson@sun.com>2009-10-08 15:58:17 +0200
commit62395e6ffa34316ebe4b5297459f8742361f9143 (patch)
tree3fd8c1e568ec2fd1c2adbf08a0f4290daad1cbfc /mysql-test/r
parent0d0f06da3a7ced9da59cca517a9ffead95c8f8d2 (diff)
downloadmariadb-git-62395e6ffa34316ebe4b5297459f8742361f9143.tar.gz
Bug#44059: Incorrect cardinality of indexes on a partitioned table
backport for bug#44059 from mysql-pe to mysql-5.1-bugteam Using the partition with most rows instead of first partition to estimate the cardinality of indexes. mysql-test/r/partition.result: Bug#44059: Incorrect cardinality of indexes on a partitioned table Added test result mysql-test/t/partition.test: Bug#44059: Incorrect cardinality of indexes on a partitioned table Added test case sql/ha_partition.cc: Bug#44059: Incorrect cardinality of indexes on a partitioned table Checking which partition that has the most rows, and using that partition for HA_STATUS_CONST instead of first partition
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/partition.result15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 2d54a66fe11..6611d39628f 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -50,6 +50,21 @@ t1 CREATE TABLE `t1` (
PARTITION p3 VALUES LESS THAN (733969) ENGINE = MyISAM,
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
DROP TABLE t1;
+create table t1 (a int, b int, key(a))
+partition by list (a)
+( partition p0 values in (1),
+partition p1 values in (2));
+insert into t1 values (1,1),(2,1),(2,2),(2,3);
+show indexes from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 a 1 a A NULL NULL NULL YES BTREE
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+show indexes from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 a 1 a A 1 NULL NULL YES BTREE
+drop table t1;
CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a))
ENGINE=MyISAM
PARTITION BY HASH (a);