mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
cql3: grammar: reject intValue with no contents
The grammar mistakenly allows nothing to be parsed as an
intValue (itself accepted in LIMIT and similar clauses).
Easily fixed by removing the empty alternative. A unit test is
added.
Fixes #14705.
Closes #14707
(cherry picked from commit e00811caac)
This commit is contained in:
@@ -1499,8 +1499,7 @@ marker returns [expression value]
|
||||
;
|
||||
|
||||
intValue returns [expression value]
|
||||
:
|
||||
| t=INTEGER { $value = untyped_constant{untyped_constant::integer, $t.text}; }
|
||||
: t=INTEGER { $value = untyped_constant{untyped_constant::integer, $t.text}; }
|
||||
| e=marker { $value = std::move(e); }
|
||||
;
|
||||
|
||||
|
||||
@@ -21,3 +21,10 @@ def table1(cql, test_keyspace):
|
||||
def test_json_empty(cql, table1):
|
||||
with pytest.raises(SyntaxException):
|
||||
cql.execute(f'INSERT INTO {table1} JSON')
|
||||
|
||||
# LIMIT should be followed by an expression (#14705)
|
||||
def test_limit_empty(cql, table1):
|
||||
with pytest.raises(SyntaxException):
|
||||
cql.execute(f'SELECT * FROM {table1} LIMIT')
|
||||
with pytest.raises(SyntaxException):
|
||||
cql.execute(f'SELECT * FROM {table1} PER PARTITION LIMIT')
|
||||
|
||||
Reference in New Issue
Block a user