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


##########
src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java:
##########
@@ -388,6 +388,7 @@ public void addConditions(Collection<ColumnCondition> 
conds, QueryOptions option
         public boolean appliesTo(FilteredPartition current) throws 
InvalidRequestException
         {
             Row row = current.getRow(clustering);
+            if (row == null) return false;

Review Comment:
   this is a partial bug fix... the bug found in the fuzz tests was as follows
   
   ```
   v0 "someudt"
   ```
   
   then the query
   
   ```
   UPDATE ... WHERE pk=? IF v0 = ?
   ```
   
   the issue here is that the partition didn't exist, so the LHS of the 
`ColumnCondition` and `Operator` were `null`.  The condition was given empty 
bytes `byte[0]` (as the type allows it), and we have logic that says that a 
null LHS and an empty RHS is a matching condition... this caused us to *add* 
the partition!
   
   This change here is trying to simplify this type of bug, but doesn't fully 
fix...  You can't have a column condition return `true` if the row doesn't 
exist!
   
   This does mean that the UDT bug still exists if `v0` isn't defined in the 
row... I think this is still a bug but need to help flesh out the semantics in 
dev@ to confirm this (empty bytes have undocumented and inconsistent 
symatnics...)



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to