1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Performance improvements and test cases added. Allow "PRAGMA trusted_schema=ON"

FossilOrigin-Name: 30882ca80f6c51f6bb7b2692c1ac3f19a7c61a23aa8730be79aec0ae3ef08d54
This commit is contained in:
drh
2020-01-08 20:37:45 +00:00
parent 0dfa5255bc
commit 2eeca2046e
8 changed files with 62 additions and 23 deletions

View File

@@ -288,12 +288,13 @@ static int matchQuality(
u8 enc /* Desired text encoding */
){
int match;
/* nArg of -2 is a special case */
if( nArg==(-2) ) return (p->xSFunc==0) ? 0 : FUNC_PERFECT_MATCH;
assert( p->nArg>=-1 );
/* Wrong number of arguments means "no match" */
if( p->nArg!=nArg && p->nArg>=0 ) return 0;
if( p->nArg!=nArg ){
if( nArg==(-2) ) return (p->xSFunc==0) ? 0 : FUNC_PERFECT_MATCH;
if( p->nArg>=0 ) return 0;
}
/* Give a better score to a function with a specific number of arguments
** than to function that accepts any number of arguments. */