db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (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 21:09:32 GMT

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

Bryan Pendleton commented on DERBY-1949:

> which operand is which

Thanks Army, I believe you are exactly right. The documentation does not make it clear
which operand is which, and other databases appear to take the arguments in the other
order. For example, here's a reference to Sybase which appears to process the arguments
in the opposite order from Derby:

It's also interesting that the Sybase documentation explicitly says:
"Searching for a zero-length string will return 1."

I propose to update the documentation to make it clear which argument is which in
the LOCATE function, and also to note that searching for a zero-length string returns 1.

Oleksandr, does the LOCATE function's behavior make more sense when you consider
the arguments as being interpreted in the order that Army indicates?

> 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:,
>         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.

View raw message