diff options
Diffstat (limited to 'src/vdbeblob.c')
-rw-r--r-- | src/vdbeblob.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vdbeblob.c b/src/vdbeblob.c index 5e809fc78..dd08b0b8a 100644 --- a/src/vdbeblob.c +++ b/src/vdbeblob.c @@ -478,6 +478,7 @@ int sqlite3_index_writer( Vdbe *v = 0; int regRec; /* Register to assemble record in */ int *aiCol = 0; + const char *zAffinity = 0; /* Affinity string for the current index */ sqlite3_mutex_enter(db->mutex); sqlite3BtreeEnterAll(db); @@ -499,6 +500,7 @@ int sqlite3_index_writer( goto index_writer_out; } pTab = pIdx->pTable; + zAffinity = sqlite3IndexAffinityStr(v, pIdx); /* Populate the two output variables, *pnCol and *pnAiCol. */ *pnCol = pIdx->nColumn; @@ -548,7 +550,7 @@ int sqlite3_index_writer( regRec = ++pParse->nMem; if( bDelete==0 ){ - sqlite3VdbeAddOp3(v, OP_MakeRecord, 1, pIdx->nColumn, regRec); + sqlite3VdbeAddOp4(v, OP_MakeRecord, 1, pIdx->nColumn, regRec, zAffinity, 0); /* If this is a UNIQUE index, check the constraint. */ if( pIdx->onError ){ @@ -561,6 +563,7 @@ int sqlite3_index_writer( sqlite3VdbeAddOp2(v, OP_IdxInsert, 0, regRec); }else{ /* Code the IdxDelete to remove the entry from the b-tree index. */ + sqlite3VdbeAddOp4(v, OP_Affinity, 0, pIdx->nColumn, 0, zAffinity, 0); sqlite3VdbeAddOp3(v, OP_IdxDelete, 0, 1, pIdx->nColumn); } sqlite3FinishCoding(pParse); |