Skip to content

Commit b155ed6

Browse files
authored
Storages: Fix missing deleted_rows compatibility issue (#10346)
close #10345
1 parent dce9588 commit b155ed6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dbms/src/Storages/DeltaMerge/VersionChain/DeleteMarkFilter.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ UInt32 buildDeleteMarkFilterDMFile(
8181
if (!rs_results[i].isUse())
8282
continue;
8383

84-
if (pack_properties.property(pack_id).deleted_rows() > 0)
84+
// deleted_rows is added after v6.1.
85+
// For compatibility purposes, if either pack_properties is missing or deleted_rows is unavailable,
86+
// the delmark data must be read and used for filtering.
87+
if (static_cast<UInt32>(pack_properties.property_size()) <= pack_id
88+
|| !pack_properties.property(pack_id).has_deleted_rows()
89+
|| pack_properties.property(pack_id).deleted_rows() > 0)
8590
{
8691
need_read_packs->insert(pack_id);
8792
start_row_id_of_need_read_packs.emplace(pack_id, pack_start_row_id);

0 commit comments

Comments
 (0)