diff options
Diffstat (limited to 'src/insert.c')
-rw-r--r-- | src/insert.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/insert.c b/src/insert.c index 2a6d74db2..e522d4664 100644 --- a/src/insert.c +++ b/src/insert.c @@ -1471,15 +1471,6 @@ void sqlite3GenerateConstraintChecks( onError = OE_Abort; } - if( isUpdate ){ - /* pkChng!=0 does not mean that the rowid has changed, only that - ** it might have changed. Skip the conflict logic below if the rowid - ** is unchanged. */ - sqlite3VdbeAddOp3(v, OP_Eq, regNewData, addrRowidOk, regOldData); - sqlite3VdbeChangeP5(v, SQLITE_NOTNULL); - VdbeCoverage(v); - } - /* figure out whether or not upsert applies in this case */ if( pUpsert && pUpsert->pUpsertIdx==0 ){ if( pUpsert->pUpsertSet==0 ){ @@ -1506,6 +1497,15 @@ void sqlite3GenerateConstraintChecks( sAddr.ipkTop = sqlite3VdbeAddOp0(v, OP_Goto)+1; } + if( isUpdate ){ + /* pkChng!=0 does not mean that the rowid has changed, only that + ** it might have changed. Skip the conflict logic below if the rowid + ** is unchanged. */ + sqlite3VdbeAddOp3(v, OP_Eq, regNewData, addrRowidOk, regOldData); + sqlite3VdbeChangeP5(v, SQLITE_NOTNULL); + VdbeCoverage(v); + } + /* Check to see if the new rowid already exists in the table. Skip ** the following conflict logic if it does not. */ VdbeNoopComment((v, "uniqueness check for ROWID")); |