mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
Generate an error when CONTAINS is used on a non-collection column
Fixes #2255 Signed-off-by: Botond Dénes <bdenes@scylladb.com> Message-Id: <517bb6268ac213aed9a1def231614c2e88f77c9f.1499764183.git.bdenes@scylladb.com>
This commit is contained in:
committed by
Duarte Nunes
parent
310d2a54d2
commit
f18f724f1c
@@ -130,6 +130,10 @@ single_column_relation::to_receivers(schema_ptr schema, const column_definition&
|
||||
}
|
||||
}
|
||||
|
||||
if (is_contains() && !receiver->type->is_collection()) {
|
||||
throw exceptions::invalid_request_exception(sprint("Cannot use CONTAINS on non-collection column \"%s\"", receiver->name));
|
||||
}
|
||||
|
||||
if (is_contains_key()) {
|
||||
if (!dynamic_cast<const map_type_impl*>(receiver->type.get())) {
|
||||
throw exceptions::invalid_request_exception(sprint("Cannot use CONTAINS KEY on non-map column %s", receiver->name));
|
||||
|
||||
Reference in New Issue
Block a user