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

Add SQLITE_TESTCTRL_LOGEST and enhance the LogEst utility program.

Improvements to testability of bloom filters.

FossilOrigin-Name: 88b43d798cc5aa59855e92d3e658aee9f0a5def6ffbc5db77af048d75ecdf8cc
This commit is contained in:
drh
2021-12-09 01:28:15 +00:00
parent fb82caf0be
commit 7e910f6422
11 changed files with 66 additions and 45 deletions

View File

@@ -4347,6 +4347,26 @@ int sqlite3_test_control(int op, ...){
break;
}
/* sqlite3_test_control(SQLITE_TESTCTRL_LOGEST,
** double fIn, // Input value
** int *pLogEst, // sqlite3LogEstFromDouble(fIn)
** u64 *pInt, // sqlite3LogEstToInt(*pLogEst)
** int *pLogEst2 // sqlite3LogEst(*pInt)
** );
**
** Test access for the LogEst conversion routines.
*/
case SQLITE_TESTCTRL_LOGEST: {
double rIn = va_arg(ap, double);
LogEst rLogEst = sqlite3LogEstFromDouble(rIn);
u64 iInt = sqlite3LogEstToInt(rLogEst);
va_arg(ap, int*)[0] = rLogEst;
va_arg(ap, u64*)[0] = iInt;
va_arg(ap, int*)[0] = sqlite3LogEst(iInt);
break;
}
#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_WSD)
/* sqlite3_test_control(SQLITE_TESTCTRL_TUNE, id, *piValue)
**