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

Robert Stupp commented on CASSANDRA-13958:
------------------------------------------

Not a complete review or so and I haven't tried the patch at all. But some 
thoughts on the patch:
* The unit test method names should continue to start with {{test}} (not 
{{should}}). Nice work on the separation of the test methods though.
* I see that the test checks for three {{$}} signs. Would love to see checks 
with four or more dollar signs (leading, middle and trailing) in various 
combinations and spanning multiple lines. Both for the unit and cqlsh tests. An 
algorithmic approach to test those combinations might be beneficial over coding 
all combinations manually.
* The last point (many combinations) should also work for multiple parameters 
to a single statement - especially to verify that statements like {{INSERT INTO 
tab (x,y,z) VALUES ($$$$foo$$, $$poiewf$ewfi$$$$$, $$$$ewfpioj$$$$$$)}} work.


> [CQL] Inconsistent handling double dollar sign for strings
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-13958
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13958
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>            Reporter: Hugo Picado
>            Assignee: Michał Szczygieł
>            Priority: Minor
>
> Double dollar signs is a [built-in method for escaping columns that may 
> contain single quotes in its 
> content](https://docs.datastax.com/en/cql/3.3/cql/cql_reference/escape_char_r.html).
>  The way this is handled however is not consistent, in the sense that it 
> allows for $ to appear in the middle of the string but not in the last char.
> *Examples:*
> Valid: insert into users(id, name) values(1, $$john$$)
> Inserts the string *john*
> Valid: insert into users(id, name) values(1, $$jo$hn$$)
> Inserts the string *jo$hn*
> Valid: insert into users(id, name) values(1, $$$john$$)
> Inserts the string *$john*
> Invalid: insert into users(id, name) values(1, $$john$$$)
> Fails with:
> {code}
> Invalid syntax at line 1, char 48
>   insert into users(id, name) values(1, $$john$$$);
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to