• Nikita Malyavin's avatar
    MDEV-26220 Server crashes with indexed by prefix virtual column · 9b8e207c
    Nikita Malyavin authored
    Server crashes in Field::register_field_in_read_map upon select from
    partitioned table with indexed by prefix virtual column.
    
    After several read-mark fixes a problem has surfaced:
    Since KEY (c(10),a) uses only a prefix of c, a new field is created,
    duplicated from table->field[3], with a new length. However,
    vcol_inco->expr is not copied.
    
    Therefore, (*key_info)->key_part[i].field->vcol_info->expr was left NULL
    in ha_partition::index_init().
    
    Solution: initialize vcols before key initialization
    
    Also key initialization is moved to a function.
    9b8e207c
gcol_partition.inc 5.65 KB