summaryrefslogtreecommitdiff
path: root/mysql-test/r/partition.result
diff options
context:
space:
mode:
authorSatya B <satya.bn@sun.com>2009-08-06 17:01:26 +0530
committerSatya B <satya.bn@sun.com>2009-08-06 17:01:26 +0530
commitee9aff794d72029a1a712fc884e5bfc3eddf57eb (patch)
tree404a6846b3d04bc82adf9c5127b6aee99f403dbf /mysql-test/r/partition.result
parent13c44afecaa210a40d82a2fc84919367e87562a7 (diff)
downloadmariadb-git-ee9aff794d72029a1a712fc884e5bfc3eddf57eb.tar.gz
Fix for BUG#45816 - assertion failure with index containing double
column on partitioned table An assertion 'ASSERT_COULUMN_MARKED_FOR_READ' is failed if the query is executed with index containing double column on partitioned table. The problem is that assertion expects all the fields which are read, to be in the read_set. In this query only the field 'a' is in the readset as the tables in the query are joined by the field 'a' and so the assertion fails expecting other field 'b'. Since the function cmp() is just comparison of two parameters passed, the assertion is not required. Fixed by removing the assertion in the double fields comparision function and also fixed the index initialization to do ordered index scan with RW LOCK which ensures all the fields from a key are in the read_set. Note: this bug is not reproducible with other datatypes because the assertion doesn't exist in comparision function for other datatypes. mysql-test/r/partition.result: Testcase for BUG#45816 mysql-test/t/partition.test: Testcase for BUG#45816 sql/field.cc: Removed the assertion ASSERT_COLUMN_MARED_FOR_READ in Field_double::cmp() function sql/ha_partition.cc: Fixed index_int() method to make it initialize the read_set properly if ordered index scan with RW lock is requested.
Diffstat (limited to 'mysql-test/r/partition.result')
-rw-r--r--mysql-test/r/partition.result19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 8b95f4e7e12..05350db1ee0 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1985,4 +1985,23 @@ CREATE TABLE t1(id INT,KEY(id)) ENGINE=MYISAM
PARTITION BY HASH(id) PARTITIONS 2;
DROP TABLE t1;
SET SESSION SQL_MODE=DEFAULT;
+#
+# BUG#45816 - assertion failure with index containing double
+# column on partitioned table
+#
+CREATE TABLE t1 (
+a INT DEFAULT NULL,
+b DOUBLE DEFAULT NULL,
+c INT DEFAULT NULL,
+KEY idx2(b,a)
+) PARTITION BY HASH(c) PARTITIONS 3;
+INSERT INTO t1 VALUES (6,8,9);
+INSERT INTO t1 VALUES (6,8,10);
+SELECT 1 FROM t1 JOIN t1 AS t2 USING (a) FOR UPDATE;
+1
+1
+1
+1
+1
+DROP TABLE t1;
End of 5.1 tests