[jbosscache-issues] [JBoss JIRA] Resolved: (JBCACHE-1534) JDBCCacheLoader does not escape wildcard characters in generated LIKE clause

Manik Surtani (JIRA) jira-events at lists.jboss.org
Tue Aug 18 06:45:26 EDT 2009


     [ https://jira.jboss.org/jira/browse/JBCACHE-1534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Manik Surtani resolved JBCACHE-1534.
------------------------------------

    Fix Version/s: 3.2.0.GA
       Resolution: Done


> JDBCCacheLoader does not escape wildcard characters in generated LIKE clause
> ----------------------------------------------------------------------------
>
>                 Key: JBCACHE-1534
>                 URL: https://jira.jboss.org/jira/browse/JBCACHE-1534
>             Project: JBoss Cache
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.1.0.GA
>            Reporter: Andrew Duckworth
>            Assignee: Manik Surtani
>             Fix For: 3.2.0.GA
>
>         Attachments: JDBCCacheLoader.java, JDBCCacheLoaderConfig.java
>
>
> JDBCCacheLoader does not escape wildcard characters '_' and '%' in generated LIKE clause. Node removal and recursive child loading generates the following SQL:
>    private String constructRecursiveChildrenSql()
>    {
>       return "SELECT " + fqnColumn + "," + nodeColumn + " FROM " + table + " WHERE " + fqnColumn + " = ? OR " + fqnColumn + " LIKE ?";
>    }
>    @Override
>    protected String constructDeleteNodeSql()
>    {
>       return "DELETE FROM " + table + " WHERE " + fqnColumn + " = ? OR " + fqnColumn + " LIKE ?";
>    }
> If the FQN contains the underscore character, SQL treats this as a match any single character. Similarly if the FQN contains a '%' then it is treated as matching any substring. This means incorrect FQNs may be matched and also causes some RDBs to do an index scan rather than an index seek, leading to greater lock contention in the database and poor performance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosscache-issues mailing list