diff options
author | drh <drh@noemail.net> | 2009-01-14 23:17:55 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-01-14 23:17:55 +0000 |
commit | 8f800a7d4255821dbda28dd47d3aec61bedb132d (patch) | |
tree | 7fce556e4728148b99c32e1549bb274030312292 /src/shell.c | |
parent | 8f941bc7a112743c9c12afb02d0ea47e5a8875c3 (diff) | |
download | sqlite-8f800a7d4255821dbda28dd47d3aec61bedb132d.tar.gz sqlite-8f800a7d4255821dbda28dd47d3aec61bedb132d.zip |
Fix the shell so that the ".schema" command works regardless of the
pragma settings. Ticket #3585. (CVS 6180)
FossilOrigin-Name: 6f6b638e44a8cfc741594f02b0178fa98ed7e2c1
Diffstat (limited to 'src/shell.c')
-rw-r--r-- | src/shell.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/shell.c b/src/shell.c index 705bae05c..c472b21ac 100644 --- a/src/shell.c +++ b/src/shell.c @@ -12,7 +12,7 @@ ** This file contains code to implement the "sqlite" command line ** utility for accessing SQLite databases. ** -** $Id: shell.c,v 1.196 2008/12/18 22:25:14 drh Exp $ +** $Id: shell.c,v 1.197 2009/01/14 23:17:55 drh Exp $ */ #if defined(_WIN32) || defined(WIN32) /* This needs to come before any includes for MSVC compiler */ @@ -1502,8 +1502,9 @@ static int do_meta_command(char *zLine, struct callback_data *p){ zShellStatic = azArg[1]; sqlite3_exec(p->db, "SELECT sql FROM " - " (SELECT * FROM sqlite_master UNION ALL" - " SELECT * FROM sqlite_temp_master) " + " (SELECT sql sql, type type, tbl_name tbl_name, name name" + " FROM sqlite_master UNION ALL" + " SELECT sql, type, tbl_name, name FROM sqlite_temp_master) " "WHERE tbl_name LIKE shellstatic() AND type!='meta' AND sql NOTNULL " "ORDER BY substr(type,2,1), name", callback, &data, &zErrMsg); @@ -1512,8 +1513,9 @@ static int do_meta_command(char *zLine, struct callback_data *p){ }else{ sqlite3_exec(p->db, "SELECT sql FROM " - " (SELECT * FROM sqlite_master UNION ALL" - " SELECT * FROM sqlite_temp_master) " + " (SELECT sql sql, type type, tbl_name tbl_name, name name" + " FROM sqlite_master UNION ALL" + " SELECT sql, type, tbl_name, name FROM sqlite_temp_master) " "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%'" "ORDER BY substr(type,2,1), name", callback, &data, &zErrMsg |