Merge trunk changes.
FossilOrigin-Name: 9c1747b5ded995e77fdab2fa9d334ec3c17c7c14
This commit is contained in:
commit
7e065fcf7d
12
manifest
12
manifest
@ -1,5 +1,5 @@
|
||||
C Remove\sthe\svdbeRecordCompareLargeHeader\sfunction.\sFix\ssome\sother\sdetails.
|
||||
D 2014-03-01T19:44:56.574
|
||||
C Merge\strunk\schanges.
|
||||
D 2014-03-01T19:45:23.403
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@ -217,7 +217,7 @@ F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece
|
||||
F src/resolve.c ca8b99d894164435f5c55cb304c1b8121705c51e
|
||||
F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0
|
||||
F src/select.c 35b07a47fdee9a98e03c4ffb3801026c72114cb7
|
||||
F src/shell.c bf75ce6bea4c8f56c1b46bee201c25acddffb675
|
||||
F src/shell.c 7bf07bcacb181ecc3fc3ccacfdfeb4084aee67ed
|
||||
F src/sqlite.h.in a2ef671f92747a5a1c8a47bad5c585a8dd9eca80
|
||||
F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e
|
||||
F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc
|
||||
@ -1152,7 +1152,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
|
||||
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
|
||||
P 3a09f5605ac7c6e503eb10acfdc607010414d917
|
||||
R b23b5e438c1d698174ad52d7cfba370e
|
||||
P 3861e853105cb8da344c7eebd2e455622b26395e e6ecf7337658624d664e1e71ba3fc527fd6578c1
|
||||
R 13381de2688abf03e4d159f3d590d98e
|
||||
U dan
|
||||
Z 35d9cecacf0cc917a2c2ed9a75b36eab
|
||||
Z e204c923f296e27176558f8973bbdd9c
|
||||
|
@ -1 +1 @@
|
||||
3861e853105cb8da344c7eebd2e455622b26395e
|
||||
9c1747b5ded995e77fdab2fa9d334ec3c17c7c14
|
29
src/shell.c
29
src/shell.c
@ -65,7 +65,9 @@
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
# include <io.h>
|
||||
#define isatty(h) _isatty(h)
|
||||
#define access(f,m) _access((f),(m))
|
||||
#ifndef access
|
||||
# define access(f,m) _access((f),(m))
|
||||
#endif
|
||||
#undef popen
|
||||
#define popen _popen
|
||||
#undef pclose
|
||||
@ -444,6 +446,7 @@ struct previous_mode_data {
|
||||
struct callback_data {
|
||||
sqlite3 *db; /* The database */
|
||||
int echoOn; /* True to echo input commands */
|
||||
int autoEQP; /* Run EXPLAIN QUERY PLAN prior to seach SQL statement */
|
||||
int statsOn; /* True to display memory stats before each finalize */
|
||||
int cnt; /* Number of records displayed so far */
|
||||
FILE *out; /* Write results here */
|
||||
@ -1300,6 +1303,23 @@ static int shell_exec(
|
||||
fprintf(pArg->out, "%s\n", zStmtSql ? zStmtSql : zSql);
|
||||
}
|
||||
|
||||
/* Show the EXPLAIN QUERY PLAN if .eqp is on */
|
||||
if( pArg && pArg->autoEQP ){
|
||||
sqlite3_stmt *pExplain;
|
||||
char *zEQP = sqlite3_mprintf("EXPLAIN QUERY PLAN %s", sqlite3_sql(pStmt));
|
||||
rc = sqlite3_prepare_v2(db, zEQP, -1, &pExplain, 0);
|
||||
if( rc==SQLITE_OK ){
|
||||
while( sqlite3_step(pExplain)==SQLITE_ROW ){
|
||||
fprintf(pArg->out,"--EQP-- %d,", sqlite3_column_int(pExplain, 0));
|
||||
fprintf(pArg->out,"%d,", sqlite3_column_int(pExplain, 1));
|
||||
fprintf(pArg->out,"%d,", sqlite3_column_int(pExplain, 2));
|
||||
fprintf(pArg->out,"%s\n", sqlite3_column_text(pExplain, 3));
|
||||
}
|
||||
}
|
||||
sqlite3_finalize(pExplain);
|
||||
sqlite3_free(zEQP);
|
||||
}
|
||||
|
||||
/* Output TESTCTRL_EXPLAIN text of requested */
|
||||
if( pArg && pArg->mode==MODE_Explain ){
|
||||
const char *zExplain = 0;
|
||||
@ -2299,6 +2319,10 @@ static int do_meta_command(char *zLine, struct callback_data *p){
|
||||
p->echoOn = booleanValue(azArg[1]);
|
||||
}else
|
||||
|
||||
if( c=='e' && strncmp(azArg[0], "eqp", n)==0 && nArg>1 && nArg<3 ){
|
||||
p->autoEQP = booleanValue(azArg[1]);
|
||||
}else
|
||||
|
||||
if( c=='e' && strncmp(azArg[0], "exit", n)==0 ){
|
||||
if( nArg>1 && (rc = (int)integerValue(azArg[1]))!=0 ) exit(rc);
|
||||
rc = 2;
|
||||
@ -2871,6 +2895,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
|
||||
if( c=='s' && strncmp(azArg[0], "show", n)==0 && nArg==1 ){
|
||||
int i;
|
||||
fprintf(p->out,"%9.9s: %s\n","echo", p->echoOn ? "on" : "off");
|
||||
fprintf(p->out,"%9.9s: %s\n","eqp", p->autoEQP ? "on" : "off");
|
||||
fprintf(p->out,"%9.9s: %s\n","explain", p->explainPrev.valid ? "on" :"off");
|
||||
fprintf(p->out,"%9.9s: %s\n","headers", p->showHeader ? "on" : "off");
|
||||
fprintf(p->out,"%9.9s: %s\n","mode", modeDescr[p->mode]);
|
||||
@ -3708,6 +3733,8 @@ int main(int argc, char **argv){
|
||||
data.showHeader = 0;
|
||||
}else if( strcmp(z,"-echo")==0 ){
|
||||
data.echoOn = 1;
|
||||
}else if( strcmp(z,"-eqp")==0 ){
|
||||
data.autoEQP = 1;
|
||||
}else if( strcmp(z,"-stats")==0 ){
|
||||
data.statsOn = 1;
|
||||
}else if( strcmp(z,"-bail")==0 ){
|
||||
|
Loading…
Reference in New Issue
Block a user