• Satya B's avatar
    Fix for BUG#45816 - assertion failure with index containing double · d933cb16
    Satya B authored
                        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.
    d933cb16
field.cc 286 KB