mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Factor out the common operation of setting the Expr.x.pSelect field of an
Expr object into a subroutine. FossilOrigin-Name: 6a5cceee486c5e3625556e4c7076ff90e9d8fa43
This commit is contained in:
16
src/expr.c
16
src/expr.c
@@ -562,6 +562,22 @@ Expr *sqlite3PExpr(
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
** Add pSelect to the Expr.x.pSelect field. Or, if pExpr is NULL (due
|
||||
** do a memory allocation failure) then delete the pSelect object.
|
||||
*/
|
||||
void sqlite3PExprAddSelect(Parse *pParse, Expr *pExpr, Select *pSelect){
|
||||
if( pExpr ){
|
||||
pExpr->x.pSelect = pSelect;
|
||||
ExprSetProperty(pExpr, EP_xIsSelect|EP_Subquery);
|
||||
sqlite3ExprSetHeightAndFlags(pParse, pExpr);
|
||||
}else{
|
||||
assert( pParse->db->mallocFailed );
|
||||
sqlite3SelectDelete(pParse->db, pSelect);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** If the expression is always either TRUE or FALSE (respectively),
|
||||
** then return 1. If one cannot determine the truth value of the
|
||||
|
Reference in New Issue
Block a user