partially revert #54706 (135df6870c)

This commit is contained in:
Alexander Tokmakov 2023-12-27 18:13:51 +01:00
parent 01d042c490
commit d7a6148828

View File

@ -28,6 +28,7 @@ ReplacingSortedAlgorithm::ReplacingSortedAlgorithm(
, cleanup(cleanup_) , cleanup(cleanup_)
, cleanedup_rows_count(cleanedup_rows_count_) , cleanedup_rows_count(cleanedup_rows_count_)
{ {
if (!is_deleted_column.empty()) if (!is_deleted_column.empty())
is_deleted_column_number = header_.getPositionByName(is_deleted_column); is_deleted_column_number = header_.getPositionByName(is_deleted_column);
if (!version_column.empty()) if (!version_column.empty())
@ -82,11 +83,8 @@ IMergingAlgorithm::Status ReplacingSortedAlgorithm::merge()
uint8_t value = assert_cast<const ColumnUInt8 &>(*(*selected_row.all_columns)[is_deleted_column_number]).getData()[selected_row.row_num]; uint8_t value = assert_cast<const ColumnUInt8 &>(*(*selected_row.all_columns)[is_deleted_column_number]).getData()[selected_row.row_num];
if (!cleanup || !value) if (!cleanup || !value)
insertRow(); insertRow();
else if (cleanup && cleanedup_rows_count != nullptr) else if (cleanedup_rows_count != nullptr)
{
*cleanedup_rows_count += current_row_sources.size(); *cleanedup_rows_count += current_row_sources.size();
current_row_sources.resize(0);
}
} }
else else
insertRow(); insertRow();
@ -143,11 +141,8 @@ IMergingAlgorithm::Status ReplacingSortedAlgorithm::merge()
uint8_t value = assert_cast<const ColumnUInt8 &>(*(*selected_row.all_columns)[is_deleted_column_number]).getData()[selected_row.row_num]; uint8_t value = assert_cast<const ColumnUInt8 &>(*(*selected_row.all_columns)[is_deleted_column_number]).getData()[selected_row.row_num];
if (!cleanup || !value) if (!cleanup || !value)
insertRow(); insertRow();
else if (cleanup && cleanedup_rows_count != nullptr) else if (cleanedup_rows_count != nullptr)
{
*cleanedup_rows_count += current_row_sources.size(); *cleanedup_rows_count += current_row_sources.size();
current_row_sources.resize(0);
}
} }
else else
insertRow(); insertRow();