From 1ba00291a3a72898ca8e381e65bac8162dad5944 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 6 May 2013 21:01:06 +0000 Subject: [PATCH] In the command-line shell, output the elements of the schema in the order that they appear in the sqlite_master table. This is necessary in some cases to make the schema parsable. FossilOrigin-Name: e5b3cd747bb0b484e38b8611a81925e2cc144435 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c | 6 ++---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 4ec94916cd..394b3344de 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sthe\scommand-line\sshell,\smake\ssure\sthe\soutput\sof\sdot-commands\sgoes\sto\nthe\ssame\sredirected\soutput\sstream\sas\sthe\sresult\sof\squeries.\nTicket\s[2f96536e7ff7dba] -D 2013-05-06T20:28:54.574 +C In\sthe\scommand-line\sshell,\soutput\sthe\selements\sof\sthe\sschema\sin\sthe\sorder\nthat\sthey\sappear\sin\sthe\ssqlite_master\stable.\s\sThis\sis\snecessary\sin\ssome\ncases\sto\smake\sthe\sschema\sparsable. +D 2013-05-06T21:01:06.414 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in ce81671efd6223d19d4c8c6b88ac2c4134427111 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -191,7 +191,7 @@ F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50 F src/resolve.c 83cc2d942ee216bc56956c6e6fadb691c1727fa1 F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0 F src/select.c 6bfbe11e2fef81c5e18d30513ab6c69f171667eb -F src/shell.c 115bc2fa3ce4e89f5cea49ace173c4c9e68cfcf6 +F src/shell.c 2109d54f67c815a100abd7dc6a6e25eddb3b97eb F src/sqlite.h.in 5a5a22a9b192d81a9e5dee00274e3a0484c4afb1 F src/sqlite3.rc fea433eb0a59f4c9393c8e6d76a6e2596b1fe0c0 F src/sqlite3ext.h d936f797812c28b81b26ed18345baf8db28a21a5 @@ -1061,7 +1061,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P d8dc2c5fb554eb5898ddc8d703c6a360af7fe023 -R 51c5817bdcc09862ecf820138ddcd721 +P b72d365920dbe45e61d8b1cff708a8858c2b3e33 +R e0d7d129e376f94da4504f4153569f21 U drh -Z 6618db8b151a5d589fef00beca7c472a +Z e1d10da5e5ea459f8bce59c30cc68749 diff --git a/manifest.uuid b/manifest.uuid index c315d93ad3..1562d7bd87 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b72d365920dbe45e61d8b1cff708a8858c2b3e33 \ No newline at end of file +e5b3cd747bb0b484e38b8611a81925e2cc144435 \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index e6dd496bd1..1be2871fed 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2278,8 +2278,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ " SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_master) " "WHERE lower(tbl_name) LIKE shellstatic()" " AND type!='meta' AND sql NOTNULL " - "ORDER BY substr(type,2,1), " - " CASE type WHEN 'view' THEN rowid ELSE name END", + "ORDER BY rowid", callback, &data, &zErrMsg); zShellStatic = 0; } @@ -2290,8 +2289,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ " FROM sqlite_master UNION ALL" " SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_master) " "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%'" - "ORDER BY substr(type,2,1)," - " CASE type WHEN 'view' THEN rowid ELSE name END", + "ORDER BY rowid", callback, &data, &zErrMsg ); } -- 2.47.2