1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Change the OP_Insert opcode to read the key and data to insert from memory cells, not the stack. (CVS 4666)

FossilOrigin-Name: 46501f490a5f5577ea31c758df749e02c7c65f39
This commit is contained in:
danielk1977
2008-01-03 09:51:55 +00:00
parent 11641c1136
commit 1f4aa337cd
13 changed files with 108 additions and 79 deletions

View File

@@ -237,10 +237,14 @@ void sqlite3FinishTrigger(
{ OP_String8, 0, 0, 0 }, /* 6: SQL */
{ OP_Concat, 0, 0, 0 },
{ OP_MakeRecord, 5, 0, 0 }, /* 8: "aaada" */
{ OP_MemStore, 0, 1, 0 }, /* 9: Store data */
{ OP_MemStore, 0, 1, 0 }, /* 10: Store key */
{ OP_Insert, 0, 0, 0 },
};
int addr;
Vdbe *v;
int iKey = pParse->nMem++;
int iData = pParse->nMem++;
/* Make an entry in the sqlite_master table */
v = sqlite3GetVdbe(pParse);
@@ -254,6 +258,10 @@ void sqlite3FinishTrigger(
sqlite3VdbeChangeP4(v, addr+5, "CREATE TRIGGER ", P4_STATIC);
sqlite3VdbeChangeP4(v, addr+6, (char*)pAll->z, pAll->n);
sqlite3VdbeChangeP4(v, addr+8, "aaada", P4_STATIC);
sqlite3VdbeChangeP1(v, addr+9, iData);
sqlite3VdbeChangeP2(v, addr+11, iData);
sqlite3VdbeChangeP1(v, addr+10, iKey);
sqlite3VdbeChangeP3(v, addr+11, iKey);
sqlite3ChangeCookie(db, v, iDb);
sqlite3VdbeAddOp2(v, OP_Close, 0, 0);
sqlite3VdbeAddOp4(v, OP_ParseSchema, iDb, 0, 0, sqlite3MPrintf(