diff options
author | dan <dan@noemail.net> | 2010-04-24 14:33:08 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2010-04-24 14:33:08 +0000 |
commit | 9de7943783c0100d606fd082effcbb34044fe6b5 (patch) | |
tree | f5d91cbcedcb0f8db50565d1fb983659b7ced6be /src/callback.c | |
parent | 4f08d4b848136d5ec8e486b409e1ea8398f088f1 (diff) | |
parent | 545f587fc8564075dafeb6a324fde43079b87a11 (diff) | |
download | sqlite-9de7943783c0100d606fd082effcbb34044fe6b5.tar.gz sqlite-9de7943783c0100d606fd082effcbb34044fe6b5.zip |
Merge with [0291ed974d].
Merge with [0291ed974d].
Merge with [0291ed974d].
FossilOrigin-Name: a352f6285e33a806fbe4475e720e763fdc5bb47d
Diffstat (limited to 'src/callback.c')
-rw-r--r-- | src/callback.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/callback.c b/src/callback.c index e6c51bccd..c016959fd 100644 --- a/src/callback.c +++ b/src/callback.c @@ -353,14 +353,19 @@ FuncDef *sqlite3FindFunction( /* If no match is found, search the built-in functions. ** + ** If the SQLITE_PreferBuiltin flag is set, then search the built-in + ** functions even if a prior app-defined function was found. And give + ** priority to built-in functions. + ** ** Except, if createFlag is true, that means that we are trying to ** install a new function. Whatever FuncDef structure is returned will ** have fields overwritten with new information appropriate for the ** new function. But the FuncDefs for built-in functions are read-only. ** So we must not search for built-ins when creating a new function. */ - if( !createFlag && !pBest ){ + if( !createFlag && (pBest==0 || (db->flags & SQLITE_PreferBuiltin)!=0) ){ FuncDefHash *pHash = &GLOBAL(FuncDefHash, sqlite3GlobalFunctions); + bestScore = 0; p = functionSearch(pHash, h, zName, nName); while( p ){ int score = matchQuality(p, nArg, enc); |