db-derby-dev mailing list archives

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

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

Oleksandr Alesinskyy commented on DERBY-1949:
---------------------------------------------

It seems obvious (to me :) ) that returned value shall be 0.
Derby documentation on LOCATE clearly states "If the substring is not found,
LOCATE returns 0".  And there is no chance to find non-empty substring in the empty 
string .

More subtle case is when both string and substring are empty. But even in this case
0 seems to be right value (and consistent with other DBMS as far as I know, save the 
Oracle that agains the SQL standard treats empty strings as nulls ).

Regards,
Oleksandr


> 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
>
> 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