dcapwell commented on code in PR #4879:
URL: https://github.com/apache/cassandra/pull/4879#discussion_r3415213803


##########
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 think strictly speaking this isn't required as `int < long` I believe we 
support; but its fine for now



-- 
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]

Reply via email to