You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Mamta A. Satoor (JIRA)" <ji...@apache.org> on 2007/07/05 18:54:04 UTC

[jira] Resolved: (DERBY-2777) Parameters should take their collation from the context in which they are getting used rather than the current compilation schema

     [ https://issues.apache.org/jira/browse/DERBY-2777?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor resolved DERBY-2777.
------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 10.3.0.0)
                   10.4.0.0
                   10.3.1.1

Fixed the parameter collation setting for LIKE clause in both main (revision 553557) and 10.3.1.1 (revision 553560). The commit comments are as follows and it explains the fix

DERBY-2777

Currently, the parameters in LIKE clause always pickup their collation from the compilation schema. That logic is not 
complete. I am fixing that logic here along with addition of some tests.

For the sake of explanation, let me use the following syntax for LIKE clause
receiver LIKE leftOperand ESCAPE rightOperand
With the fix in this patch, if receiver is a parameter, it will set it's collation using following logic
1)check if leftOperand is not a parameter. If yes, then receiver will pick up collation from leftOperand. If not, goto step 2
2)check if rightOperand is not a parameter. If yes, then receiver will pick up collation from rightOperand. If not, goto step 3
3)receiver picks up the collation of the compilation schema because everything in the LIKE clause is ?

Next, if leftOperand is a parameter, it will set it's collation using receiver. By this time, even if receiver is a
parameter, we have set correct collation for receiver and hence leftOperand can simply rely on receiver for correct
collation IF leftOperand is a parameter.

Next, if rightOperand is a parameter, it will set it's collation using receiver. By this time, even if receiver is a
parameter, we have set correct collation for receiver and hence rightOperand can simply rely on receiver for correct
collation IF rightOperand is a parameter.


> Parameters should take their collation from the context in which they are getting used rather than the current compilation schema
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2777
>                 URL: https://issues.apache.org/jira/browse/DERBY-2777
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>            Assignee: Mamta A. Satoor
>             Fix For: 10.3.1.1, 10.4.0.0
>
>
> With revision 542646, changes were made so that parameters will take their collation from current compilation schema. But based on the following thread http://www.nabble.com/Collation-and-parameter-markers-(-)-tf3866040.html , using the collation from the context would be the correct thing to do for the parameters.

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