• Marko Mäkelä's avatar
    Bug#12601439 CONSISTENT READ FAILURE IN COLUMN PREFIX INDEX · 607a3e83
    Marko Mäkelä authored
    When there is a secondary index on a column prefix of an externally
    stored column and an entry in the secondary index is shorter than the
    reserved prefix length, it should mean that the secondary index entry
    is holding the complete column value. When comparing this secondary
    index column value to the column in the clustered index row, we must
    compare the entire prefix that was fetched from the clustered
    index. The bug was that we would just compare that the column in the
    clustered index starts with the value found in the secondary index
    column.
    
    This bug affects only the InnoDB Barracuda formats (ROW_FORMAT=DYNAMIC
    and ROW_FORMAT=COMPRESSED), in which columns that are stored off-page
    in the clustered index do not contain any prefix in the clustered
    index record.
    
    row_sel_sec_rec_is_for_blob(): Add the parameter prefix_len, for
    ifield->prefix_len. Add some assertions.
    
    Sorry, I did not manage to produce a test case. This patch does
    produce correct results on the data set that Michael isolated on our
    test machine. That was with the purge and background rollback
    suspended, because they would make the bug go away.
    
    rb:760 approved by Sunny Bains
    607a3e83
row0sel.c 132 KB