-C Add\sthe\s"--lost-and-found"\soption\sto\sthe\s".recover"\scommand.\sFor\ssetting\sthe\sname\sof\sthe\sorphaned\srows\stable.
-D 2019-04-27T18:47:03.466
+C Add\scomments\sand\sfix\sformatting\sissues\sin\snew\scode\sin\sshell.c.in.
+D 2019-04-27T19:36:49.564
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F src/resolve.c 567888ee3faec14dae06519b4306201771058364a37560186a3e0e755ebc4cb8
F src/rowset.c d977b011993aaea002cab3e0bb2ce50cf346000dff94e944d547b989f4b1fe93
F src/select.c b7304d2f491c11a03a7fbdf34bc218282ac54052377809d4dc3b4b1e7f4bfc93
-F src/shell.c.in 51f027f6b48fab39e0745915d979747880b7c35827798535726ac44366a291f1
+F src/shell.c.in 2316b9ee7a43e6f127e5abe8d74d69b92f6bbae1be38826ffb58384aab832013
F src/sqlite.h.in 38390767acc1914d58930e03149595ee4710afa4e3c43ab6c3a8aea3f1a6b8cd
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 9ecc93b8493bd20c0c07d52e2ac0ed8bab9b549c7f7955b59869597b650dd8b5
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 91df4b8e0386105d01614921e8410994b621404a3d46ec4af8687b8743c52d52
-R a9542f620433fc5d37a56caa32ea75c3
+P 67bb88e24c74d02ae0c4ac6ff2f873f6b0035ccefe5cccfc71c5686cbc76b4c3
+R 1520b643c98e19ff415724ed970cd8b1
U dan
-Z 07c2469e7eeced685ce45289494bc94e
+Z 3d67e0e6129b0deb0a86f6c6a9eda8ce
return pTab;
}
+/*
+** This function is called to search the schema recovered from the
+** sqlite_master table of the (possibly) corrupt database as part
+** of a ".recover" command. Specifically, for a table with root page
+** iRoot and at least nCol columns. Additionally, if bIntkey is 0, the
+** table must be a WITHOUT ROWID table, or if non-zero, not one of
+** those.
+**
+** If a table is found, a (RecoverTable*) object is returned. Or, if
+** no such table is found, but bIntkey is false and iRoot is the
+** root page of an index in the recovered schema, then (*pbNoop) is
+** set to true and NULL returned. Or, if there is no such table or
+** index, NULL is returned and (*pbNoop) set to 0, indicating that
+** the caller should write data to the orphans table.
+*/
static RecoverTable *recoverFindTable(
- ShellState *pState,
- int *pRc,
- int iRoot,
- int bIntkey,
- int nCol,
- int *pbNoop
+ ShellState *pState, /* Shell state object */
+ int *pRc, /* IN/OUT: Error code */
+ int iRoot, /* Root page of table */
+ int bIntkey, /* True for an intkey table */
+ int nCol, /* Number of columns in table */
+ int *pbNoop /* OUT: True if iRoot is root of index */
){
sqlite3_stmt *pStmt = 0;
RecoverTable *pRet = 0;
return pRet;
}
+/*
+** Return a RecoverTable object representing the orphans table.
+*/
static RecoverTable *recoverOrphanTable(
- ShellState *pState,
- int *pRc,
- const char *zLostAndFound,
- int nCol
+ ShellState *pState, /* Shell state object */
+ int *pRc, /* IN/OUT: Error code */
+ const char *zLostAndFound, /* Base name for orphans table */
+ int nCol /* Number of user data columns */
){
RecoverTable *pTab = 0;
if( nCol>=0 && *pRc==SQLITE_OK ){