Updated Branches: refs/heads/trunk 0d94d2a0a -> d7977f2c4
Correct minor CQL3 grammar rules (USING) Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/17186d82 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/17186d82 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/17186d82 Branch: refs/heads/trunk Commit: 17186d82549e82daf032c132c9520aa795680a4f Parents: ddb501d Author: Aleksey Yeschenko <alek...@apache.org> Authored: Sat Aug 24 03:21:52 2013 +0300 Committer: Aleksey Yeschenko <alek...@apache.org> Committed: Sat Aug 24 03:21:52 2013 +0300 ---------------------------------------------------------------------- pylib/cqlshlib/cql3handling.py | 2 +- src/java/org/apache/cassandra/cql3/Cql.g | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/17186d82/pylib/cqlshlib/cql3handling.py ---------------------------------------------------------------------- diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py index 82e14d4..c5b449f 100644 --- a/pylib/cqlshlib/cql3handling.py +++ b/pylib/cqlshlib/cql3handling.py @@ -955,7 +955,7 @@ def update_indexbracket_completer(ctxt, cass): syntax_rules += r''' <deleteStatement> ::= "DELETE" ( <deleteSelector> ( "," <deleteSelector> )* )? "FROM" cf=<columnFamilyName> - ( "USING" [delopt]=<deleteOption> ( "AND" [delopt]=<deleteOption> )* )? + ( "USING" [delopt]=<deleteOption> )? "WHERE" <whereClause> ; <deleteSelector> ::= delcol=<cident> ( memberbracket="[" memberselector=<term> "]" )? http://git-wip-us.apache.org/repos/asf/cassandra/blob/17186d82/src/java/org/apache/cassandra/cql3/Cql.g ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/Cql.g b/src/java/org/apache/cassandra/cql3/Cql.g index 218c541..f59be51 100644 --- a/src/java/org/apache/cassandra/cql3/Cql.g +++ b/src/java/org/apache/cassandra/cql3/Cql.g @@ -290,19 +290,11 @@ insertStatement returns [UpdateStatement expr] ; usingClause[Attributes attrs] - : K_USING usingClauseObjective[attrs] ( K_AND? usingClauseObjective[attrs] )* - ; - -usingClauseDelete[Attributes attrs] - : K_USING usingClauseDeleteObjective[attrs] ( K_AND? usingClauseDeleteObjective[attrs] )* - ; - -usingClauseDeleteObjective[Attributes attrs] - : K_TIMESTAMP ts=INTEGER { attrs.timestamp = Long.valueOf($ts.text); } + : K_USING usingClauseObjective[attrs] ( K_AND usingClauseObjective[attrs] )* ; usingClauseObjective[Attributes attrs] - : usingClauseDeleteObjective[attrs] + : K_TIMESTAMP ts=INTEGER { attrs.timestamp = Long.valueOf($ts.text); } | K_TTL t=INTEGER { attrs.timeToLive = Integer.valueOf($t.text); } ; @@ -357,6 +349,10 @@ deleteOp returns [Operation.RawDeletion op] | c=cident '[' t=term ']' { $op = new Operation.ElementDeletion(c, t); } ; +usingClauseDelete[Attributes attrs] + : K_USING K_TIMESTAMP ts=INTEGER { attrs.timestamp = Long.valueOf($ts.text); } + ; + /** * BEGIN BATCH * UPDATE <CF> SET name1 = value1 WHERE KEY = keyname1;