• Annamalai Gurusami's avatar
    Bug #14668683 ASSERT REC_GET_DELETED_FLAG(REC, PAGE_IS_COMP(PAGE)) · d13408f8
    Annamalai Gurusami authored
    Problem:
    
    The function row_upd_changes_ord_field_binary() is used to decide whether to
    use row_upd_clust_rec_by_insert() or row_upd_clust_rec().  The function
    row_upd_changes_ord_field_binary() does not make use of charset information.
    Based on binary comparison it decides that r1 and r2 differ in their ordering
    fields.
    
    In the function row_upd_clust_rec_by_insert(), an update is done by delete +
    insert.  These operations internally make use of cmp_dtuple_rec_with_match()
    to compare records r1 and r2.  This comparison takes place with the use of
    charset information.
    
    This means that it is possible for the deleted record to be reused in the
    subsequent insert.  In the given scenario, the characters 'a' and 'A' are
    considered equal in the my_charset_latin1.  When this happens, the ownership
    information of externally stored blobs are not correctly handled.
    
    Solution:
    
    When an update is done by delete followed by insert, disown the relevant
    externally stored fields during the delete marking itself (within the same
    mtr).  If the insert succeeds, then nothing with respect to blob ownership
    needs to be done.  If the insert fails, then the disown done earlier will be
    removed when the operation is rolled back.
    
    rb#4479 approved by Marko.
    
    d13408f8
innodb-update-insert.result 948 Bytes