maedhroz commented on code in PR #2164:
URL: https://github.com/apache/cassandra/pull/2164#discussion_r1109134915


##########
src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:
##########
@@ -171,6 +171,8 @@ TxnNamedRead createNamedRead(NamedSelect namedSelect, 
QueryOptions options)
     {
         SelectStatement select = namedSelect.select;
         ReadQuery readQuery = select.getQuery(options, 0);
+        if (!(readQuery instanceof SinglePartitionReadQuery.Group))
+            throw new IllegalArgumentException("Partition range queries are 
illegal in transactions");

Review Comment:
   nit: I'd define a constant message...
   
   ```
   public static final String ILLEGAL_RANGE_QUERY_MESSAGE = "Range queries are 
not allowed for reads within a transaction";
   ```
   ...and then replace all three of these w/ something like...
   
   ```
   checkTrue(readQuery instanceof SinglePartitionReadQuery.Group, 
ILLEGAL_RANGE_QUERY_MESSAGE)
   ```



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