Bugs item #541507, was opened at 2002-04-09 06:30
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=541507&group_id=22866
Category: JBossCMP
Group: v3.0 Rabbit Hole
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Marco Ladermann (mpl)
Assigned to: Dain Sundstrom (dsundstrom)
Summary: Wrong PostgreSQL function mapping for locate
Initial Comment:
The function mapping for PostgreSQL of the
string function "locate" is wrong.
locate("lookup", "test", 2)
returns with the definition
(position(?2 in substring(?1 from ?3))+?3)
the value "2"
therefore I suggest that the following
mapping should be used:
(coalesce(nullif(position(?2 in substring(?1
from ?3)), 0) + ?3 -1, 0))
Greetings
Marco
----------------------------------------------------------------------
>Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-04-09 10:44
Message:
Logged In: YES
user_id=251431
Updated according to your comments in the followup.
----------------------------------------------------------------------
Comment By: Marco Ladermann (mpl)
Date: 2002-04-09 10:09
Message:
Logged In: YES
user_id=246541
I just found found in the JDBC specification that
the semantic of the locate function is as follows:
Strings are based one and the second argument is
searched for containment of the first argument. If
the search is unsuccessfull 0 is returned.
Therefore my suggestion should be read as:
(coalesce(nullif(position(?1 in substring(?2
from ?3)), 0) + ?3 -1, 0))
Greetings
Marco
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=541507&group_id=22866
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development