Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 350361174F for ; Sat, 19 Apr 2014 01:18:45 +0000 (UTC) Received: (qmail 1932 invoked by uid 500); 19 Apr 2014 01:18:37 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 1863 invoked by uid 500); 19 Apr 2014 01:18:36 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 1843 invoked by uid 99); 19 Apr 2014 01:18:36 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Apr 2014 01:18:36 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C5427992328; Sat, 19 Apr 2014 01:18:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mishail@apache.org To: commits@cassandra.apache.org Date: Sat, 19 Apr 2014 01:18:35 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [01/10] git commit: cqlsh: Updated CQL3 parser to support functions and BLOB literals Repository: cassandra Updated Branches: refs/heads/cassandra-1.2 87097066e -> 13d3a4746 refs/heads/cassandra-2.0 ba95a68ab -> 167af2b25 refs/heads/cassandra-2.1 22d86eb2d -> 477a0a28b refs/heads/trunk c65973d2d -> 894d6f67a cqlsh: Updated CQL3 parser to support functions and BLOB literals patch by Mikhail Stepura; reviewed by Aleksey Yeschenko for CASSANDRA-7018 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/13d3a474 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/13d3a474 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/13d3a474 Branch: refs/heads/cassandra-1.2 Commit: 13d3a47461af24fbd4b2ddee71a7042168ed860f Parents: 8709706 Author: Mikhail Stepura Authored: Wed Apr 16 21:10:18 2014 -0700 Committer: Mikhail Stepura Committed: Fri Apr 18 18:01:41 2014 -0700 ---------------------------------------------------------------------- CHANGES.txt | 1 + bin/cqlsh | 2 +- pylib/cqlshlib/cql3handling.py | 24 ++++++++++++++++++------ 3 files changed, 20 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/13d3a474/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index bb08a37..bf80e1e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ * Non-droppable verbs shouldn't be dropped from OTC (CASSANDRA-6980) * Shutdown batchlog executor in SS#drain() (CASSANDRA-7025) * Fix batchlog to account for CF truncation records (CASSANDRA-6999) + * Fix CQLSH parsing of functions and BLOB literals (CASSANDRA-7018) 1.2.16 http://git-wip-us.apache.org/repos/asf/cassandra/blob/13d3a474/bin/cqlsh ---------------------------------------------------------------------- diff --git a/bin/cqlsh b/bin/cqlsh index 4bf1b76..8e1e0e2 100755 --- a/bin/cqlsh +++ b/bin/cqlsh @@ -133,7 +133,7 @@ if os.path.exists(OLD_HISTORY): DEFAULT_HOST = 'localhost' DEFAULT_PORT = 9160 -DEFAULT_CQLVER = '3' +DEFAULT_CQLVER = '3.0.5' DEFAULT_TRANSPORT_FACTORY = 'cqlshlib.tfactory.regular_transport_factory' DEFAULT_TIME_FORMAT = '%Y-%m-%d %H:%M:%S%z' http://git-wip-us.apache.org/repos/asf/cassandra/blob/13d3a474/pylib/cqlshlib/cql3handling.py ---------------------------------------------------------------------- diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py index 50e2015..b04ba1d 100644 --- a/pylib/cqlshlib/cql3handling.py +++ b/pylib/cqlshlib/cql3handling.py @@ -206,6 +206,7 @@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n\r]*([\n\r]|$)|[/][*].*?[*][/])/ ; ::= /'([^']|'')*'/ ; ::= /"([^"]|"")*"/ ; ::= /-?[0-9]+\.[0-9]+/ ; + ::= /0x[0-9a-f]+/ ; ::= /[0-9]+/ ; ::= /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/ ; ::= /[a-z][a-z0-9_]*/ ; @@ -230,10 +231,15 @@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n\r]*([\n\r]|$)|[/][*].*?[*][/])/ ; | | | + | + | ; + ::= "(" ( ( "," )* )? ")" + ; + ::= token="TOKEN" "(" ( "," )* ")" - | + | ; ::= | @@ -255,6 +261,9 @@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n\r]*([\n\r]|$)|[/][*].*?[*][/])/ ; ::= "{" ":" ( "," ":" )* "}" ; + ::= + ; + ::= | | @@ -739,13 +748,13 @@ syntax_rules += r''' ; ::= "SELECT" "FROM" cf= - ("WHERE" )? - ("ORDER" "BY" ( "," )* )? - ("LIMIT" limit=)? + ( "WHERE" )? + ( "ORDER" "BY" ( "," )* )? + ( "LIMIT" limit= )? ; - ::= ("AND" )* + ::= ( "AND" )* ; - ::= [rel_lhs]= ("=" | "<" | ">" | "<=" | ">=") + ::= [rel_lhs]= ( "=" | "<" | ">" | "<=" | ">=" ) | token="TOKEN" "(" [rel_tokname]= ( "," [rel_tokname]= )* ")" ("=" | "<" | ">" | "<=" | ">=") @@ -758,7 +767,10 @@ syntax_rules += r''' ::= [colname]= | "WRITETIME" "(" [colname]= ")" | "TTL" "(" [colname]= ")" + | ; + ::= "(" ( ( "," )* )? ")" + ; ::= [ordercol]= ( "ASC" | "DESC" )? ; '''