mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-06 15:49:35 +03:00
The shell does not output the sqlite_stat1 table on .dump or .schema.
The ANALYZE command now gathers statistics on tables that have only a single index because this sometimes helps when reordering tables in a join. (CVS 2686) FossilOrigin-Name: 26565b8931419031f9a8dd3947e1e2bd23ccbff2
This commit is contained in:
11
src/shell.c
11
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.126 2005/08/30 20:12:02 drh Exp $
|
||||
** $Id: shell.c,v 1.127 2005/09/10 22:40:54 drh Exp $
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -905,11 +905,12 @@ static int do_meta_command(char *zLine, struct callback_data *p){
|
||||
if( nArg==1 ){
|
||||
run_schema_dump_query(p,
|
||||
"SELECT name, type, sql FROM sqlite_master "
|
||||
"WHERE sql NOT NULL AND type=='table'", 0
|
||||
"WHERE sql NOT NULL AND type=='table' AND name NOT LIKE 'sqlite_%'", 0
|
||||
);
|
||||
run_schema_dump_query(p,
|
||||
"SELECT name, type, sql FROM sqlite_master "
|
||||
"WHERE sql NOT NULL AND type!='table' AND type!='meta'", 0
|
||||
"WHERE sql NOT NULL AND type!='table' AND type!='meta' "
|
||||
"AND name NOT LIKE 'sqlite_%'", 0
|
||||
);
|
||||
}else{
|
||||
int i;
|
||||
@@ -1290,7 +1291,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
|
||||
"SELECT sql FROM "
|
||||
" (SELECT * FROM sqlite_master UNION ALL"
|
||||
" SELECT * FROM sqlite_temp_master) "
|
||||
"WHERE type!='meta' AND sql NOTNULL "
|
||||
"WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%'"
|
||||
"ORDER BY substr(type,2,1), name",
|
||||
callback, &data, &zErrMsg
|
||||
);
|
||||
@@ -1334,7 +1335,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
|
||||
if( nArg==1 ){
|
||||
rc = sqlite3_get_table(p->db,
|
||||
"SELECT name FROM sqlite_master "
|
||||
"WHERE type IN ('table','view') "
|
||||
"WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%'"
|
||||
"UNION ALL "
|
||||
"SELECT name FROM sqlite_temp_master "
|
||||
"WHERE type IN ('table','view') "
|
||||
|
||||
Reference in New Issue
Block a user