In the command-line shell add the (undocumented and unsupported) ".eqp"
command and -eqp command-line option, to cause EXPLAIN QUERY PLAN to be
run on each SQL statement as it is evaluated. Intended use is for analysis
of the query planner.
(check-in: e6ecf733 user: drh tags: trunk)

** Return true if a memory cell is not marked as invalid. This macro
** is for use inside assert() statements only.
*/
#ifdef SQLITE_DEBUG
#define memIsValid(M) ((M)->flags & MEM_Undefined)==0
#endif
/*
** Each auxilliary data pointer stored by a user defined function
** implementation calling sqlite3_set_auxdata() is stored in an instance
** of this structure. All such structures associated with a single VM
** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed
** when the VM is halted (if not before).
*/

** Return true if a memory cell is not marked as invalid. This macro
** is for use inside assert() statements only.
*/
#ifdef SQLITE_DEBUG
#define memIsValid(M) ((M)->flags & MEM_Undefined)==0
#endif
/*** A sanity check on a Mem object and especially the Mem.z field.** This check says that no more than one of the following may be true:** (1) Mem.z comes from Mem.zMalloc** (2) Mem.z has a destructor Mem.xDel** (3) Mem.z is an ephemeral string** (4) Mem.z is a static string**** Use only inside of an assert() as follows: assert( memSanify(pMem) );*/#ifdef SQLITE_DEBUG#define memSanity1(p) \ ((((p)->zMalloc && (p)->zMalloc==(p)->z) ? 1 : 0) + \ ((((p)->flags&MEM_Dyn)&&(p)->xDel) ? 1 : 0) + \ (((p)->flags&MEM_Ephem) ? 1 : 0) + \ (((p)->flags&MEM_Static) ? 1 : 0) <= 1 )#endif
/*
** Each auxilliary data pointer stored by a user defined function
** implementation calling sqlite3_set_auxdata() is stored in an instance
** of this structure. All such structures associated with a single VM
** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed
** when the VM is halted (if not before).
*/

Changes to src/vdbeaux.c.

1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229

for(pEnd=&p[N]; p<pEnd; p++){
sqlite3DbFree(db, p->zMalloc);
}
return;
}
for(pEnd=&p[N]; p<pEnd; p++){
assert( (&p[1])==pEnd || p[0].db==p[1].db );
/* This block is really an inlined version of sqlite3VdbeMemRelease()
** that takes advantage of the fact that the memory cell value is
** being set to NULL after releasing any dynamic resources.
**
** The justification for duplicating code is that according to
** callgrind, this causes a certain test case to hit the CPU 4.7

for(pEnd=&p[N]; p<pEnd; p++){
sqlite3DbFree(db, p->zMalloc);
}
return;
}
for(pEnd=&p[N]; p<pEnd; p++){
assert( (&p[1])==pEnd || p[0].db==p[1].db );
assert( memSanity1(p) );
/* This block is really an inlined version of sqlite3VdbeMemRelease()
** that takes advantage of the fact that the memory cell value is
** being set to NULL after releasing any dynamic resources.
**
** The justification for duplicating code is that according to
** callgrind, this causes a certain test case to hit the CPU 4.7