alanwang67 commented on code in PR #4879:
URL: https://github.com/apache/cassandra/pull/4879#discussion_r3417286208
##########
src/java/org/apache/cassandra/cql3/transactions/ConditionStatement.java:
##########
@@ -100,8 +106,19 @@ public ConditionStatement prepare(String keyspace,
VariableSpecifications bindVa
RowDataReference reference;
Term value;
boolean reversed = false;
-
- if (lhs instanceof RowDataReference.Raw)
+
+ if (lhs instanceof RowDataReference.Raw && rhs instanceof
RowDataReference.Raw)
+ {
+ if (((RowDataReference.Raw) lhs).column() == null)
+ throw new IllegalStateException(String.format("Row
reference (%s) can only be used with IS NULL/IS NOT NULL conditions",
lhs.getText()));
+ if (((RowDataReference.Raw) rhs).column() == null)
+ throw new IllegalStateException(String.format("Row
reference (%s) can only be used with IS NULL/IS NOT NULL conditions",
rhs.getText()));
+ if (!((RowDataReference.Raw)
lhs).column().type.equals(((RowDataReference.Raw) rhs).column().type))
Review Comment:
I was wondering if we allowed for comparisons between an `int` and a
`boolean` today or would we raise a type error or more generically two types
that don't make sense to be compared.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]