Modify the ".dump" command in the command-line shell so that it works

with virtual tables. (CVS 3416)

FossilOrigin-Name: afd40184b752f641b423ceffac2476f2cfbdfd31
This commit is contained in:
drh 2006-09-13 20:22:02 +00:00
parent 235a818e61
commit 0b9a594ae1
3 changed files with 21 additions and 11 deletions

View File

@ -1,5 +1,5 @@
C Remove\sunused\smalloc\sfailure\stest.\s\s(Ticket\s#1976)\nAlso\sinclude\sfixes\sfor\sother\sproblems\ndiscovered\swhile\sinvestigating\sticket\s#1976.\s(CVS\s3415) C Modify\sthe\s".dump"\scommand\sin\sthe\scommand-line\sshell\sso\sthat\sit\sworks\nwith\svirtual\stables.\s(CVS\s3416)
D 2006-09-13T19:21:28 D 2006-09-13T20:22:02
F Makefile.in cabd42d34340f49260bc2a7668c38eba8d4cfd99 F Makefile.in cabd42d34340f49260bc2a7668c38eba8d4cfd99
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -85,7 +85,7 @@ F src/printf.c b179b6ed12f793e028dd169e2e2e2b2a37eedc63
F src/random.c d40f8d356cecbd351ccfab6eaedd7ec1b54f5261 F src/random.c d40f8d356cecbd351ccfab6eaedd7ec1b54f5261
F src/select.c 0d4724930a1f34c747105ed1802fa4af0d8eb519 F src/select.c 0d4724930a1f34c747105ed1802fa4af0d8eb519
F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
F src/shell.c 233f7766e532a204bed465249ffc584424ed1757 F src/shell.c 672326e8d90394218509f1820ab0835e7ed2bc06
F src/sqlite.h.in 19f5390cce182242b309a053aa1ee2b902bee147 F src/sqlite.h.in 19f5390cce182242b309a053aa1ee2b902bee147
F src/sqlite3ext.h 11a046b3519c4b9b7709e6d6a95c3a36366f684a F src/sqlite3ext.h 11a046b3519c4b9b7709e6d6a95c3a36366f684a
F src/sqliteInt.h fc2439b695dd80a3c58c8f14759e621dbf630b03 F src/sqliteInt.h fc2439b695dd80a3c58c8f14759e621dbf630b03
@ -398,7 +398,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P 607d928ce91f3efa9c7019fc789a9cd3c41cfc92 P f4ab546b2e8105422fb1baa2b86e688b5d19f20e
R bf91a185075c86310a287575e4ec7d3e R 652a526cbce7142a0518bfc34577283d
U drh U drh
Z 6514180e1691bbf6fc44840e72052023 Z cf3bcfae5cca273a32c198de20c140a4

View File

@ -1 +1 @@
f4ab546b2e8105422fb1baa2b86e688b5d19f20e afd40184b752f641b423ceffac2476f2cfbdfd31

View File

@ -12,7 +12,7 @@
** This file contains code to implement the "sqlite" command line ** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases. ** utility for accessing SQLite databases.
** **
** $Id: shell.c,v 1.148 2006/09/06 21:39:40 adamd Exp $ ** $Id: shell.c,v 1.149 2006/09/13 20:22:02 drh Exp $
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -918,11 +918,16 @@ static int do_meta_command(char *zLine, struct callback_data *p){
if( nArg==1 ){ if( nArg==1 ){
run_schema_dump_query(p, run_schema_dump_query(p,
"SELECT name, type, sql FROM sqlite_master " "SELECT name, type, sql FROM sqlite_master "
"WHERE sql NOT NULL AND type=='table'", 0 "WHERE sql NOT NULL AND type=='table' AND rootpage!=0", 0
); );
run_schema_dump_query(p, run_schema_dump_query(p,
"SELECT name, type, sql FROM sqlite_master " "SELECT name, type, sql FROM sqlite_master "
"WHERE sql NOT NULL AND type!='table' AND type!='meta'", 0 "WHERE sql NOT NULL AND "
" AND type!='table' AND type!='meta'", 0
);
run_table_dump_query(p->out, p->db,
"SELECT sql FROM sqlite_master "
"WHERE sql NOT NULL AND rootpage==0 AND type='table'"
); );
}else{ }else{
int i; int i;
@ -931,11 +936,16 @@ static int do_meta_command(char *zLine, struct callback_data *p){
run_schema_dump_query(p, run_schema_dump_query(p,
"SELECT name, type, sql FROM sqlite_master " "SELECT name, type, sql FROM sqlite_master "
"WHERE tbl_name LIKE shellstatic() AND type=='table'" "WHERE tbl_name LIKE shellstatic() AND type=='table'"
" AND sql NOT NULL", 0); " AND rootpage!=0 AND sql NOT NULL", 0);
run_schema_dump_query(p, run_schema_dump_query(p,
"SELECT name, type, sql FROM sqlite_master " "SELECT name, type, sql FROM sqlite_master "
"WHERE tbl_name LIKE shellstatic() AND type!='table'" "WHERE tbl_name LIKE shellstatic() AND type!='table'"
" AND type!='meta' AND sql NOT NULL", 0); " AND type!='meta' AND sql NOT NULL", 0);
run_table_dump_query(p->out, p->db,
"SELECT sql FROM sqlite_master "
"WHERE sql NOT NULL AND rootpage==0 AND type='table'"
" AND tbl_name LIKE shellstatic()"
);
zShellStatic = 0; zShellStatic = 0;
} }
} }