mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-07 23:43:31 +00:00
token_restriction: Add non-token merge exception
Add exception that is thrown when merging of token and non-token restrictions is attempted. Before this change only merging non-token and token restriction was validated (WHERE pk = 0 AND token(pk) > 0) and not the other way (WHERE token(pk) > 0 AND pk = 0).
This commit is contained in:
@@ -71,6 +71,11 @@ public:
|
||||
}
|
||||
|
||||
void merge_with(::shared_ptr<restriction> restriction) override {
|
||||
if (!has_token(restriction->expression)) {
|
||||
throw exceptions::invalid_request_exception(
|
||||
format("Columns \"{}\" cannot be restricted by both a normal relation and a token relation",
|
||||
join(", ", get_column_defs())));
|
||||
}
|
||||
expression = make_conjunction(std::move(expression), restriction->expression);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user