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 C7C417A9F for ; Fri, 22 Jul 2011 19:39:20 +0000 (UTC) Received: (qmail 77569 invoked by uid 500); 22 Jul 2011 19:39:20 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 77477 invoked by uid 500); 22 Jul 2011 19:39:19 -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 77469 invoked by uid 99); 22 Jul 2011 19:39:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2011 19:39:19 +0000 X-ASF-Spam-Status: No, hits=-2001.1 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2011 19:39:18 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 242DE571EE for ; Fri, 22 Jul 2011 19:38:58 +0000 (UTC) Date: Fri, 22 Jul 2011 19:38:58 +0000 (UTC) From: "Blake Visin (JIRA)" To: commits@cassandra.apache.org Message-ID: <1092063566.15395.1311363538144.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1629897886.15390.1311363298085.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CASSANDRA-2939) CQL regex to match column family in query MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-2939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069692#comment-13069692 ] Blake Visin commented on CASSANDRA-2939: ---------------------------------------- How do I do code blocks? The regex's don't show up correctly in the description and the syntax is underlining it. > CQL regex to match column family in query > ----------------------------------------- > > Key: CASSANDRA-2939 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2939 > Project: Cassandra > Issue Type: Bug > Components: Drivers > Environment: Python CQL > Reporter: Blake Visin > Labels: CQL, python > > In the file cursor.py (https://svn.apache.org/repos/asf/cassandra/drivers/py/cql/cursor.py) > Line 37: _cfamily_re = re.compile("\s*SELECT\s+.+\s+FROM\s+[\']?(\w+)", re.I | re.M) > The Regex will improperly match anything after the word 'from' even if it is in the WHERE clause > I believe the fix is: > _cfamily_re = re.compile("\s*SELECT\s+.+?\s+FROM\s+[\']?(\w+)", re.I | re.M) > Added the ? so the regex is not so greedy > use this query to reproduce the results: > SELECT key FROM column_family WHERE key = 'break from chores'" -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira