1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

A SELECT statement inside the body of a TRIGGER uses the SRT_Discard target

to discard the query results.  Such selects are intended to be used to call
user-defined functions for their side-effects.  They do not return results. (CVS 594)

FossilOrigin-Name: f8041f3d4d3350b4086cd6ba3e9006bdde8546a9
This commit is contained in:
drh
2002-05-27 12:24:48 +00:00
parent c754fa5486
commit d7489c3987
5 changed files with 22 additions and 18 deletions

View File

@@ -480,13 +480,7 @@ static int codeTriggerProgram(
pParse->trigStack->orconf = orconf;
switch( pTriggerStep->op ){
case TK_SELECT: {
int tmp_tbl = pParse->nTab++;
sqliteVdbeAddOp(pParse->pVdbe, OP_OpenTemp, tmp_tbl, 0);
sqliteVdbeAddOp(pParse->pVdbe, OP_KeyAsData, tmp_tbl, 1);
sqliteSelect(pParse, pTriggerStep->pSelect, SRT_Union,
tmp_tbl, 0, 0, 0);
sqliteVdbeAddOp(pParse->pVdbe, OP_Close, tmp_tbl, 0);
pParse->nTab--;
sqliteSelect(pParse, pTriggerStep->pSelect, SRT_Discard, 0, 0, 0, 0);
break;
}
case TK_UPDATE: {