This commit is contained in:
Amos Bird 2024-02-21 21:55:19 +08:00
parent 6137914604
commit 12914d2268
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4
2 changed files with 8 additions and 3 deletions

View File

@ -164,7 +164,7 @@ public:
int getBcryptWorkfactor() const; int getBcryptWorkfactor() const;
/// Enables logic that users without permissive row policies can still read rows using a SELECT query. /// Enables logic that users without permissive row policies can still read rows using a SELECT query.
/// For example, if there two users A, B and a row policy is defined only for A, then /// For example, if there are two users A, B and a row policy is defined only for A, then
/// if this setting is true the user B will see all rows, and if this setting is false the user B will see no rows. /// if this setting is true the user B will see all rows, and if this setting is false the user B will see no rows.
void setEnabledUsersWithoutRowPoliciesCanReadRows(bool enable) { users_without_row_policies_can_read_rows = enable; } void setEnabledUsersWithoutRowPoliciesCanReadRows(bool enable) { users_without_row_policies_can_read_rows = enable; }
bool isEnabledUsersWithoutRowPoliciesCanReadRows() const { return users_without_row_policies_can_read_rows; } bool isEnabledUsersWithoutRowPoliciesCanReadRows() const { return users_without_row_policies_can_read_rows; }

View File

@ -805,14 +805,19 @@ JoinTreeQueryPlan buildQueryPlanForTableExpression(QueryTreeNodePtr table_expres
prewhere_info->prewhere_actions = filter_info.actions; prewhere_info->prewhere_actions = filter_info.actions;
prewhere_info->prewhere_column_name = filter_info.column_name; prewhere_info->prewhere_column_name = filter_info.column_name;
prewhere_info->remove_prewhere_column = filter_info.do_remove_column; prewhere_info->remove_prewhere_column = filter_info.do_remove_column;
prewhere_info->need_filter = true;
} }
else if (!table_expression_query_info.prewhere_info->row_level_filter) else if (!prewhere_info->row_level_filter)
{ {
prewhere_info->row_level_filter = filter_info.actions; prewhere_info->row_level_filter = filter_info.actions;
prewhere_info->row_level_column_name = filter_info.column_name; prewhere_info->row_level_column_name = filter_info.column_name;
prewhere_info->need_filter = true;
}
else
{
where_filters.emplace_back(filter_info, std::move(description));
} }
prewhere_info->need_filter = true;
} }
else else
{ {