Details
Description
BEGIN BATCH .... APPLY BATCH is not parsed correctly.
Steps:
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 ;
Error
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]...)">
While
BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0) APPLY BATCH ;
without ; after insert works.
Consequently neither
BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO excelsior.data (id) VALUES (0); APPLY BATCH ;
Error:
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]...)">
nor
BEGIN BATCH INSERT INTO excelsior.data (id) VALUES (0);INSERT INTO excelsior.data (id) VALUES (0) APPLY BATCH ;
Error
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...)">
works.
It was OK in 2.2.0 and 3.0 beta 1.
3.0-beta2-tentative also affected.
Attachments
Attachments
Issue Links
- is broken by
-
CASSANDRA-9232 "timestamp" is considered as a reserved keyword in cqlsh completion
- Resolved
- relates to
-
CASSANDRA-10313 cqlsh_tests.cqlsh_copy_tests.CqlshCopyTest.test_all_datatypes_read fails locally
- Resolved