[ 
https://issues.apache.org/jira/browse/CASSANDRA-10272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14740139#comment-14740139
 ] 

Stefania commented on CASSANDRA-10272:
--------------------------------------

This was broken by CASSANDRA-9232, thank you for your investigations 
[~vovodroid], which sped things up considerably.

I've attached a patch that I tested manually on 2.1. I will now work on some 
automated dtests.

[~thobbs], the problem is that since when we removed the {{K_*}} identifiers 
(due to the max number of named groups in a python regex), the statement token 
at position zero is simply {{identifier}}, we should therefore look at position 
1, where the keyword entered by the user is stored. Are you happy to be the 
reviewer and if so do you require CI to run on all branches? I plan to just 
write some new cqlsh dtests to catch this functionality otherwise, and run the 
cqlsh tests locally with the text patch applied on 2.1+.

> BATCH statement is broken in cqlsh
> ----------------------------------
>
>                 Key: CASSANDRA-10272
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10272
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: CentOS 7.1/x64
>            Reporter: Vovodroid
>            Assignee: Stefania
>             Fix For: 2.1.x, 2.2.x, 3.0.0 rc1
>
>         Attachments: 10272-2.1.txt
>
>
> BEGIN BATCH .... APPLY BATCH is not parsed correctly.
> Steps:
> {code}
> CREATE KEYSPACE Excelsior  WITH 
> REPLICATION={'class':'SimpleStrategy','replication_factor':1};
> CREATE TABLE excelsior.data (id int primary key);
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0); APPLY BATCH ;
> {code}
> Error
> {code}
> SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] 
> message="line 0:-1 mismatched input '<EOF>' expecting K_APPLY">
> SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] 
> message="line 1:0 no viable alternative at input 'APPLY' ([APPLY]...)">
> {code}
> While 
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0)  APPLY BATCH ;
> {code}
> without *;* after insert works.
> Consequently neither
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO 
> excelsior.data (id) VALUES (0); APPLY BATCH ;
> {code}
> Error:
> {code}
> SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] 
> message="line 0:-1 mismatched input '<EOF>' expecting K_APPLY">
> SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] 
> message="line 1:0 no viable alternative at input 'APPLY' ([APPLY]...)">
> {code}
> nor
> {code}
> BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO 
> excelsior.data (id) VALUES (0) APPLY BATCH ;
> {code}
> Error
> {code}
> SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] 
> message="line 0:-1 mismatched input '<EOF>' expecting K_APPLY">
> SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] 
> message="line 1:43 missing EOF at 'APPLY' (...(id) VALUES (0) [APPLY] 
> BATCH...)">
> {code}
> works.
> It was OK in 2.2.0 and 3.0 beta 1.
> 3.0-beta2-tentative also affected.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to