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

Function recoverLostAndFound3Step

modules/dasSQLITE/sqlite/shell.c:15058–15079  ·  view source on GitHub ↗

** Perform one step (sqlite3_recover_step()) of work for the connection ** passed as the only argument, which is guaranteed to be in ** RECOVER_STATE_LOSTANDFOUND3 state - during which the lost-and-found ** table of the output database is populated with recovered data that can ** not be assigned to any recovered schema object. */

Source from the content-addressed store, hash-verified

15056** not be assigned to any recovered schema object.
15057*/
15058static int recoverLostAndFound3Step(sqlite3_recover *p){
15059 RecoverStateLAF *pLaf = &p->laf;
15060 if( p->errCode==SQLITE_OK ){
15061 if( pLaf->pInsert==0 ){
15062 return SQLITE_DONE;
15063 }else{
15064 if( p->errCode==SQLITE_OK ){
15065 int res = sqlite3_step(pLaf->pAllPage);
15066 if( res==SQLITE_ROW ){
15067 i64 iPage = sqlite3_column_int64(pLaf->pAllPage, 0);
15068 if( recoverBitmapQuery(pLaf->pUsed, iPage)==0 ){
15069 recoverLostAndFoundOnePage(p, iPage);
15070 }
15071 }else{
15072 recoverReset(p, pLaf->pAllPage);
15073 return SQLITE_DONE;
15074 }
15075 }
15076 }
15077 }
15078 return SQLITE_OK;
15079}
15080
15081/*
15082** Initialize resources required in RECOVER_STATE_LOSTANDFOUND3

Callers 1

recoverStepFunction · 0.85

Calls 3

recoverBitmapQueryFunction · 0.85
recoverResetFunction · 0.85

Tested by

no test coverage detected