1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-19 21:43:15 +03:00

Small optimization in FK handling.

FossilOrigin-Name: e0d25913b73a813f5987aa70b364b00f19351663
This commit is contained in:
mistachkin
2016-02-25 21:38:28 +00:00
parent 27b6649f39
commit 9d970c3c93
3 changed files with 11 additions and 10 deletions

View File

@@ -1162,11 +1162,12 @@ static Trigger *fkActionTrigger(
int iAction = (pChanges!=0); /* 1 for UPDATE, 0 for DELETE */
action = pFKey->aAction[iAction];
pTrigger = pFKey->apTrigger[iAction];
if( (db->flags & SQLITE_DeferFKs) && action==OE_Restrict ){
if( action==OE_Restrict && (db->flags & SQLITE_DeferFKs) ){
return 0;
}
pTrigger = pFKey->apTrigger[iAction];
if( action!=OE_None && !pTrigger ){
char const *zFrom; /* Name of child table */
int nFrom; /* Length in bytes of zFrom */