List:Commits« Previous MessageNext Message »
From:Satya B Date:July 31 2009 1:04pm
Subject:bzr commit into mysql-5.1-bugteam branch (satya.bn:3054) Bug#45816
View as plain text  
#At file:///home/satya/WORK/45816/mysql-5.1-bugteam-45816/ based on revid:v.narayanan@stripped

 3054 Satya B	2009-07-31
      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.
      
      Note: this bug is not reproducible with other datatypes because the
            assertion doesn't exist in comparision function for other 
            datatypes.
      modified:
        mysql-test/r/partition.result
        mysql-test/t/partition.test
        sql/field.cc

per-file messages:
  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
=== modified file 'mysql-test/r/partition.result'
--- a/mysql-test/r/partition.result	2009-07-29 15:56:32 +0000
+++ b/mysql-test/r/partition.result	2009-07-31 13:04:17 +0000
@@ -1997,5 +1997,25 @@ CREATE TABLE t1(id INT,KEY(id)) ENGINE=M
 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)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+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
 SET @@global.general_log= @old_general_log;

=== modified file 'mysql-test/t/partition.test'
--- a/mysql-test/t/partition.test	2009-07-29 15:56:32 +0000
+++ b/mysql-test/t/partition.test	2009-07-31 13:04:17 +0000
@@ -1998,6 +1998,26 @@ CREATE TABLE t1(id INT,KEY(id)) ENGINE=M
 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)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+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
 
 SET @@global.general_log= @old_general_log;

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2009-07-10 23:12:13 +0000
+++ b/sql/field.cc	2009-07-31 13:04:17 +0000
@@ -4598,7 +4598,6 @@ bool Field_double::send_binary(Protocol 
 
 int Field_double::cmp(const uchar *a_ptr, const uchar *b_ptr)
 {
-  ASSERT_COLUMN_MARKED_FOR_READ;
   double a,b;
 #ifdef WORDS_BIGENDIAN
   if (table->s->db_low_byte_first)

Thread
bzr commit into mysql-5.1-bugteam branch (satya.bn:3054) Bug#45816Satya B31 Jul