cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Lerer (JIRA)" <>
Subject [jira] [Updated] (CASSANDRA-7111) Include snippet of CQL query near error in SyntaxError messages
Date Thu, 03 Jul 2014 08:45:26 GMT


Benjamin Lerer updated CASSANDRA-7111:

    Attachment: CASSANDRA-7111-2.txt

The patch is composed of two part (each one in its file). The first part is a refactoring
(inspire from ANTLR version 4) to simplify the fixing of the ticket.
The second part is the actual fix for the ticket.

> Include snippet of CQL query near error in SyntaxError messages
> ---------------------------------------------------------------
>                 Key: CASSANDRA-7111
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: API, Tools
>            Reporter: Tyler Hobbs
>            Assignee: Benjamin Lerer
>              Labels: cql
>             Fix For: 2.1.1
>         Attachments: CASSANDRA-7111-1.txt, CASSANDRA-7111-2.txt
> When a SyntaxError is returned, including a snippet of the query close to the error would
make a lot of error messages easier to understand.  For example, if you did this with the
python driver:
> {code}
> session.execute(SELECT * FROM users WHERE username='%s', ['Joe Smith'])
> {code}
> you would wind up with an extra set of single quotes (the driver automatically escapes
and quotes input).  If a snippet like {{...WHERE username=''Joe Smith''}} were included in
the error message, this would be pretty easy to spot.

This message was sent by Atlassian JIRA

View raw message