aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/expr.c b/src/expr.c
index ecc6c7928..883273b3b 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -3621,6 +3621,20 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
return sqlite3ExprCodeTarget(pParse, pFarg->a[0].pExpr, target);
}
+ /* The AFFINITY() function evaluates to a string that describes
+ ** the type affinity of the argument. This is used for testing of
+ ** the SQLite type logic.
+ */
+ if( pDef->funcFlags & SQLITE_FUNC_AFFINITY ){
+ const char *azAff[] = { "blob", "text", "numeric", "integer", "real" };
+ char aff;
+ assert( nFarg==1 );
+ aff = sqlite3ExprAffinity(pFarg->a[0].pExpr);
+ sqlite3VdbeLoadString(v, target,
+ aff ? azAff[aff-SQLITE_AFF_BLOB] : "none");
+ return target;
+ }
+
for(i=0; i<nFarg; i++){
if( i<32 && sqlite3ExprIsConstant(pFarg->a[i].pExpr) ){
testcase( i==31 );