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

Function recoverPreparePrintf

modules/dasSQLITE/sqlite/shell.c:13934–13954  ·  view source on GitHub ↗

** This function is a no-op if recover handle p already contains an error ** (if p->errCode!=SQLITE_OK). ** ** Otherwise, argument zFmt is used as a printf() style format string, ** along with any trailing arguments, to create an SQL statement. This ** SQL statement is prepared against database handle db and, if successful, ** the statment handle returned. Or, if an error occurs - either during *

Source from the content-addressed store, hash-verified

13932** error code and message are left in the recover handle.
13933*/
13934static sqlite3_stmt *recoverPreparePrintf(
13935 sqlite3_recover *p,
13936 sqlite3 *db,
13937 const char *zFmt, ...
13938){
13939 sqlite3_stmt *pStmt = 0;
13940 if( p->errCode==SQLITE_OK ){
13941 va_list ap;
13942 char *z;
13943 va_start(ap, zFmt);
13944 z = sqlite3_vmprintf(zFmt, ap);
13945 va_end(ap);
13946 if( z==0 ){
13947 p->errCode = SQLITE_NOMEM;
13948 }else{
13949 pStmt = recoverPrepare(p, db, z);
13950 sqlite3_free(z);
13951 }
13952 }
13953 return pStmt;
13954}
13955
13956/*
13957** Reset SQLite statement handle pStmt. If the call to sqlite3_reset()

Callers 7

recoverPageCountFunction · 0.85
recoverGetPageFunction · 0.85
recoverTransferSettingsFunction · 0.85
recoverAddTableFunction · 0.85
recoverLostAndFound3InitFunction · 0.85
recoverLostAndFound2InitFunction · 0.85

Calls 1

recoverPrepareFunction · 0.85

Tested by

no test coverage detected