summaryrefslogtreecommitdiff
path: root/mysql-test/t/partition.test
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
commitd933cb1669141c87632fddca25baf8aca3bb06ba (patch)
tree404a6846b3d04bc82adf9c5127b6aee99f403dbf /mysql-test/t/partition.test
parent70cd97722d3f9cf8e2e6f3def2ac7f63cf55c5eb (diff)
downloadmariadb-git-d933cb1669141c87632fddca25baf8aca3bb06ba.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/t/partition.test')
-rw-r--r--mysql-test/t/partition.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 542a992bb0e..0b497d86623 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -1979,4 +1979,23 @@ CREATE TABLE t1(id INT,KEY(id)) ENGINE=MYISAM
DROP TABLE t1;
SET SESSION SQL_MODE=DEFAULT;
+
+--echo #
+--echo # BUG#45816 - assertion failure with index containing double
+--echo # column on partitioned table
+--echo #
+
+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;
+
+DROP TABLE t1;
--echo End of 5.1 tests