mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +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:
18
src/vdbe.c
18
src/vdbe.c
@@ -6144,16 +6144,26 @@ case OP_MaxPgcnt: { /* out2-prerelease */
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef SQLITE_OMIT_TRACE
|
||||
/* Opcode: Trace * * * P4 *
|
||||
/* Opcode: Init * P2 * P4 *
|
||||
** Synopsis: Start at P2
|
||||
**
|
||||
** Programs contain a single instance of this opcode as the very first
|
||||
** opcode.
|
||||
**
|
||||
** If tracing is enabled (by the sqlite3_trace()) interface, then
|
||||
** the UTF-8 string contained in P4 is emitted on the trace callback.
|
||||
** Or if P4 is blank, use the string returned by sqlite3_sql().
|
||||
**
|
||||
** If P2 is not zero, jump to instruction P2.
|
||||
*/
|
||||
case OP_Trace: {
|
||||
case OP_Init: { /* jump */
|
||||
char *zTrace;
|
||||
char *z;
|
||||
|
||||
if( pOp->p2 ){
|
||||
pc = pOp->p2 - 1;
|
||||
}
|
||||
#ifndef SQLITE_OMIT_TRACE
|
||||
if( db->xTrace
|
||||
&& !p->doingRerun
|
||||
&& (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0
|
||||
@@ -6179,9 +6189,9 @@ case OP_Trace: {
|
||||
sqlite3DebugPrintf("SQL-trace: %s\n", zTrace);
|
||||
}
|
||||
#endif /* SQLITE_DEBUG */
|
||||
#endif /* SQLITE_OMIT_TRACE */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Opcode: Noop * * * * *
|
||||
|
Reference in New Issue
Block a user