• Marko Mäkelä's avatar
    MDEV-17548 Incorrect access to off-page column for indexed virtual column · 31366c6c
    Marko Mäkelä authored
    row_build_index_entry_low(): ext does not contain virtual columns.
    
    row_upd_store_v_row(): Copy virtual column values
    
    This is based on the following fix in MySQL 5.7.24:
    
    commit 4ec2158bec73f1582501c4b3e3de250fed9edc9a
    Author: Sachin Agarwal <sachin.z.agarwal@oracle.com>
    Date:   Fri Aug 24 14:44:13 2018 +0530
    
        Bug #27968952 INNODB CRASH/CORRUPTION WITH TEXT PREFIX INDEXES
    
        Problem:
        There are two problems:
          1. If there is one secondary index on extenally
        stored column and another seconday index on virtual column (whose
        base column is not externally stored). then while updating seconday
        index on vitrual column, virtual column data is replaced by
        externally stoared column.
          2. In row update operation, node->row contains
        shallow copy of virtual data fields. While building an update vector
        containing all the fields to be modified, compute virtual column.
        which may causes change in virtual data fields in node->row.
    
        In both the above cases, while updating seconday index on virtual
        column, couldn't find the row and hit an explicite assert inside
        ROW_NOT_FOUND.
    
        Fix:
        1. Added check if column is virtual then its ext flag should be ZERO
        and virtual column data will not be replaced by offset column data.
        2. Deep copy of virtual data fields for node->row.
    
        RB: #20382
        Reviewed by : Jimmy.Yang@oracle.com
    31366c6c
row0upd.cc 90.1 KB