[jira] [Commented] (JCR-4042) Adding Escape Character in GQL
[ https://issues.apache.org/jira/browse/JCR-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15695644#comment-15695644 ] Julian Reschke commented on JCR-4042: - trunk: [r1768684|http://svn.apache.org/r1768684] 2.12: [r1771290|http://svn.apache.org/r1771290] > Adding Escape Character in GQL > -- > > Key: JCR-4042 > URL: https://issues.apache.org/jira/browse/JCR-4042 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-commons >Reporter: Ankit Agarwal >Assignee: Vikas Saurabh > Labels: candidate_jcr_2_12 > Fix For: 2.13.5, 2.12.6, 2.14 > > Attachments: JCR-4042.take1.patch > > > Currently GQL does not have a escape character. Adding the escape character > will help in special character cases for example where a search term contains > both colon ({{:}}) and quote ({{"}}) character. > for example search string is {{foo:bar}}, if term is put in quote > {{"foo:bar"}} and this whole term is considered as a single search value. > But in case user need to search {{foo"abc:bar}} then putting this term in > quotes won't work. But if GQL will have a escape character, then user can > search this term using escape character. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (JCR-4042) Adding Escape Character in GQL
[ https://issues.apache.org/jira/browse/JCR-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15647416#comment-15647416 ] Julian Reschke commented on JCR-4042: - I do not plan the next 2.13 release before early December, so yes, there'd be time to add more tests. > Adding Escape Character in GQL > -- > > Key: JCR-4042 > URL: https://issues.apache.org/jira/browse/JCR-4042 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-commons >Reporter: Ankit Agarwal >Assignee: Vikas Saurabh > Attachments: JCR-4042.take1.patch > > > Currently GQL does not have a escape character. Adding the escape character > will help in special character cases for example where a search term contains > both colon ({{:}}) and quote ({{"}}) character. > for example search string is {{foo:bar}}, if term is put in quote > {{"foo:bar"}} and this whole term is considered as a single search value. > But in case user need to search {{foo"abc:bar}} then putting this term in > quotes won't work. But if GQL will have a escape character, then user can > search this term using escape character. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (JCR-4042) Adding Escape Character in GQL
[ https://issues.apache.org/jira/browse/JCR-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15647338#comment-15647338 ] Vikas Saurabh commented on JCR-4042: I want to commit the current patch. [~tmueller], [~reschke], we can probably add more tests later. wdyt? > Adding Escape Character in GQL > -- > > Key: JCR-4042 > URL: https://issues.apache.org/jira/browse/JCR-4042 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-commons >Reporter: Ankit Agarwal >Assignee: Vikas Saurabh > Attachments: JCR-4042.take1.patch > > > Currently GQL does not have a escape character. Adding the escape character > will help in special character cases for example where a search term contains > both colon ({{:}}) and quote ({{"}}) character. > for example search string is {{foo:bar}}, if term is put in quote > {{"foo:bar"}} and this whole term is considered as a single search value. > But in case user need to search {{foo"abc:bar}} then putting this term in > quotes won't work. But if GQL will have a escape character, then user can > search this term using escape character. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (JCR-4042) Adding Escape Character in GQL
[ https://issues.apache.org/jira/browse/JCR-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15643006#comment-15643006 ] Ankit Agarwal commented on JCR-4042: patch looks good to me. > Adding Escape Character in GQL > -- > > Key: JCR-4042 > URL: https://issues.apache.org/jira/browse/JCR-4042 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-commons >Reporter: Ankit Agarwal >Assignee: Vikas Saurabh > Attachments: JCR-4042.take1.patch > > > Currently GQL does not have a escape character. Adding the escape character > will help in special character cases for example where a search term contains > both colon(:) and quote(") character. > for example search string is foo:bar, if term is put in quote "foo:bar" and > this whole term is considered as a single search value. > But in case user need to search foo"abc:bar then putting this term in quotes > won't work. But if GQL will have a escape character, then user can search > this term using escape character. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (JCR-4042) Adding Escape Character in GQL
[ https://issues.apache.org/jira/browse/JCR-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15601928#comment-15601928 ] Vikas Saurabh commented on JCR-4042: [~reschke], bq. Let's just treat "\something" as "something" consistently. That's consistent with current patch. What I was trying to point out was that behavior of {{:}} is unique wrt to other (special or non-special) characters in the sense: | |*escaped*|*non escaped*| |*colon within* double quotes| literal | literal | |*double-quotes within* double quotes| literal | end-double-quotes | |*back-slash within* double quotes| literal | escape-sequence-prefix | |*other within* double quotes| literal | literal | |*colon outside* double quotes| literal | field-delimeter | |*double-quotes outside* double quotes| literal | begin-double-quotes | |*back-slash outside* double quotes| literal | escape-sequence-prefix | |*other outside* double quotes| literal | literal | i.e. unescaped {{:}} outside of quotes behaves different within double quotes as compared to without (other special characters always need to be escaped to be taken literally... otoh, other non-special-characters are always taken literally). > Adding Escape Character in GQL > -- > > Key: JCR-4042 > URL: https://issues.apache.org/jira/browse/JCR-4042 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-commons >Reporter: Ankit Agarwal > Attachments: JCR-4042.take1.patch > > > Currently GQL does not have a escape character. Adding the escape character > will help in special character cases for example where a search term contains > both colon(:) and quote(") character. > for example search string is foo:bar, if term is put in quote "foo:bar" and > this whole term is considered as a single search value. > But in case user need to search foo"abc:bar then putting this term in quotes > won't work. But if GQL will have a escape character, then user can search > this term using escape character. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (JCR-4042) Adding Escape Character in GQL
[ https://issues.apache.org/jira/browse/JCR-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15601568#comment-15601568 ] Julian Reschke commented on JCR-4042: - Sounds good in general. That said, I'd be careful with handling escaping inconsistently due to compat concerns. Let's just treat "\something" as "something" consistently. > Adding Escape Character in GQL > -- > > Key: JCR-4042 > URL: https://issues.apache.org/jira/browse/JCR-4042 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-commons >Reporter: Ankit Agarwal > Attachments: JCR-4042.take1.patch > > > Currently GQL does not have a escape character. Adding the escape character > will help in special character cases for example where a search term contains > both colon(:) and quote(") character. > for example search string is foo:bar, if term is put in quote "foo:bar" and > this whole term is considered as a single search value. > But in case user need to search foo"abc:bar then putting this term in quotes > won't work. But if GQL will have a escape character, then user can search > this term using escape character. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (JCR-4042) Adding Escape Character in GQL
[ https://issues.apache.org/jira/browse/JCR-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15593968#comment-15593968 ] Amit Gupta commented on JCR-4042: - yeah we need another character as escape sequence prefix. i.e. backslash, then this could serve as escape sequence for any(other) character. > Adding Escape Character in GQL > -- > > Key: JCR-4042 > URL: https://issues.apache.org/jira/browse/JCR-4042 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-commons >Reporter: Ankit Agarwal > > Currently GQL does not have a escape character. Adding the escape character > will help in special character cases for example where a search term contains > both colon(:) and quote(") character. > for example search string is foo:bar, if term is put in quote "foo:bar" and > this whole term is considered as a single search value. > But in case user need to search foo"abc:bar then putting this term in quotes > won't work. But if GQL will have a escape character, then user can search > this term using escape character. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (JCR-4042) Adding Escape Character in GQL
[ https://issues.apache.org/jira/browse/JCR-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15593116#comment-15593116 ] Vikas Saurabh commented on JCR-4042: [~amitgupt], bq. just need escape character for colon Pedantically speaking simple escaping won't work. There are probably 2 ways that we can think of escaping: # use double colon to represent an escaped colon # use another character (probably backslash) as escape sequence prefix For case#1, there's no way to disambiguate {{a:::b}} between {{a:":b"}} and {{"a:":b}}... unless, we then also say that field names can't end in colon (which, afaik, isn't a restriction put by gql as of now). For case#2, it'd require a list (of at least 2 characters - {{:}} and {{\}} )... and once we have a list why not put more (say double-quotes). Btw, I think to maintain backward compatibility - colon would need to be allowed without escaping if quoted -> so, {{"a:b"}} must remain similar to {{a\:b}} and not {{a:b}}. > Adding Escape Character in GQL > -- > > Key: JCR-4042 > URL: https://issues.apache.org/jira/browse/JCR-4042 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-commons >Reporter: Ankit Agarwal > > Currently GQL does not have a escape character. Adding the escape character > will help in special character cases for example where a search term contains > both colon(:) and quote(") character. > for example search string is foo:bar, if term is put in quote "foo:bar" and > this whole term is considered as a single search value. > But in case user need to search foo"abc:bar then putting this term in quotes > won't work. But if GQL will have a escape character, then user can search > this term using escape character. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (JCR-4042) Adding Escape Character in GQL
[ https://issues.apache.org/jira/browse/JCR-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15590912#comment-15590912 ] Julian Reschke commented on JCR-4042: - Well, you need a way to quote the quote character -- unless it's not allowed in the text anyway, in which case that needs to be described in the API. > Adding Escape Character in GQL > -- > > Key: JCR-4042 > URL: https://issues.apache.org/jira/browse/JCR-4042 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-commons >Reporter: Ankit Agarwal > > Currently GQL does not have a escape character. Adding the escape character > will help in special character cases for example where a search term contains > both colon(:) and quote(") character. > for example search string is foo:bar, if term is put in quote "foo:bar" and > this whole term is considered as a single search value. > But in case user need to search foo"abc:bar then putting this term in quotes > won't work. But if GQL will have a escape character, then user can search > this term using escape character. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (JCR-4042) Adding Escape Character in GQL
[ https://issues.apache.org/jira/browse/JCR-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15590868#comment-15590868 ] Amit Gupta commented on JCR-4042: - [~julian.resc...@gmx.de] IUC, do we just need escape character for colon. As colon is the only special character for current gql implementation. If we have escape character for colon, then we don't need to use quote and thus no escaping for quotes. > Adding Escape Character in GQL > -- > > Key: JCR-4042 > URL: https://issues.apache.org/jira/browse/JCR-4042 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-commons >Reporter: Ankit Agarwal > > Currently GQL does not have a escape character. Adding the escape character > will help in special character cases for example where a search term contains > both colon(:) and quote(") character. > for example search string is foo:bar, if term is put in quote "foo:bar" and > this whole term is considered as a single search value. > But in case user need to search foo"abc:bar then putting this term in quotes > won't work. But if GQL will have a escape character, then user can search > this term using escape character. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (JCR-4042) Adding Escape Character in GQL
[ https://issues.apache.org/jira/browse/JCR-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15575326#comment-15575326 ] Julian Reschke commented on JCR-4042: - I agree that this is a major shortcoming. If there's a way to quote strings, the API needs to specify how the quote character can be embedded into quoted strings. > Adding Escape Character in GQL > -- > > Key: JCR-4042 > URL: https://issues.apache.org/jira/browse/JCR-4042 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-commons >Reporter: Ankit Agarwal > > Currently GQL does not have a escape character. Adding the escape character > will help in special character cases for example where a search term contains > both colon(:) and quote(") character. > for example search string is foo:bar, if term is put in quote "foo:bar" and > this whole term is considered as a single search value. > But in case user need to search foo"abc:bar then putting this term in quotes > won't work. But if GQL will have a escape character, then user can search > this term using escape character. -- This message was sent by Atlassian JIRA (v6.3.4#6332)