From feee6e4ffb971e535cf8a61860cf89d7c3601c81 Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Thu, 24 Feb 2022 15:36:31 +0100 Subject: [PATCH] cql3: expr: Add column_maybe_subscripted column_maybe_subscripted is a variant that can be either a column_value or a subscript. It will be used as an argument to functions which used to take column_value. Right now column_value has a sub field, but this will be removed soon once the subscript struct takes over. Changing the argument type is a smaller change than rewriting all these functions, although if they were rewritten the resulting code would probably be nicer. Signed-off-by: Jan Ciolek --- cql3/expr/expression.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cql3/expr/expression.cc b/cql3/expr/expression.cc index 3b31314156..137fa42c77 100644 --- a/cql3/expr/expression.cc +++ b/cql3/expr/expression.cc @@ -143,6 +143,9 @@ managed_bytes_opt get_value(const column_value& col, const column_value_eval_bag } } +/// column that might be subscripted - e.g col1, col2, col3[sub1] +using column_maybe_subscripted = std::variant; + /// Type for comparing results of get_value(). const abstract_type* get_value_comparator(const column_definition* cdef) { return &cdef->type->without_reversed();