aboutsummaryrefslogtreecommitdiff
path: root/src/insert.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2015-10-22 20:54:33 +0000
committerdan <dan@noemail.net>2015-10-22 20:54:33 +0000
commitfd261ec67efbb3a6e1c22f55f0999bae224ebce6 (patch)
tree29cd5389111dfb90a8d3f7ce9e29aeaff3885f77 /src/insert.c
parent7ef855f156175964bb2d193208776044144b8f32 (diff)
downloadsqlite-fd261ec67efbb3a6e1c22f55f0999bae224ebce6.tar.gz
sqlite-fd261ec67efbb3a6e1c22f55f0999bae224ebce6.zip
Modifications to pass a flag to internal routine sqlite3BtreeCursor() when a cursor that is used solely for deleting b-tree entries, or for obtaining the components of keys to delete from other b-trees, is opened.
FossilOrigin-Name: cdc92919e600007cae5eb61223684f48a65babc0
Diffstat (limited to 'src/insert.c')
-rw-r--r--src/insert.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/insert.c b/src/insert.c
index 9274b0771..3d213a8d3 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -762,7 +762,7 @@ void sqlite3Insert(
/* If this is not a view, open the table and and all indices */
if( !isView ){
int nIdx;
- nIdx = sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenWrite, -1, 0,
+ nIdx = sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenWrite, 0, -1, 0,
&iDataCur, &iIdxCur);
aRegIdx = sqlite3DbMallocRaw(db, sizeof(int)*(nIdx+1));
if( aRegIdx==0 ){
@@ -1650,6 +1650,7 @@ int sqlite3OpenTableAndIndices(
Parse *pParse, /* Parsing context */
Table *pTab, /* Table to be opened */
int op, /* OP_OpenRead or OP_OpenWrite */
+ u8 p5, /* P5 value for OP_Open* instructions */
int iBase, /* Use this for the table cursor, if there is one */
u8 *aToOpen, /* If not NULL: boolean for each table and index */
int *piDataCur, /* Write the database source cursor number here */
@@ -1662,6 +1663,7 @@ int sqlite3OpenTableAndIndices(
Vdbe *v;
assert( op==OP_OpenRead || op==OP_OpenWrite );
+ assert( op==OP_OpenWrite || p5==0 );
if( IsVirtual(pTab) ){
/* This routine is a no-op for virtual tables. Leave the output
** variables *piDataCur and *piIdxCur uninitialized so that valgrind
@@ -1689,6 +1691,7 @@ int sqlite3OpenTableAndIndices(
if( aToOpen==0 || aToOpen[i+1] ){
sqlite3VdbeAddOp3(v, op, iIdxCur, pIdx->tnum, iDb);
sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
+ sqlite3VdbeChangeP5(v, p5);
VdbeComment((v, "%s", pIdx->zName));
}
}