MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / run_schema_dump_query

Function run_schema_dump_query

src/database/cppsqlite3.cpp:1160–1175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1158
1159
1160static int run_schema_dump_query(struct callback_data *p, const char *zQuery, char **pzErrMsg)
1161{
1162 int rc;
1163 rc = sqlite3_exec(p->db, zQuery, dump_callback, p, pzErrMsg);
1164 if( rc==SQLITE_CORRUPT ){
1165 char *zQ2;
1166 int len = strlen30(zQuery);
1167 if( pzErrMsg ) sqlite3_free(*pzErrMsg);
1168 zQ2 = (char*)malloc( len+100 );
1169 if( zQ2==0 ) return rc;
1170 sqlite3_snprintf(sizeof(zQ2), zQ2, "%s ORDER BY rowid DESC", zQuery);
1171 rc = sqlite3_exec(p->db, zQ2, dump_callback, p, pzErrMsg);
1172 free(zQ2);
1173 }
1174 return rc;
1175}
1176
1177/*
1178** If the following flag is set, then command execution stops

Callers 1

dumpMethod · 0.85

Calls 1

strlen30Function · 0.85

Tested by

no test coverage detected