1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Move the query flattener turn-off from a pragma to an sqlite3_test_control()

call.  Make provisions (not yet implemented) to turn off other optimizers
using the same call.

FossilOrigin-Name: 4a97c623f4e190134de4b2ca406e311034a74797
This commit is contained in:
drh
2009-12-22 23:52:32 +00:00
parent 3540c1f7b8
commit 07096f68ae
8 changed files with 75 additions and 50 deletions

View File

@@ -2281,6 +2281,22 @@ int sqlite3_test_control(int op, ...){
break;
}
/* sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS, sqlite3 *db, int N)
**
** Enable or disable various optimizations for testing purposes. The
** argument N is a bitmask of optimizations to be disabled. For normal
** operation N should be 0. The idea is that a test program (like the
** SQL Logic Test or SLT test module) can run the same SQL multiple times
** with various optimizations disabled to verify that the same answer
** is obtained in every case.
*/
case SQLITE_TESTCTRL_OPTIMIZATIONS: {
sqlite3 *db = va_arg(ap, sqlite3*);
int x = va_arg(ap,int);
db->flags = (x & SQLITE_OptMask) | (db->flags & ~SQLITE_OptMask);
break;
}
}
va_end(ap);
#endif /* SQLITE_OMIT_BUILTIN_TEST */