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

Function recoverPageCount

modules/dasSQLITE/sqlite/shell.c:14061–14073  ·  view source on GitHub ↗

** This function is a no-op if recover handle p already contains an error ** (if p->errCode!=SQLITE_OK). Zero is returned in this case. ** ** Otherwise, execute "PRAGMA page_count" against the input database. If ** successful, return the integer result. Or, if an error occurs, leave an ** error code and error message in the sqlite3_recover handle and return ** zero. */

Source from the content-addressed store, hash-verified

14059** zero.
14060*/
14061static i64 recoverPageCount(sqlite3_recover *p){
14062 i64 nPg = 0;
14063 if( p->errCode==SQLITE_OK ){
14064 sqlite3_stmt *pStmt = 0;
14065 pStmt = recoverPreparePrintf(p, p->dbIn, "PRAGMA %Q.page_count", p->zDb);
14066 if( pStmt ){
14067 sqlite3_step(pStmt);
14068 nPg = sqlite3_column_int64(pStmt, 0);
14069 }
14070 recoverFinalize(p, pStmt);
14071 }
14072 return nPg;
14073}
14074
14075/*
14076** Implementation of SQL scalar function "read_i32". The first argument to

Callers 2

recoverGetPageFunction · 0.85
recoverLostAndFound1InitFunction · 0.85

Calls 2

recoverPreparePrintfFunction · 0.85
recoverFinalizeFunction · 0.85

Tested by

no test coverage detected