MySQL Forums
Forum List  »  Stored Procedures

Re: Stored procedure/function appears non-deterministic (and I'm going crazy)
Posted by: Martin Aspeli
Date: November 16, 2005 10:00AM

We may have solved this now ... it's certainly quite strange. If you look at the testVehicleByRule() function, you'll see:

SELECT IF(COUNT(*)=0, True, False)

...

INTO retn;
RETURN retn;

Now, if we rewrite that as:

SELECT COUNT(*)

...

INTO cnt;
IF cnt = 0 THEN
RETURN True;
ELSE
RETURN False;

Suddenly it works reliably again.

It looks to me like IF() may not be thread-safe or something along those lines, which certainly sounds strange. Has anyone heard of any problems with this before?

Martin

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Stored procedure/function appears non-deterministic (and I'm going crazy)
2216
November 16, 2005 10:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.