aboutsummaryrefslogtreecommitdiff
path: root/src/insert.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2018-12-29 02:26:59 +0000
committerdrh <drh@noemail.net>2018-12-29 02:26:59 +0000
commitec4ccdbcb1bd9d129888b38f209ed36bbe38a5d8 (patch)
treeaff455cde56406dac489f5097da7ff4eaa480ebb /src/insert.c
parent81f9159b5ec0e19d9aafee9c03a13bc4e7735cd8 (diff)
downloadsqlite-ec4ccdbcb1bd9d129888b38f209ed36bbe38a5d8.tar.gz
sqlite-ec4ccdbcb1bd9d129888b38f209ed36bbe38a5d8.zip
A new implementation of sqlite3VdbeMakeLabel() is faster and makes fewer
memory allocations by deferring memory allocation until sqlite3VdbeResolveLabel() is called, at which point the code generator has a better idea of how big the relocation table needs to be. The sqlite3VdbeMakeLabel() routine now takes a Parse* parameter instead of Vdbe*. FossilOrigin-Name: 4a0929ac76d8aa5dd65eac3b83d6bbf41e505e01d175ca0fb2b19ba02d439415
Diffstat (limited to 'src/insert.c')
-rw-r--r--src/insert.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/insert.c b/src/insert.c
index 59049dbc3..46b60e49e 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -866,7 +866,7 @@ void sqlite3Insert(
/* Run the BEFORE and INSTEAD OF triggers, if there are any
*/
- endOfLoop = sqlite3VdbeMakeLabel(v);
+ endOfLoop = sqlite3VdbeMakeLabel(pParse);
if( tmask & TRIGGER_BEFORE ){
int regCols = sqlite3GetTempRange(pParse, pTab->nCol+1);
@@ -1356,7 +1356,7 @@ void sqlite3GenerateConstraintChecks(
switch( onError ){
case OE_Replace: {
assert( onError==OE_Replace );
- addr1 = sqlite3VdbeMakeLabel(v);
+ addr1 = sqlite3VdbeMakeLabel(pParse);
sqlite3VdbeAddOp2(v, OP_NotNull, regNewData+1+i, addr1);
VdbeCoverage(v);
sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regNewData+1+i);
@@ -1407,7 +1407,7 @@ void sqlite3GenerateConstraintChecks(
** updated so there is no point it verifying the check constraint */
continue;
}
- allOk = sqlite3VdbeMakeLabel(v);
+ allOk = sqlite3VdbeMakeLabel(pParse);
sqlite3VdbeVerifyAbortable(v, onError);
sqlite3ExprIfTrue(pParse, pExpr, allOk, SQLITE_JUMPIFNULL);
if( onError==OE_Ignore ){
@@ -1474,7 +1474,7 @@ void sqlite3GenerateConstraintChecks(
** exist in the table.
*/
if( pkChng && pPk==0 ){
- int addrRowidOk = sqlite3VdbeMakeLabel(v);
+ int addrRowidOk = sqlite3VdbeMakeLabel(pParse);
/* Figure out what action to take in case of a rowid collision */
onError = pTab->keyConf;
@@ -1624,7 +1624,7 @@ void sqlite3GenerateConstraintChecks(
VdbeComment((v, "Skip upsert subroutine"));
sqlite3VdbeJumpHere(v, upsertJump);
}else{
- addrUniqueOk = sqlite3VdbeMakeLabel(v);
+ addrUniqueOk = sqlite3VdbeMakeLabel(pParse);
}
if( bAffinityDone==0 && (pUpIdx==0 || pUpIdx==pIdx) ){
sqlite3TableAffinity(v, pTab, regNewData+1);