1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Alternative implementation of ".selecttrace" and ".wheretrace" that uses

a test-control rather than global variables.

FossilOrigin-Name: d36d6f2923a2393c751c0ac7634433453be20df7567fd914e57cbb1ae15f68b2
This commit is contained in:
drh
2020-12-04 01:17:57 +00:00
parent 384f5c26f4
commit c0622a4d03
11 changed files with 91 additions and 93 deletions

View File

@@ -4255,7 +4255,28 @@ int sqlite3_test_control(int op, ...){
break;
}
/* sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, op, ptr)
**
** "ptr" is a pointer to a u32.
**
** op==0 Store the current sqlite3SelectTrace in *ptr
** op==1 Set sqlite3SelectTrace to the value *ptr
** op==3 Store the current sqlite3WhereTrace in *ptr
** op==3 Set sqlite3WhereTrace to the value *ptr
*/
case SQLITE_TESTCTRL_TRACEFLAGS: {
#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
int op = va_arg(ap, int);
u32 *ptr = va_arg(ap, u32*);
switch( op ){
case 0: *ptr = sqlite3SelectTrace; break;
case 1: sqlite3SelectTrace = *ptr; break;
case 2: *ptr = sqlite3WhereTrace; break;
case 3: sqlite3WhereTrace = *ptr; break;
}
break;
#endif
}
}
va_end(ap);
#endif /* SQLITE_UNTESTABLE */