mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Implement the IIF(x,y,z) SQL function that is short-hand for
"CASE WHEN x THEN y ELSE z END". For compatibility with SQL Server. FossilOrigin-Name: fce173cd211b15867369b6a54fad48168352fc83981a722ce98e57299b88608a
This commit is contained in:
@@ -3700,6 +3700,13 @@ static int exprCodeInlineFunction(
|
||||
sqlite3VdbeResolveLabel(v, endCoalesce);
|
||||
break;
|
||||
}
|
||||
case INLINEFUNC_iif: {
|
||||
Expr caseExpr;
|
||||
memset(&caseExpr, 0, sizeof(caseExpr));
|
||||
caseExpr.op = TK_CASE;
|
||||
caseExpr.x.pList = pFarg;
|
||||
return sqlite3ExprCodeTarget(pParse, &caseExpr, target);
|
||||
}
|
||||
|
||||
default: {
|
||||
/* The UNLIKELY() function is a no-op. The result is the value
|
||||
|
||||
Reference in New Issue
Block a user