From: drh <> Date: Fri, 17 Sep 2021 13:07:15 +0000 (+0000) Subject: Make the affinity() function available even if compiled without X-Git-Tag: version-3.37.0~219 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3780f9a4aa4a2c4a08c15d9d17cb2de8ad6d2bb5;p=thirdparty%2Fsqlite.git Make the affinity() function available even if compiled without SQLITE_DEBUG. Surround the implementation of all test-only SQL functions with #ifndef SQLITE_UNTESTABLE. FossilOrigin-Name: b7e00ef8059f6fb5658c6ad6f337cfdf065a5f1b1130452122282f3a69e98a93 --- diff --git a/manifest b/manifest index 96f5e2c6e0..ef566fa2f3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C The\sdbsqlfuzz\sfuzzer\sfound\sa\srefutation\sfor\sa\srecent\sALWAYS()\smacro. -D 2021-09-16T22:23:36.631 +C Make\sthe\saffinity()\sfunction\savailable\seven\sif\scompiled\swithout\nSQLITE_DEBUG.\s\sSurround\sthe\simplementation\sof\sall\stest-only\sSQL\sfunctions\nwith\s#ifndef\sSQLITE_UNTESTABLE. +D 2021-09-17T13:07:15.263 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -497,10 +497,10 @@ F src/date.c e0632f335952b32401482d099321bbf12716b29d6e72836b53ae49683ebae4bf F src/dbpage.c 8a01e865bf8bc6d7b1844b4314443a6436c07c3efe1d488ed89e81719047833a F src/dbstat.c 3aa79fc3aed7ce906e4ea6c10e85d657299e304f6049861fe300053ac57de36c F src/delete.c 3ce6af6b64c8b476de51ccc32da0cb3142d42e65754e1d8118addf65b8bcba15 -F src/expr.c e98375fc63552cc8cdd36a41bdca3039cb603d9fe67abd9c9f40adae8405fbc5 +F src/expr.c ce736caaf1cf6d69789511e9fc5ed31013d9570d5d773cce909d396112d83843 F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007 F src/fkey.c 1905af1821b88321e1bb9d6a69e704495b6844a9b6c29398d40117cc251e893c -F src/func.c 54b059e0f847ca48460e353fd96278f3179585c5cf9f0ee2eff01b449b4bb88d +F src/func.c 812ac5383067bed7150d8597e83c47b714d73db0e62af55811d1a145243e58e1 F src/global.c 612ea60c9acbcb45754c2ed659b4a56936a06814718e969636fedc7e3b889808 F src/hash.c 8d7dda241d0ebdafb6ffdeda3149a412d7df75102cecfc1021c98d6219823b19 F src/hash.h 9d56a9079d523b648774c1784b74b89bd93fac7b365210157482e4319a468f38 @@ -1923,8 +1923,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 f05ae9b5864459493154037d2c902d203c4a43007b5d61bd4beb1eed56e06d13 -Q -778e4499cdf2083d5431738099dedf0aade9271f661e09ca3278e0109bb1e720 -R 412d8988f40528aa27ca17db7091e339 +P ebfc18aaa6506ccac80f297a1792e726972bb39c0b5c8706faadeb8df94a45e9 +R 2b89e9e309868e78306907ed116b8c82 U drh -Z c4a079140a41c7dc2bd45282be1ee73a +Z 9f5272dd467b9f232b6577a308d23359 diff --git a/manifest.uuid b/manifest.uuid index c5b51dccb3..2a2dbbf111 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ebfc18aaa6506ccac80f297a1792e726972bb39c0b5c8706faadeb8df94a45e9 \ No newline at end of file +b7e00ef8059f6fb5658c6ad6f337cfdf065a5f1b1130452122282f3a69e98a93 \ No newline at end of file diff --git a/src/expr.c b/src/expr.c index 34f14e3687..d85d21eb18 100644 --- a/src/expr.c +++ b/src/expr.c @@ -3866,6 +3866,7 @@ static int exprCodeInlineFunction( ** Test-only SQL functions that are only usable if enabled ** via SQLITE_TESTCTRL_INTERNAL_FUNCTIONS */ +#if !defined(SQLITE_UNTESTABLE) case INLINEFUNC_expr_compare: { /* Compare two expressions using sqlite3ExprCompare() */ assert( nFarg==2 ); @@ -3899,7 +3900,6 @@ static int exprCodeInlineFunction( break; } -#ifdef SQLITE_DEBUG case INLINEFUNC_affinity: { /* The AFFINITY() function evaluates to a string that describes ** the type affinity of the argument. This is used for testing of @@ -3913,7 +3913,7 @@ static int exprCodeInlineFunction( (aff<=SQLITE_AFF_NONE) ? "none" : azAff[aff-SQLITE_AFF_BLOB]); break; } -#endif +#endif /* !defined(SQLITE_UNTESTABLE) */ } return target; } diff --git a/src/func.c b/src/func.c index 292db73e87..b47378a3be 100644 --- a/src/func.c +++ b/src/func.c @@ -2123,12 +2123,12 @@ void sqlite3RegisterBuiltinFunctions(void){ */ static FuncDef aBuiltinFunc[] = { /***** Functions only available with SQLITE_TESTCTRL_INTERNAL_FUNCTIONS *****/ +#if !defined(SQLITE_UNTESTABLE) TEST_FUNC(implies_nonnull_row, 2, INLINEFUNC_implies_nonnull_row, 0), TEST_FUNC(expr_compare, 2, INLINEFUNC_expr_compare, 0), TEST_FUNC(expr_implies_expr, 2, INLINEFUNC_expr_implies_expr, 0), -#ifdef SQLITE_DEBUG - TEST_FUNC(affinity, 1, INLINEFUNC_affinity, 0), -#endif + TEST_FUNC(affinity, 1, INLINEFUNC_affinity, 0), +#endif /* !defined(SQLITE_UNTESTABLE) */ /***** Regular functions *****/ #ifdef SQLITE_SOUNDEX FUNCTION(soundex, 1, 0, 0, soundexFunc ),