[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Employee search question for 1.3



On Mon, Jun 20, 2011 at 12:59 PM, John Locke <..hidden..> wrote:
> Ok. Ran across a different issue related to the new tax account stuff,
> that might be related.
>
> LedgerSMB::DBObject provides an object wrapper around stored functions
> -- when called with a method that is not populated in the class
> definition, it looks for a stored function of that name, and then parses
> the parameters that function takes and populates a query with those
> properties on the object itself.
>
> The problem is when there are multiple functions with the same name, but
> a different parameter signature. I had two different account__save
> functions in my database, and the DBObject was picking the old one with
> fewer parameters. After deleting that, I got the new updated function.
> And of course, since the signature had changed, CREATE OR UPDATE
> FUNCTION didn't delete the old one.


Right.  I corrected Erik's script after the fact.  Drop the function
with fewer arguments.

If you want to check for other functions which might be accidently
overloaded, cd to the sql/modules/test directory (you have to be
working from that directory), open psql, and run:
\i System.sql

Best Wishes,
Chris Travers