dcapwell commented on code in PR #3416:
URL: https://github.com/apache/cassandra/pull/3416#discussion_r1674900795
##########
src/java/org/apache/cassandra/service/accord/txn/TxnWrite.java:
##########
@@ -261,7 +261,7 @@ public Update complete(AccordUpdateParameters parameters)
if (!staticRow.isEmpty())
updateBuilder.add(staticRow);
- Row existing = !baseUpdate.isEmpty() ?
Iterables.getOnlyElement(baseUpdate) : null;
+ Row existing = baseUpdate.hasRows() ?
Iterables.getOnlyElement(baseUpdate) : null;
Review Comment:
found by `TopologyMixupTest`. The test used `UPDATE` on a row that didn't
exist, but the table had a static column... the query was
```
UPDATE ...
SET
a += 42 -- row doesn't exist, null + 42 = null
b = 7 -- this is a static column, so creates an update
```
the update had a static row updated, but no non-static row!
--
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]