fix crash

This commit is contained in:
lgbo-ustc 2024-08-07 16:44:10 +08:00
parent 58b7ac2264
commit 8426e0d5e5
3 changed files with 2 additions and 4 deletions

View File

@ -361,7 +361,6 @@ size_t HashJoinMethods<KIND, STRICTNESS, MapsTemplate>::joinRightColumns(
}
bool right_row_found = false;
KnownRowsHolder<flag_per_row> known_rows;
for (size_t onexpr_idx = 0; onexpr_idx < added_columns.join_on_keys.size(); ++onexpr_idx)
{
@ -693,7 +692,7 @@ size_t HashJoinMethods<KIND,STRICTNESS, MapsTemplate>::joinRightColumnsWithAddti
any_matched = true;
if constexpr (join_features.is_semi_join || join_features.is_any_join)
{
auto used_once = used_flags.template setUsedOnce<true, true>(
auto used_once = used_flags.template setUsedOnce<join_features.need_flags, true>(
selected_right_row_it->block, selected_right_row_it->row_num, 0);
if (used_once)
{

View File

@ -22,7 +22,7 @@ struct JoinFeatures
static constexpr bool need_filter = !need_replication && (inner || right || (is_semi_join && left) || (is_anti_join && left));
static constexpr bool add_missing = (left || full) && !is_semi_join;
static constexpr bool need_flags = MapGetter<KIND, STRICTNESS, std::is_same_v<std::decay_t<Map>, HashJoin::MapsOne>>::flagged;
static constexpr bool need_flags = MapGetter<KIND, STRICTNESS, std::is_same_v<std::decay_t<Map>, HashJoin::MapsAll>>::flagged;
static constexpr bool is_maps_all = std::is_same_v<std::decay_t<Map>, HashJoin::MapsAll>;
};

View File

@ -1,4 +1,3 @@
03006_join_on_inequal_expression_fast.sql
-- { echoOn }
SET join_algorithm='hash';
SELECT t1.*, t2.* FROM t1 LEFT JOIN t2 ON (t1.a < t2.a OR lower(t1.attr) == lower(t2.attr)) AND t1.key = t2.key ORDER BY (t1.key, t1.attr, t2.key, t2.attr);