Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix columns_to_read contains _tidb_rowid #7283

Merged
merged 5 commits into from
Apr 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions dbms/src/Storages/StorageDeltaMerge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,15 @@ DM::PushDownFilterPtr StorageDeltaMerge::parsePushDownFilter(const SelectQueryIn
const auto & table_infos = tidb_table_info.columns;
for (const auto & col : columns_to_read)
{
// table_infos does not contain handle column
if (col.id == -1)
{
auto handle = ColumnInfo();
handle.id = EXTRA_HANDLE_COLUMN_ID;
handle.name = EXTRA_HANDLE_COLUMN_NAME;
table_scan_column_info.push_back(handle);
continue;
}
auto iter = std::find_if(
Copy link
Contributor

Choose a reason for hiding this comment

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

Better show the col.id and col.name in L783 in case similar problem happen again

auto iter = std::find_if(
table_infos.begin(),
table_infos.end(),
[col](const ColumnInfo & c) -> bool { return c.id == col.id; });
RUNTIME_CHECK(iter != table_infos.end());

Copy link
Contributor

Choose a reason for hiding this comment

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

And also L761

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Better show the col.id and col.name in L783 in case similar problem happen again

done

And also L761

columns_to_read will contain extre column, so there is no need to check in L761

table_infos.begin(),
table_infos.end(),
Expand Down