At 01:32pm on 2012 April 06, Richard Hipp did write: > On Fri, Apr 6, 2012 at 1:54 PM, Jim Ursetto <[email protected]> wrote: > > Create a function foo with 1 argument, encoding UTF8 > > Create a function foo with -1 arguments, encoding UTF8 > > Delete or modify foo with -1 arguments, encoding UTF8 > > - However, nArg != pBest->nArg, so a new function is created > > - And the old function is not destroyed until the database is closed. > > - Existing statements are not expired and continue to refer to the old > > function.
> I followed your recipe above, and step three works correctly for me. The > varargs version of the app-defined function is replace/deleted and the > single argument version continues to operate as it did before. It works (in that the varargs function behavior changes), but it's a newly allocated function, not modified in place. The destructor is not called immediately as it should be, and statements prepared prior to the deletion aren't updated to point to the new function. You should be able to see this sequence by having the destructor generate some output, and/or by preparing a statement before the deletion, I hope. In other words there is a memory leak (until database close) and the potential for outdated statements, but no problem with functionality that I can see. -- 'A novice was trying to fix a broken Lisp machine by turning the power off and on. Knight, seeing what the student was doing, spoke sternly: "You cannot fix a machine by just power-cycling it with no understanding of what is going wrong." Knight turned the machine off and on. The machine worked.' [email protected] / 0x43340710 / 517B C658 D2CB 260D 3E1F 5ED1 6DB3 FBB9 4334 0710 _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

