1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Fix a problem with ON DELETE SET DEFAULT actions.

FossilOrigin-Name: 9406995055f53639b0af46985c7b0a24a80308ae
This commit is contained in:
dan
2009-09-22 16:08:58 +00:00
parent 29c7f9caac
commit 934ce300a0
4 changed files with 50 additions and 9 deletions

View File

@@ -683,7 +683,7 @@ static Trigger *fkActionTrigger(
sqlite3PExpr(pParse, TK_ID, 0, 0, &tToCol)
, 0);
}else if( action==OE_SetDflt ){
Expr *pDflt = pIdx ? 0 : pTab->aCol[pIdx->aiColumn[i]].pDflt;
Expr *pDflt = pFKey->pFrom->aCol[iFromCol].pDflt;
if( pDflt ){
pNew = sqlite3ExprDup(db, pDflt, 0);
}else{