db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Waagan (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-1949) locate function returns invalid value when first parameter is empty string
Date Wed, 28 Mar 2007 09:49:32 GMT

    [ https://issues.apache.org/jira/browse/DERBY-1949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484790
] 

Kristian Waagan commented on DERBY-1949:
----------------------------------------

In a patch I recently reviewed:
             if (searchStr == "")
                 return start; // match DB2's SQL LOCATE function

This was for a Clob method, where you specified the string to search for and the starting
position in the Clob. I don't even think the start position is verified beyond making sure
it is not less than 1.
The code above was not new in the patch, but has been around for a while.

> locate function returns invalid value when first parameter is empty string
> --------------------------------------------------------------------------
>
>                 Key: DERBY-1949
>                 URL: https://issues.apache.org/jira/browse/DERBY-1949
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.3.1, 10.2.1.6
>         Environment: N/A
>            Reporter: Oleksandr Alesinskyy
>         Assigned To: Bryan Pendleton
>         Attachments: docs.diff, rrefsqlj61998.html
>
>
> locate function returns false invalid when first parameter is empty string,
> e.g. 
> values(locate('','A')
> results in 1, which is obviously wrong

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


Mime
View raw message