From: mistachkin Date: Thu, 6 Feb 2014 01:15:29 +0000 (+0000) Subject: Rename the '.repair' shell command to '.clone'. X-Git-Tag: version-3.8.4~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e31ae901004bd2ec35a031b884f737c62a44c005;p=thirdparty%2Fsqlite.git Rename the '.repair' shell command to '.clone'. FossilOrigin-Name: 4f9d95624ae4e123f83c835b5940f64d4a47be0d --- diff --git a/manifest b/manifest index c624ecece4..8cb9683c66 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\s".repair"\scommand\sto\sthe\scommand-line\sshell. -D 2014-02-06T00:49:12.328 +C Rename\sthe\s'.repair'\sshell\scommand\sto\s'.clone'. +D 2014-02-06T01:15:29.192 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -220,7 +220,7 @@ F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece F src/resolve.c 7eda9097b29fcf3d2b42fdc17d1de672134e09b6 F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0 F src/select.c b78f5e62c283aca2e38657938bc1fec1051df728 -F src/shell.c c128bf92b3ed268d8ec6f0df275a5d737edf2968 +F src/shell.c da0a97d984a7f59441d052925f3b83189c532bf7 F src/sqlite.h.in eed7f7d66a60daaa7b4a597dcd9bad87aad9611b F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc @@ -1152,7 +1152,7 @@ F tool/vdbe-compress.tcl 0cf56e9263a152b84da86e75a5c0cdcdb7a47891 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P 4a4dd371a72b7d475185923bebb4cd9bd83e1bd9 -R 235c07c6649435d22d14c7aa202be2ed -U drh -Z b9d162ba79528a4d7df551b82e7b6e75 +P d1dfadea87ecf18eeb6d2f21769deaa97473ca0e +R f560d9f23cc9db65e30e7982b2e54ef7 +U mistachkin +Z 4d9ab8dffd5cac0331ab06f34b9616ca diff --git a/manifest.uuid b/manifest.uuid index 98d249ad3e..5b765640c3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d1dfadea87ecf18eeb6d2f21769deaa97473ca0e \ No newline at end of file +4f9d95624ae4e123f83c835b5940f64d4a47be0d \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 68f2ef2afc..3a583f09fc 100644 --- a/src/shell.c +++ b/src/shell.c @@ -1581,7 +1581,7 @@ static char zHelp[] = ".prompt MAIN CONTINUE Replace the standard prompts\n" ".quit Exit this program\n" ".read FILENAME Execute SQL in FILENAME\n" - ".repair NEWDB Recover data into NEWDB from a corrupt database\n" + ".clone NEWDB Clone data into NEWDB from the existing database\n" ".restore ?DB? FILE Restore content of DB (default \"main\") from FILE\n" ".schema ?TABLE? Show the CREATE statements\n" " If TABLE specified, only show tables matching\n" @@ -1900,7 +1900,7 @@ static char *csv_read_one_field(CSVReader *p){ /* ** Try to transfer data for table zTable */ -static void tryToRepairData( +static void tryToCloneData( struct callback_data *p, sqlite3 *newDb, const char *zTable @@ -2002,7 +2002,7 @@ end_data_xfer: ** Try to transfer all rows of the schema that match zWhere. For ** each row, invoke xForEach() on the object defined by that row. */ -static void tryToRepairSchema( +static void tryToCloneSchema( struct callback_data *p, sqlite3 *newDb, const char *zWhere, @@ -2066,7 +2066,7 @@ end_schema_xfer: ** as possible out of the main database (which might be corrupt) and write it ** into zNewDb. */ -static void tryToRepair(struct callback_data *p, const char *zNewDb){ +static void tryToClone(struct callback_data *p, const char *zNewDb){ int rc; sqlite3 *newDb = 0; if( access(zNewDb,0)==0 ){ @@ -2079,8 +2079,8 @@ static void tryToRepair(struct callback_data *p, const char *zNewDb){ sqlite3_errmsg(newDb)); }else{ sqlite3_exec(newDb, "BEGIN EXCLUSIVE;", 0, 0, 0); - tryToRepairSchema(p, newDb, "type='table'", tryToRepairData); - tryToRepairSchema(p, newDb, "type!='table'", 0); + tryToCloneSchema(p, newDb, "type='table'", tryToCloneData); + tryToCloneSchema(p, newDb, "type!='table'", 0); sqlite3_exec(newDb, "COMMIT;", 0, 0, 0); } sqlite3_close(newDb); @@ -2193,6 +2193,10 @@ static int do_meta_command(char *zLine, struct callback_data *p){ test_breakpoint(); }else + if( c=='c' && strncmp(azArg[0], "clone", n)==0 && nArg>1 && nArg<3 ){ + tryToClone(p, azArg[1]); + }else + if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 && nArg==1 ){ struct callback_data data; char *zErrMsg = 0; @@ -2685,10 +2689,6 @@ static int do_meta_command(char *zLine, struct callback_data *p){ } }else - if( c=='r' && strncmp(azArg[0], "repair", n)==0 && nArg>1 && nArg<3 ){ - tryToRepair(p, azArg[1]); - }else - if( c=='r' && n>=3 && strncmp(azArg[0], "restore", n)==0 && nArg>1 && nArg<4){ const char *zSrcFile; const char *zDb;