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

Evidence marks and code reformatting for SQLITE_TRACE_STMT operation.

FossilOrigin-Name: e1e022383114525241454f63ea8b9768fb7ec657
This commit is contained in:
drh
2016-07-25 02:42:22 +00:00
parent bd441f7700
commit 5fe63bfb93
3 changed files with 19 additions and 12 deletions

View File

@@ -6782,12 +6782,19 @@ case OP_MaxPgcnt: { /* out2 */
*/
case OP_Init: { /* jump */
char *zTrace;
char *z;
/* If the P4 argument is not NULL, then it must be an SQL comment string.
** The "--" string is broken up to prevent false-positives with srcck1.c.
**
** This assert() provides evidence for:
** EVIDENCE-OF: R-50676-09860 The callback can compute the same text that
** would have been returned by the legacy sqlite3_trace() interface by
** using the X argument when X begins with "--" and invoking
** sqlite3_expanded_sql(P) otherwise.
*/
assert( pOp->p4.z==0 || strncmp(pOp->p4.z, "-" "- ", 3)==0 );
#ifndef SQLITE_OMIT_TRACE
/* If the P4 argument is not NULL, then it must be an SQL comment string.
** The "--" string is broken up to prevent false-positives with srcck1.c */
assert( pOp->p4.z==0 || strncmp(pOp->p4.z, "-" "- ", 3)==0 );
if( (db->mTrace & (SQLITE_TRACE_STMT|SQLITE_TRACE_LEGACY))!=0
&& !p->doingRerun
&& (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0
@@ -6795,7 +6802,7 @@ case OP_Init: { /* jump */
#ifndef SQLITE_OMIT_DEPRECATED
if( db->mTrace & SQLITE_TRACE_LEGACY ){
void (*x)(void*,const char*) = (void(*)(void*,const char*))db->xTrace;
z = sqlite3VdbeExpandSql(p, zTrace);
char *z = sqlite3VdbeExpandSql(p, zTrace);
x(db->pTraceArg, z);
sqlite3_free(z);
}else