Issue Details (XML | Word | Printable)

Key: BAM-2201
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Mark Chaimungkalanont [Atlassian]
Reporter: Benjamin LERMAN
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Bamboo

Bamboo use a unexistant SQL function with postgreSQL

Created: 08/Feb/08 03:30 PM   Updated: 01/Apr/08 07:03 PM
Component/s: Database (Postgresql)
Affects Version/s: 2.0 beta 1
Fix Version/s: 2.0 beta 2, 2.0

Time Tracking:
Not Specified

Environment: Using tomcat as application server, sun JDK 1.5 on Linux with PostgreSQL as Database.

Participants: Benjamin LERMAN and Mark Chaimungkalanont [Atlassian]
Since last comment: 47 weeks, 4 days ago
Number of comments: 1
Labels:


 Description  « Hide
With postgresql, when I try to define which builder to use, only Script is available, even if others builders are defined.

Looking at the log I saw:

net.sf.hibernate.util.JDBCExceptionReporter logExceptions ATTENTION: SQL Error: 0, SQLState: 42883
net.sf.hibernate.util.JDBCExceptionReporter logExceptions GRAVE: ERROR: function locate(character varying, character varying) does not exist

I added the two following functions to my database (not sure the second is needed)

CREATE OR REPLACE FUNCTION locate("substring" "varchar", string "varchar")
RETURNS int4 AS
'select position(lower($1) in lower($2));'
LANGUAGE 'sql' VOLATILE;
CREATE OR REPLACE FUNCTION locate("substring" "varchar", string "varchar", "position" int4)
RETURNS int4 AS
$BODY$select CASE WHEN locate($1, substring($2, $3)) = 0
THEN 0
ELSE
$3 + locate($1, substring($2, $3)) - 1
END$BODY$
LANGUAGE 'sql' VOLATILE;

and after that bamboo seems to be working just fine.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Mark Chaimungkalanont [Atlassian] added a comment - 10/Feb/08 09:52 PM
Benjamin,

Thanks so much for the bug report + workaround. We'll get on to this ASAP.

Cheers,

Mark C