yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
9k stars 1.07k forks source link

[YCQL] "NOT IN" query crashes yb-tserver #4109

Closed spolitov closed 2 years ago

spolitov commented 4 years ago

Jira Link: DB-1727 The following set of commands crashes yb-tserver

cqlsh> create keyspace xxx;
cqlsh> create table xxx.t (key int primary key, value1 int, value2 int);
cqlsh> select * from xxx.t where value1 not in (value1, value2);

with the following check failure:

F0330 09:54:42.294945 54751232 eval_const.cc:37] Check failed: expr->expr_op() == ExprOperator::kConst || expr->expr_op() == ExprOperator::kCollection || expr->expr_op() == ExprOperator::kUMinus || expr->expr_op() == ExprOperator::kBindVar
m-iancu commented 2 years ago

This no longer repros in latest:

ycqlsh> create keyspace xxx;
ycqlsh> create table xxx.t (key int primary key, value1 int, value2 int);
ycqlsh> select * from xxx.t where value1 not in (value1, value2);
SyntaxException: Invalid CQL Statement. Column references are not allowed in this context
select * from xxx.t where value1 not in (value1, value2);
                                         ^^^^^^
 (ql error -12)
ycqlsh> select * from xxx.t where value1 not in (1, 2);

 key | value1 | value2
-----+--------+--------

(0 rows)

Closing as fixed.