mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Change the OP_Trace opcode to OP_Init and give it the ability to jump to the
initialization code at the bottom of the program, thus avoiding the need for an extra OP_Goto. FossilOrigin-Name: 192dea97316144f15f6dd0eabff08a0bf9ef203e
This commit is contained in:
15
src/select.c
15
src/select.c
@@ -1615,11 +1615,7 @@ Vdbe *sqlite3GetVdbe(Parse *pParse){
|
||||
Vdbe *v = pParse->pVdbe;
|
||||
if( v==0 ){
|
||||
v = pParse->pVdbe = sqlite3VdbeCreate(pParse);
|
||||
#ifndef SQLITE_OMIT_TRACE
|
||||
if( v ){
|
||||
sqlite3VdbeAddOp0(v, OP_Trace);
|
||||
}
|
||||
#endif
|
||||
if( v ) sqlite3VdbeAddOp0(v, OP_Init);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
@@ -4537,15 +4533,6 @@ int sqlite3Select(
|
||||
*/
|
||||
int addrTop;
|
||||
pItem->regReturn = ++pParse->nMem;
|
||||
/* Before coding the OP_Goto to jump to the start of the main routine,
|
||||
** ensure that the jump to the verify-schema routine has already
|
||||
** been coded. Otherwise, the verify-schema would likely be coded as
|
||||
** part of the co-routine. If the main routine then accessed the
|
||||
** database before invoking the co-routine for the first time (for
|
||||
** example to initialize a LIMIT register from a sub-select), it would
|
||||
** be doing so without having verified the schema version and obtained
|
||||
** the required db locks. See ticket d6b36be38. */
|
||||
sqlite3CodeVerifySchema(pParse, -1);
|
||||
sqlite3VdbeAddOp0(v, OP_Goto);
|
||||
addrTop = sqlite3VdbeAddOp1(v, OP_OpenPseudo, pItem->iCursor);
|
||||
sqlite3VdbeChangeP5(v, 1);
|
||||
|
||||
Reference in New Issue
Block a user