You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Sébastien Launay (JIRA)" <ji...@apache.org> on 2008/02/21 20:55:19 UTC

[jira] Created: (JCR-1408) Invalid query results when using jcr:like with a case transform function and a pattern not starting with a wildcard

Invalid query results when using jcr:like with a case transform function and a pattern not starting with a wildcard
-------------------------------------------------------------------------------------------------------------------

                 Key: JCR-1408
                 URL: https://issues.apache.org/jira/browse/JCR-1408
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-core, query
    Affects Versions: core 1.4.1, 1.4
         Environment: Ubuntu gutsy, Sun JDK 1.5.0_08
            Reporter: Sébastien Launay


If the repository contains nodes with the following value for the property name :
john
JOhn
joe
Joey

and we run the following query :
//element(*, document)/*[jcr:like(fn:lower-case(@name), 'joh%')]")
then all the previous nodes will match especially the last 2 nodes.

The reason is the use of two range scans from the lucene term index:
..._name_jOH
..................
..._name_joh_

and

..._name_JOH
..................
..._name_Joh_

The first range will contains ..._name_joe property and the second will contains ..._name_Joey.
But the pattern 'joh%' and so the regexp '.*' because of the range scan will match
the substring values of the properties ('' in the first range and 'y' in the second range).

The solution is to use the full pattern (ie 'joh.*') for matching each properties.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1408) Invalid query results when using jcr:like with a case transform function and a pattern not starting with a wildcard

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger updated JCR-1408:
----------------------------------

    Fix Version/s: core 1.4.2

Merged change into 1.4 branch in revision: 630183

> Invalid query results when using jcr:like with a case transform function and a pattern not starting with a wildcard
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1408
>                 URL: https://issues.apache.org/jira/browse/JCR-1408
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core, query
>    Affects Versions: 1.4, core 1.4.1
>         Environment: Ubuntu gutsy, Sun JDK 1.5.0_08
>            Reporter: Sébastien Launay
>             Fix For: core 1.4.2, 1.5
>
>         Attachments: jackrabbit-1.4.x-query-like.patch
>
>
> If the repository contains nodes with the following value for the property name :
> john
> JOhn
> joe
> Joey
> and we run the following query :
> //element(*, document)/*[jcr:like(fn:lower-case(@name), 'joh%')]")
> then all the previous nodes will match especially the last 2 nodes.
> The reason is the use of two range scans from the lucene term index:
> ..._name_jOH
> ..................
> ..._name_joh_
> and
> ..._name_JOH
> ..................
> ..._name_Joh_
> The first range will contains ..._name_joe property and the second will contains ..._name_Joey.
> But the pattern 'joh%' and so the regexp '.*' because of the range scan will match
> the substring values of the properties ('' in the first range and 'y' in the second range).
> The solution is to use the full pattern (ie 'joh.*') for matching each properties.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1408) Invalid query results when using jcr:like with a case transform function and a pattern not starting with a wildcard

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-1408:
-------------------------------

    Fix Version/s:     (was: 1.5)

> Invalid query results when using jcr:like with a case transform function and a pattern not starting with a wildcard
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1408
>                 URL: https://issues.apache.org/jira/browse/JCR-1408
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core, query
>    Affects Versions: 1.4, core 1.4.1
>         Environment: Ubuntu gutsy, Sun JDK 1.5.0_08
>            Reporter: Sébastien Launay
>             Fix For: core 1.4.2
>
>         Attachments: jackrabbit-1.4.x-query-like.patch
>
>
> If the repository contains nodes with the following value for the property name :
> john
> JOhn
> joe
> Joey
> and we run the following query :
> //element(*, document)/*[jcr:like(fn:lower-case(@name), 'joh%')]")
> then all the previous nodes will match especially the last 2 nodes.
> The reason is the use of two range scans from the lucene term index:
> ..._name_jOH
> ..................
> ..._name_joh_
> and
> ..._name_JOH
> ..................
> ..._name_Joh_
> The first range will contains ..._name_joe property and the second will contains ..._name_Joey.
> But the pattern 'joh%' and so the regexp '.*' because of the range scan will match
> the substring values of the properties ('' in the first range and 'y' in the second range).
> The solution is to use the full pattern (ie 'joh.*') for matching each properties.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-1408) Invalid query results when using jcr:like with a case transform function and a pattern not starting with a wildcard

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger resolved JCR-1408.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5

Applied patch to trunk.

Thank you for reporting this issue.

svn revision: 630140

> Invalid query results when using jcr:like with a case transform function and a pattern not starting with a wildcard
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1408
>                 URL: https://issues.apache.org/jira/browse/JCR-1408
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core, query
>    Affects Versions: 1.4, core 1.4.1
>         Environment: Ubuntu gutsy, Sun JDK 1.5.0_08
>            Reporter: Sébastien Launay
>             Fix For: 1.5
>
>         Attachments: jackrabbit-1.4.x-query-like.patch
>
>
> If the repository contains nodes with the following value for the property name :
> john
> JOhn
> joe
> Joey
> and we run the following query :
> //element(*, document)/*[jcr:like(fn:lower-case(@name), 'joh%')]")
> then all the previous nodes will match especially the last 2 nodes.
> The reason is the use of two range scans from the lucene term index:
> ..._name_jOH
> ..................
> ..._name_joh_
> and
> ..._name_JOH
> ..................
> ..._name_Joh_
> The first range will contains ..._name_joe property and the second will contains ..._name_Joey.
> But the pattern 'joh%' and so the regexp '.*' because of the range scan will match
> the substring values of the properties ('' in the first range and 'y' in the second range).
> The solution is to use the full pattern (ie 'joh.*') for matching each properties.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1408) Invalid query results when using jcr:like with a case transform function and a pattern not starting with a wildcard

Posted by "Sébastien Launay (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sébastien Launay updated JCR-1408:
----------------------------------

    Attachment: jackrabbit-1.4.x-query-like.patch

The patch fixing this issue for the 1.4 branch with the test case to reproduce it.

> Invalid query results when using jcr:like with a case transform function and a pattern not starting with a wildcard
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1408
>                 URL: https://issues.apache.org/jira/browse/JCR-1408
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core, query
>    Affects Versions: 1.4, core 1.4.1
>         Environment: Ubuntu gutsy, Sun JDK 1.5.0_08
>            Reporter: Sébastien Launay
>         Attachments: jackrabbit-1.4.x-query-like.patch
>
>
> If the repository contains nodes with the following value for the property name :
> john
> JOhn
> joe
> Joey
> and we run the following query :
> //element(*, document)/*[jcr:like(fn:lower-case(@name), 'joh%')]")
> then all the previous nodes will match especially the last 2 nodes.
> The reason is the use of two range scans from the lucene term index:
> ..._name_jOH
> ..................
> ..._name_joh_
> and
> ..._name_JOH
> ..................
> ..._name_Joh_
> The first range will contains ..._name_joe property and the second will contains ..._name_Joey.
> But the pattern 'joh%' and so the regexp '.*' because of the range scan will match
> the substring values of the properties ('' in the first range and 'y' in the second range).
> The solution is to use the full pattern (ie 'joh.*') for matching each properties.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.