[ 
https://issues.apache.org/jira/browse/CASSANDRA-7769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14136197#comment-14136197
 ] 

Tyler Hobbs commented on CASSANDRA-7769:
----------------------------------------

This seems reasonable, but I have a couple of comments:

First, you left a couple of unit tests in UFTest that use the {{$foo$}} style 
strings.

Second, when those tests run, they fail (as expected), but the error message 
says the reason is "StringIndexOutOfBoundsException String index out of range: 
47".  After editing QueryProcessor to expose the original stacktrace, it looks 
like there's a problem with the error message builder.  Here's the stacktrace 
(ignore the test name, I moved things around):

{noformat}
    [junit] java.lang.StringIndexOutOfBoundsException: String index out of 
range: 47
    [junit]     at java.lang.String.substring(String.java:1907)
    [junit]     at 
org.apache.cassandra.cql3.ErrorCollector.appendSnippet(ErrorCollector.java:149)
    [junit]     at 
org.apache.cassandra.cql3.ErrorCollector.appendQuerySnippet(ErrorCollector.java:120)
    [junit]     at 
org.apache.cassandra.cql3.ErrorCollector.syntaxError(ErrorCollector.java:79)
    [junit]     at 
org.apache.cassandra.cql3.CqlParser.displayRecognitionError(CqlParser.java:301)
    [junit]     at 
org.antlr.runtime.BaseRecognizer.reportError(BaseRecognizer.java:186)
    [junit]     at 
org.apache.cassandra.cql3.CqlParser.createFunctionStatement(CqlParser.java:4077)
    [junit]     at 
org.apache.cassandra.cql3.CqlParser.cqlStatement(CqlParser.java:947)
    [junit]     at org.apache.cassandra.cql3.CqlParser.query(CqlParser.java:373)
    [junit]     at 
org.apache.cassandra.cql3.QueryProcessor.parseStatement(QueryProcessor.java:484)
    [junit]     at 
org.apache.cassandra.cql3.QueryProcessor.getStatement(QueryProcessor.java:459)
    [junit]     at 
org.apache.cassandra.cql3.QueryProcessor.parseStatement(QueryProcessor.java:235)
    [junit]     at 
org.apache.cassandra.cql3.QueryProcessor.executeOnceInternal(QueryProcessor.java:329)
    [junit]     at 
org.apache.cassandra.cql3.CQLTester.execute(CQLTester.java:242)
    [junit]     at 
org.apache.cassandra.cql3.PgStringTest.testPgSyleFunction(PgStringTest.java:41)
{noformat}

> Implement pg-style dollar syntax for string constants
> -----------------------------------------------------
>
>                 Key: CASSANDRA-7769
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7769
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Robert Stupp
>            Assignee: Robert Stupp
>             Fix For: 3.0
>
>         Attachments: 7769.txt, 7769v2.txt, 7769v3.txt, 7769v4.txt
>
>
> Follow-up of CASSANDRA-7740:
> {{$function$...$function$}} in addition to string style variant.
> See also 
> http://www.postgresql.org/docs/9.1/static/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to