aboutsummaryrefslogtreecommitdiff
path: root/src/fkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fkey.c')
-rw-r--r--src/fkey.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fkey.c b/src/fkey.c
index 9db3a71c3..a3214a94d 100644
--- a/src/fkey.c
+++ b/src/fkey.c
@@ -925,7 +925,8 @@ int sqlite3FkRequired(
int iKey;
for(iKey=0; iKey<pTab->nCol; iKey++){
Column *pCol = &pTab->aCol[iKey];
- if( (zKey ? !sqlite3StrICmp(pCol->zName, zKey) : pCol->isPrimKey) ){
+ if( (zKey ? !sqlite3StrICmp(pCol->zName, zKey)
+ : (pCol->colFlags & COLFLAG_PRIMKEY)!=0) ){
if( aChange[iKey]>=0 ) return 1;
if( iKey==pTab->iPKey && chngRowid ) return 1;
}