MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / recoverPageIsUsed

Function recoverPageIsUsed

modules/dasSQLITE/sqlite/shell.c:14119–14128  ·  view source on GitHub ↗

** Implementation of SQL scalar function "page_is_used". This function ** is used as part of the procedure for locating orphan rows for the ** lost-and-found table, and it depends on those routines having populated ** the sqlite3_recover.laf.pUsed variable. ** ** The only argument to this function is a page-number. It returns true ** if the page has already been used somehow during data recovery,

Source from the content-addressed store, hash-verified

14117** SELECT page_is_used(<pgno>);
14118*/
14119static void recoverPageIsUsed(
14120 sqlite3_context *pCtx,
14121 int nArg,
14122 sqlite3_value **apArg
14123){
14124 sqlite3_recover *p = (sqlite3_recover*)sqlite3_user_data(pCtx);
14125 i64 pgno = sqlite3_value_int64(apArg[0]);
14126 assert( nArg==1 );
14127 sqlite3_result_int(pCtx, recoverBitmapQuery(p->laf.pUsed, pgno));
14128}
14129
14130/*
14131** The implementation of a user-defined SQL function invoked by the

Callers

nothing calls this directly

Calls 2

assertFunction · 0.85
recoverBitmapQueryFunction · 0.85

Tested by

no test coverage detected