aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2021-09-17 13:07:15 +0000
committerdrh <>2021-09-17 13:07:15 +0000
commit3780f9a4aa4a2c4a08c15d9d17cb2de8ad6d2bb5 (patch)
tree5f8a6308af6b070a4664f07fbda28608d9632368 /src
parent89b1715415fc8663d817e4415a1c87d53ff5041e (diff)
downloadsqlite-3780f9a4aa4a2c4a08c15d9d17cb2de8ad6d2bb5.tar.gz
sqlite-3780f9a4aa4a2c4a08c15d9d17cb2de8ad6d2bb5.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/expr.c4
-rw-r--r--src/func.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/expr.c b/src/expr.c
index 34f14e368..d85d21eb1 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 292db73e8..b47378a3b 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 ),