Skip to content

MDEV-28610 : Assertion `marked_for_read()' failed upon range select with virtual column in index#5122

Open
pranavktiwari wants to merge 2 commits into
10.11from
10.11-MDEV-28610
Open

MDEV-28610 : Assertion `marked_for_read()' failed upon range select with virtual column in index#5122
pranavktiwari wants to merge 2 commits into
10.11from
10.11-MDEV-28610

Conversation

@pranavktiwari
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the do_mark_index_columns function in sql/table.cc to ensure that virtual columns are registered in the read map even when the read flag is false. A review comment identifies a potential issue where this change causes the code to skip marking the write set for virtual columns, which could lead to missing updates in the storage engine. The reviewer suggested refactoring the logic to ensure virtual columns are registered in the read map without bypassing the write set marking.

Comment thread sql/table.cc Outdated
Comment on lines 7643 to 7646
if (read || key_part[k].field->vcol_info)
key_part[k].field->register_field_in_read_map();
else
bitmap_set_bit(bitmap, key_part[k].fieldnr-1);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The current implementation skips marking the field in the bitmap (which corresponds to the write set when read is false) if the field is a virtual column. This occurs because the else block is bypassed when key_part[k].field->vcol_info is true. For stored virtual columns that are part of an index, this could lead to missing updates in the storage engine during write operations, as the engine might not be notified that these columns need to be updated. It is recommended to ensure that virtual columns are always registered in the read map without affecting the logic for the write set marking.

    if (read || key_part[k].field->vcol_info)
      key_part[k].field->register_field_in_read_map();
    if (!read)
      bitmap_set_bit(bitmap, key_part[k].fieldnr-1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant