diff options
author | dan <dan@noemail.net> | 2014-09-15 10:44:24 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2014-09-15 10:44:24 +0000 |
commit | d54e06ca5ef35bc5cfbd840881065b819482ec16 (patch) | |
tree | 8619d4b8e342323ee30f25877bad0d42e457e31c /src/vdbeblob.c | |
parent | a690402b4cab21b9243a206134d1e2eed41f605a (diff) | |
download | sqlite-d54e06ca5ef35bc5cfbd840881065b819482ec16.tar.gz sqlite-d54e06ca5ef35bc5cfbd840881065b819482ec16.zip |
Add OP_Affinity opcodes to the VMs generated by sqlite3_index_writer().
FossilOrigin-Name: b9b38cb8e21826ddfb4c87a1f166ad33c3c7b6eb
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); |