Luis E Fernandez created CASSANDRA-18965:
--------------------------------------------

             Summary: IllegalArgumentException "tuple is null" thrown for 
illegal syntax in cql transaction block
                 Key: CASSANDRA-18965
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18965
             Project: Cassandra
          Issue Type: Bug
            Reporter: Luis E Fernandez


*System configuration and information:*

Single node Cassandra with Accord transactions enabled running on docker

Built from commit: 
[a7cd114435704b988c81f47ef53d0bfd6441f38b|https://github.com/apache/cassandra/commit/a7cd114435704b988c81f47ef53d0bfd6441f38b]

CQLSH: [cqlsh 6.2.0 | Cassandra 5.0-alpha2-SNAPSHOT | CQL spec 3.4.7 | Native 
protocol v5]

 

*Steps to reproduce in CQLSH:*

 
{code:java}
CREATE KEYSPACE accord WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': '1'}  AND durable_writes = true;{code}
 

 
{code:java}
CREATE TABLE accord.accounts (
    partition_key text,
    account_id int,
    balance int,
    PRIMARY KEY (partition_key, account_id)
) WITH CLUSTERING ORDER BY (account_id ASC){code}
 

 
{code:java}
INSERT INTO accord.accounts (partition_key, account_id, balance) VALUES 
('default', 1, 1000);{code}
 

bug happens after executing the following statement:

After assigning a variable within the transaction block, we are attempting to 
perform arithmetic operations in the next SELECT statement. Without the 
arithmetic operation, the SELECT statement is valid. Instead of reporting an 
IllegalArgumentException, CQL should probably just report invalid syntax.

 
{code:java}
BEGIN TRANSACTION LET row = (SELECT * FROM accord.accounts WHERE partition_key 
= 'default' AND account_id = 1); SELECT (row.balance + 50); COMMIT 
TRANSACTION;{code}
 

 

Bug / Error:
======================================================================
{color:#de350b}SyntaxException: Failed parsing statement: [BEGIN TRANSACTION 
LET row = (SELECT * FROM accord.accounts WHERE partition_key = 'default' AND 
account_id = 1); SELECT (row.balance + 50); COMMIT TRANSACTION;] reason: 
IllegalArgumentException tuple is null{color}

 

{color:#172b4d}This is found while testing Accord transactions with 
[~henrik.ingo] and team.{color}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to