Skip to content

Commit

Permalink
Validate attribute name
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela committed May 23, 2022
1 parent 95bc9d3 commit 53af1d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion store/postgres/src/relational_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1011,12 +1011,16 @@ impl<'a> QueryFilter<'a> {
Self::valid_attributes(filter, table, layout, child_filter_ancestor)?;
}
}
Child(_, entity, child_filter) => {
Child(attr, entity, child_filter) => {
if child_filter_ancestor {
return Err(StoreError::QueryExecutionError(
"Only a single level sub filter is allowed".to_string(),
));
}

// Make sure that the attribute name is valid for the given table
table.column_for_field(attr)?;

Self::valid_attributes(
child_filter,
layout.table_for_entity(entity)?,
Expand Down

0 comments on commit 53af1d4

Please sign in to comment.