summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@mysql.com>2010-10-15 20:13:35 +0500
committerAlexey Botchkov <holyfoot@mysql.com>2010-10-15 20:13:35 +0500
commit5f06f44f8b80ac5b1c4b33f791e8d09d78c3c38c (patch)
treea1092d19baf131d3a71bb50f527840460e51f93b
parent2246f67f7ad4357c0639558a4dd19c48cc28dcf8 (diff)
parente1d54fc7a852d5a985f7c6b2eb51a8872682e760 (diff)
downloadmariadb-git-5f06f44f8b80ac5b1c4b33f791e8d09d78c3c38c.tar.gz
merging.
-rw-r--r--mysql-test/r/partition_innodb.result6
-rw-r--r--mysql-test/t/partition_innodb.test13
-rw-r--r--sql/ha_partition.cc8
3 files changed, 25 insertions, 2 deletions
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index af4a03bb0ea..5fcb0e796b1 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -413,3 +413,9 @@ a b
3 2003-03-03
COMMIT;
DROP TABLE t1;
+CREATE TABLE t1 (i1 int NOT NULL primary key, f1 int) ENGINE = InnoDB
+PARTITION BY HASH(i1) PARTITIONS 2;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 WHERE i1 = ( SELECT i1 FROM t1 WHERE f1=0 LIMIT 1 );
+i1 f1
+DROP TABLE t1;
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index ca668d77199..dc8bcbb4cb9 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -425,3 +425,16 @@ connection default;
SELECT * FROM t1;
COMMIT;
DROP TABLE t1;
+
+#
+# Bug #55146 Assertion `m_part_spec.start_part == m_part_spec.end_part' in index_read_idx_map
+#
+
+CREATE TABLE t1 (i1 int NOT NULL primary key, f1 int) ENGINE = InnoDB
+ PARTITION BY HASH(i1) PARTITIONS 2;
+
+INSERT INTO t1 VALUES (1,1), (2,2);
+
+SELECT * FROM t1 WHERE i1 = ( SELECT i1 FROM t1 WHERE f1=0 LIMIT 1 );
+
+DROP TABLE t1;
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index d94dc263b48..155d457de6b 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -4266,8 +4266,12 @@ int ha_partition::index_read_idx_map(uchar *buf, uint index,
get_partition_set(table, buf, index, &m_start_key, &m_part_spec);
- /* How can it be more than one partition with the current use? */
- DBUG_ASSERT(m_part_spec.start_part == m_part_spec.end_part);
+ /*
+ We have either found exactly 1 partition
+ (in which case start_part == end_part)
+ or no matching partitions (start_part > end_part)
+ */
+ DBUG_ASSERT(m_part_spec.start_part >= m_part_spec.end_part);
for (part= m_part_spec.start_part; part <= m_part_spec.end_part; part++)
{