From: drh Date: Mon, 6 May 2013 20:28:54 +0000 (+0000) Subject: In the command-line shell, make sure the output of dot-commands goes to X-Git-Tag: version-3.7.17~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=151b7d5baddd4ba3fd0a19f00dfb6a7e533c02eb;p=thirdparty%2Fsqlite.git In the command-line shell, make sure the output of dot-commands goes to the same redirected output stream as the result of queries. Ticket [2f96536e7ff7dba] FossilOrigin-Name: b72d365920dbe45e61d8b1cff708a8858c2b3e33 --- diff --git a/manifest b/manifest index ff2b2e1ad8..4ec94916cd 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\san\sassert()\sto\sfts3_expr.c\sin\sorder\sto\ssilence\sa\sclang\swarning. -D 2013-05-06T14:57:48.666 +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 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 5d527e5d08f05ec2c43ff194ea44bf62b974f4c9 +F src/shell.c 115bc2fa3ce4e89f5cea49ace173c4c9e68cfcf6 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 26a59bb88d4082758eb281b365b57f9a0c059d89 -R 2feea6cda3683eb0bf228ac73380638e +P d8dc2c5fb554eb5898ddc8d703c6a360af7fe023 +R 51c5817bdcc09862ecf820138ddcd721 U drh -Z ca81a07ef0e1a560e388493dc60b3a68 +Z 6618db8b151a5d589fef00beca7c472a diff --git a/manifest.uuid b/manifest.uuid index 04a316d2aa..c315d93ad3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d8dc2c5fb554eb5898ddc8d703c6a360af7fe023 \ No newline at end of file +b72d365920dbe45e61d8b1cff708a8858c2b3e33 \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 09c3b810c8..e6dd496bd1 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2413,9 +2413,9 @@ static int do_meta_command(char *zLine, struct callback_data *p){ for(i=0; iout, "%s%-*s", zSp, maxlen, azResult[j] ? azResult[j] : ""); } - printf("\n"); + fprintf(p->out, "\n"); } } for(ii=0; iidb, opt); - printf("%d (0x%08x)\n", rc, rc); + fprintf(p->out, "%d (0x%08x)\n", rc, rc); } else { fprintf(stderr,"Error: testctrl %s takes a single int option\n", azArg[1]); @@ -2485,7 +2485,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ case SQLITE_TESTCTRL_PRNG_RESET: if( nArg==2 ){ rc = sqlite3_test_control(testctrl); - printf("%d (0x%08x)\n", rc, rc); + fprintf(p->out, "%d (0x%08x)\n", rc, rc); } else { fprintf(stderr,"Error: testctrl %s takes no options\n", azArg[1]); } @@ -2496,7 +2496,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ if( nArg==3 ){ unsigned int opt = (unsigned int)integerValue(azArg[2]); rc = sqlite3_test_control(testctrl, opt); - printf("%d (0x%08x)\n", rc, rc); + fprintf(p->out, "%d (0x%08x)\n", rc, rc); } else { fprintf(stderr,"Error: testctrl %s takes a single unsigned" " int option\n", azArg[1]); @@ -2509,7 +2509,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ if( nArg==3 ){ int opt = atoi(azArg[2]); rc = sqlite3_test_control(testctrl, opt); - printf("%d (0x%08x)\n", rc, rc); + fprintf(p->out, "%d (0x%08x)\n", rc, rc); } else { fprintf(stderr,"Error: testctrl %s takes a single int option\n", azArg[1]); @@ -2522,7 +2522,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ if( nArg==3 ){ const char *opt = azArg[2]; rc = sqlite3_test_control(testctrl, opt); - printf("%d (0x%08x)\n", rc, rc); + fprintf(p->out, "%d (0x%08x)\n", rc, rc); } else { fprintf(stderr,"Error: testctrl %s takes a single char * option\n", azArg[1]); @@ -2567,7 +2567,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ }else if( c=='v' && strncmp(azArg[0], "version", n)==0 ){ - printf("SQLite %s %s\n" /*extra-version-info*/, + fprintf(p->out, "SQLite %s %s\n" /*extra-version-info*/, sqlite3_libversion(), sqlite3_sourceid()); }else @@ -2577,7 +2577,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ if( p->db ){ sqlite3_file_control(p->db, zDbName, SQLITE_FCNTL_VFSNAME, &zVfsName); if( zVfsName ){ - printf("%s\n", zVfsName); + fprintf(p->out, "%s\n", zVfsName); sqlite3_free(zVfsName); } }