1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Add comments and fix formatting issues in new code in shell.c.in.

FossilOrigin-Name: b91d819bd16de43fc99e379da0ba9c915b0c5afc68e804a50c3c1662c1f9a740
This commit is contained in:
dan
2019-04-27 19:36:49 +00:00
parent 42ebb01e9f
commit 0aa01ee42c
3 changed files with 35 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
C Add\sthe\s"--lost-and-found"\soption\sto\sthe\s".recover"\scommand.\sFor\ssetting\sthe\sname\sof\sthe\sorphaned\srows\stable. C Add\scomments\sand\sfix\sformatting\sissues\sin\snew\scode\sin\sshell.c.in.
D 2019-04-27T18:47:03.466 D 2019-04-27T19:36:49.564
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -520,7 +520,7 @@ F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
F src/resolve.c 567888ee3faec14dae06519b4306201771058364a37560186a3e0e755ebc4cb8 F src/resolve.c 567888ee3faec14dae06519b4306201771058364a37560186a3e0e755ebc4cb8
F src/rowset.c d977b011993aaea002cab3e0bb2ce50cf346000dff94e944d547b989f4b1fe93 F src/rowset.c d977b011993aaea002cab3e0bb2ce50cf346000dff94e944d547b989f4b1fe93
F src/select.c b7304d2f491c11a03a7fbdf34bc218282ac54052377809d4dc3b4b1e7f4bfc93 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/sqlite.h.in 38390767acc1914d58930e03149595ee4710afa4e3c43ab6c3a8aea3f1a6b8cd
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 9ecc93b8493bd20c0c07d52e2ac0ed8bab9b549c7f7955b59869597b650dd8b5 F src/sqlite3ext.h 9ecc93b8493bd20c0c07d52e2ac0ed8bab9b549c7f7955b59869597b650dd8b5
@@ -1821,7 +1821,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 91df4b8e0386105d01614921e8410994b621404a3d46ec4af8687b8743c52d52 P 67bb88e24c74d02ae0c4ac6ff2f873f6b0035ccefe5cccfc71c5686cbc76b4c3
R a9542f620433fc5d37a56caa32ea75c3 R 1520b643c98e19ff415724ed970cd8b1
U dan U dan
Z 07c2469e7eeced685ce45289494bc94e Z 3d67e0e6129b0deb0a86f6c6a9eda8ce

View File

@@ -1 +1 @@
67bb88e24c74d02ae0c4ac6ff2f873f6b0035ccefe5cccfc71c5686cbc76b4c3 b91d819bd16de43fc99e379da0ba9c915b0c5afc68e804a50c3c1662c1f9a740

View File

@@ -6385,13 +6385,28 @@ static RecoverTable *recoverNewTable(
return pTab; 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( static RecoverTable *recoverFindTable(
ShellState *pState, ShellState *pState, /* Shell state object */
int *pRc, int *pRc, /* IN/OUT: Error code */
int iRoot, int iRoot, /* Root page of table */
int bIntkey, int bIntkey, /* True for an intkey table */
int nCol, int nCol, /* Number of columns in table */
int *pbNoop int *pbNoop /* OUT: True if iRoot is root of index */
){ ){
sqlite3_stmt *pStmt = 0; sqlite3_stmt *pStmt = 0;
RecoverTable *pRet = 0; RecoverTable *pRet = 0;
@@ -6422,11 +6437,14 @@ static RecoverTable *recoverFindTable(
return pRet; return pRet;
} }
/*
** Return a RecoverTable object representing the orphans table.
*/
static RecoverTable *recoverOrphanTable( static RecoverTable *recoverOrphanTable(
ShellState *pState, ShellState *pState, /* Shell state object */
int *pRc, int *pRc, /* IN/OUT: Error code */
const char *zLostAndFound, const char *zLostAndFound, /* Base name for orphans table */
int nCol int nCol /* Number of user data columns */
){ ){
RecoverTable *pTab = 0; RecoverTable *pTab = 0;
if( nCol>=0 && *pRc==SQLITE_OK ){ if( nCol>=0 && *pRc==SQLITE_OK ){