mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-19 21:43:15 +03:00
The SET DEFAULT and SET NULL conflict resolution actions for foreign key
constraints should cause an error when they appear on a generated column. FossilOrigin-Name: b47513d2b32b61ba42c1e9b59287d28f6fee231e6c65de2a3aa19effbbaf1e7f
This commit is contained in:
10
src/fkey.c
10
src/fkey.c
@@ -1269,7 +1269,15 @@ static Trigger *fkActionTrigger(
|
||||
sqlite3ExprAlloc(db, TK_ID, &tNew, 0),
|
||||
sqlite3ExprAlloc(db, TK_ID, &tToCol, 0));
|
||||
}else if( action==OE_SetDflt ){
|
||||
Expr *pDflt = pFKey->pFrom->aCol[iFromCol].pDflt;
|
||||
Column *pCol = pFKey->pFrom->aCol + iFromCol;
|
||||
Expr *pDflt;
|
||||
if( pCol->colFlags & COLFLAG_GENERATED ){
|
||||
testcase( pCol->colFlags & COLFLAG_VIRTUAL );
|
||||
testcase( pCol->colFlags & COLFLAG_STORED );
|
||||
pDflt = 0;
|
||||
}else{
|
||||
pDflt = pCol->pDflt;
|
||||
}
|
||||
if( pDflt ){
|
||||
pNew = sqlite3ExprDup(db, pDflt, 0);
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user