mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-22 20:22:44 +03:00
Skip unique constraint enforcement if compiled with SQLITE_OMIT_UNIQUE_ENFORCEMENT.
FossilOrigin-Name: ba85bf8cb88f7ae220d919f5c23f51d9dcedc843
This commit is contained in:
10
src/insert.c
10
src/insert.c
@@ -1310,8 +1310,9 @@ void sqlite3GenerateConstraintChecks(
|
||||
*/
|
||||
for(iCur=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, iCur++){
|
||||
int regIdx;
|
||||
#ifndef SQLITE_OMIT_UNIQUE_ENFORCEMENT
|
||||
int regR;
|
||||
|
||||
#endif
|
||||
if( aRegIdx[iCur]==0 ) continue; /* Skip unused indices */
|
||||
|
||||
/* Create a key for accessing the index entry */
|
||||
@@ -1329,6 +1330,12 @@ void sqlite3GenerateConstraintChecks(
|
||||
sqlite3VdbeChangeP4(v, -1, sqlite3IndexAffinityStr(v, pIdx), 0);
|
||||
sqlite3ExprCacheAffinityChange(pParse, regIdx, pIdx->nColumn+1);
|
||||
|
||||
#ifdef SQLITE_OMIT_UNIQUE_ENFORCEMENT
|
||||
pIdx->onError = OE_None;
|
||||
sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn+1);
|
||||
continue; /* Treat pIdx as if it is not a UNIQUE index */
|
||||
#else
|
||||
|
||||
/* Find out what action to take in case there is an indexing conflict */
|
||||
onError = pIdx->onError;
|
||||
if( onError==OE_None ){
|
||||
@@ -1402,6 +1409,7 @@ void sqlite3GenerateConstraintChecks(
|
||||
}
|
||||
sqlite3VdbeJumpHere(v, j3);
|
||||
sqlite3ReleaseTempReg(pParse, regR);
|
||||
#endif
|
||||
}
|
||||
|
||||
if( pbMayReplace ){
|
||||
|
||||
Reference in New Issue
Block a user