cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michał Szczygieł (JIRA) <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-13958) [CQL] Inconsistent handling double dollar sign for strings
Date Wed, 08 Nov 2017 20:16:00 GMT

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

Michał Szczygieł commented on CASSANDRA-13958:
----------------------------------------------

Thank you for the comments [~snazy]. I'm very new to the C* community and codebase and I was
not aware that test method naming is a strict convention (which I personally don't like, because
{{@Test}} already says that it's a test). Of course I'm going to change it and use the convention.

Regarding the tests and the behavior itself. I think I should change the approach and actually
stop accepting leading and trailing dollars (or accept at most one on each side to be consistent
and not break compatibility). Trailing is not a problem, but leading dollars may introduce
confusion - should {{$$$$,$$$$}} be interpreted as {{$$,$$}} or two empty strings separated
by a comma?

> [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: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message