From 78b52203285aa6412bfe9e21ea66ffd18752471c Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 22 Jan 2020 23:08:19 +0000 Subject: [PATCH] Fix a NEVER() macro that can be true if compiled with SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION. Ticket [b985f0bd1636d9bc] FossilOrigin-Name: 9f0f5d593a383ec2bebb6513ad566813f5b3dc6f052c61bcd76e8ac557bbb062 --- manifest | 15 ++++++--------- manifest.uuid | 2 +- src/func.c | 3 +++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 2589a4d0ca..b2cf57e72d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Version\s3.31.0 -D 2020-01-22T18:38:59.573 +C Fix\sa\sNEVER()\smacro\sthat\scan\sbe\strue\sif\scompiled\swith\nSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION.\nTicket\s[b985f0bd1636d9bc] +D 2020-01-22T23:08:19.183 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -486,7 +486,7 @@ F src/delete.c a5c59b9c0251cf7682bc52af0d64f09b1aefc6781a63592c8f1136f7b73c66e4 F src/expr.c 003c59158b33d7f3b198122cb0d1e13c06517cc3932e56b42283eb0e96696d66 F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007 F src/fkey.c 92a248ec0fa4ed8ab60c98d9b188ce173aaf218f32e7737ba77deb2a684f9847 -F src/func.c 92249abc3fd7e52b249ca8eb2d15a617f70819d2fa4c777a4a33552b89bfb322 +F src/func.c 108577cebe8a50c86d849a93b99493a54e348dd0b846f00d13b52ca973d5baf4 F src/global.c 59601d885a0dbbfbd22ed2d030424a5e7f1b9809a17ca46686058bbc4a55e980 F src/hash.c 8d7dda241d0ebdafb6ffdeda3149a412d7df75102cecfc1021c98d6219823b19 F src/hash.h 9d56a9079d523b648774c1784b74b89bd93fac7b365210157482e4319a468f38 @@ -1857,10 +1857,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 4daf94d83319231e42243625c804d5db2d14f10fa5ea1a1f358c3603c47b955b -R 5a98666c879217368b8f21c26d062d92 -T +bgcolor * #d0c0ff -T +sym-release * -T +sym-version-3.31.0 * +P f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824 +R 97a04d4b4b8d22f5094487160af0ab4d U drh -Z 51c630793e0eec473e1274a795f77643 +Z 50e2a3e6d4ad40b8e57cb89c95ba8068 diff --git a/manifest.uuid b/manifest.uuid index f3f9cddef5..f74435ea5e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824 \ No newline at end of file +9f0f5d593a383ec2bebb6513ad566813f5b3dc6f052c61bcd76e8ac557bbb062 \ No newline at end of file diff --git a/src/func.c b/src/func.c index 36ab571760..966a0075e4 100644 --- a/src/func.c +++ b/src/func.c @@ -1864,6 +1864,9 @@ int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){ assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); nExpr = pExpr->x.pList->nExpr; pDef = sqlite3FindFunction(db, pExpr->u.zToken, nExpr, SQLITE_UTF8, 0); +#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION + if( pDef==0 ) return 0; +#endif if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){ return 0; }