SQLite

View Ticket
Login
Ticket Hash: 4776dee07aa8026fa2eaeed947bd65e2e5f545ec
Title: Documentation and code about registering functions
Status: Closed Type: Documentation
Severity: Minor Priority: Immediate
Subsystem: Documentation Resolution: Overcome_By_Events
Last Modified: 2011-10-13 13:52:23
Version Found In: 3.6.14.2
Description:
There are some issues mainly about mismatches/omissions between documentation, requirements and the code.

The relevant documentation is at http://www.sqlite.org/c3ref/create_function.html

"Any attempt to create a function with a longer name will result in SQLITE_ERROR being returned."

Actually SQLITE_MISUSE is returned.

From http://www.sqlite.org/cvstrac/tktview?tn=3886

It says that the first time you call create_function it overrides the builtin function of the same name. Subsequent calls only override if nArg is the same. This (overriding builtins) is not mentioned in any requirements specs. The specs and documentation should also mention that if you delete all user defined variants of a function then the builtin will "resurface". Also that you can't delete the builtins (at least that is how the code in sqlite3FindFunction appears to work always searching builtins if matchquality is zero for user defined functions).