1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-03 16:53:36 +03:00

Fix the ".echo on" dot-command of the shell so that it echos comments in

addition to SQL statements and dot-commands.  Add the --explain option
to speedtest1 so that the output can be piped into the command-line shell
to show nicely-formated VDBE code for the entire test.

FossilOrigin-Name: 96397263f94256e284aae9506de1fc48fea89193
This commit is contained in:
drh
2013-12-21 15:46:06 +00:00
parent ae28d6efc6
commit 849a9d92ba
5 changed files with 55 additions and 35 deletions

View File

@@ -3038,7 +3038,10 @@ static int process_input(struct callback_data *p, FILE *in){
seenInterrupt = 0;
}
lineno++;
if( nSql==0 && _all_whitespace(zLine) ) continue;
if( nSql==0 && _all_whitespace(zLine) ){
if( p->echoOn ) printf("%s\n", zLine);
continue;
}
if( zLine && zLine[0]=='.' && nSql==0 ){
if( p->echoOn ) printf("%s\n", zLine);
rc = do_meta_command(zLine, p);
@@ -3100,6 +3103,7 @@ static int process_input(struct callback_data *p, FILE *in){
}
nSql = 0;
}else if( nSql && _all_whitespace(zSql) ){
if( p->echoOn ) printf("%s\n", zSql);
nSql = 0;
}
}