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

New test-control that returns the number of calls to

sqlite3BtreeMovetoUnpacked() on the main database and then resets the
counter.  This only works for SQLITE_DEBUG builds.

FossilOrigin-Name: dca5b91926431768babac28a6faf7674a5014db95caba727995b470e92b3182a
This commit is contained in:
drh
2020-08-31 18:49:04 +00:00
parent c51ceeb049
commit 37ccfcfeb9
8 changed files with 64 additions and 13 deletions

View File

@@ -4235,6 +4235,24 @@ int sqlite3_test_control(int op, ...){
sqlite3ResultIntReal(pCtx);
break;
}
/* sqlite3_test_control(SQLITE_TESTCTRL_SEEK_COUNT,
** sqlite3 *db, // Database connection
** u64 *pnSeek // Write seek count here
** );
**
** This test-control queries the seek-counter on the "main" database
** file. The seek-counter is written into *pnSeek and is then reset.
** The seek-count is only available if compiled with SQLITE_DEBUG.
*/
case SQLITE_TESTCTRL_SEEK_COUNT: {
sqlite3 *db = va_arg(ap, sqlite3*);
u64 *pn = va_arg(ap, sqlite3_uint64*);
*pn = sqlite3BtreeSeekCount(db->aDb->pBt);
break;
}
}
va_end(ap);
#endif /* SQLITE_UNTESTABLE */