diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py index eacc433cc0..5fa6e3901b 100644 --- a/pylib/cqlshlib/cql3handling.py +++ b/pylib/cqlshlib/cql3handling.py @@ -770,7 +770,7 @@ def update_indexbracket_completer(ctxt, cass): syntax_rules += r''' ::= "DELETE" ( ( "," )* )? "FROM" cf= - ( "USING" [delopt]= ( "AND" [delopt]= )* )? + ( "USING" [delopt]= )? "WHERE" ; ::= delcol= ( memberbracket="[" memberselector= "]" )? diff --git a/src/java/org/apache/cassandra/cql3/Cql.g b/src/java/org/apache/cassandra/cql3/Cql.g index 0035c41526..b4816ce943 100644 --- a/src/java/org/apache/cassandra/cql3/Cql.g +++ b/src/java/org/apache/cassandra/cql3/Cql.g @@ -306,19 +306,11 @@ insertStatement returns [UpdateStatement.ParsedInsert expr] ; usingClause[Attributes.Raw attrs] - : K_USING usingClauseObjective[attrs] ( K_AND? usingClauseObjective[attrs] )* - ; - -usingClauseDelete[Attributes.Raw attrs] - : K_USING usingClauseDeleteObjective[attrs] ( K_AND? usingClauseDeleteObjective[attrs] )* - ; - -usingClauseDeleteObjective[Attributes.Raw attrs] - : K_TIMESTAMP ts=intValue { attrs.timestamp = ts; } + : K_USING usingClauseObjective[attrs] ( K_AND usingClauseObjective[attrs] )* ; usingClauseObjective[Attributes.Raw attrs] - : usingClauseDeleteObjective[attrs] + : K_TIMESTAMP ts=intValue { attrs.timestamp = ts; } | K_TTL t=intValue { attrs.timeToLive = t; } ; @@ -388,6 +380,10 @@ deleteOp returns [Operation.RawDeletion op] | c=cident '[' t=term ']' { $op = new Operation.ElementDeletion(c, t); } ; +usingClauseDelete[Attributes.Raw attrs] + : K_USING K_TIMESTAMP ts=intValue { attrs.timestamp = ts; } + ; + /** * BEGIN BATCH * UPDATE SET name1 = value1 WHERE KEY = keyname1;