-C Consolidate\smore\sof\sthe\sDISTINCT\sprocessing\slogic\sinto\sa\ssingle\sspot\sin\sthe\ncode.\s\sReduce\sthe\snumber\sof\sOP_Column\soperations\sneeded\sto\sperform\sa\nWHERE_DISTINCT_ORDERED.
-D 2012-09-21T00:04:28.345
+C Command-line\sshell\senhancements:\s\sAdded\sthe\s".print"\scommand.\s\sEnhanced\nthe\s".width"\scommand\sso\sthat\snegative\swidths\swill\sright-justify.
+D 2012-09-21T13:40:02.707
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 5f4f26109f9d80829122e0e09f9cda008fa065fb
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/resolve.c 9e28280ec98035f31900fdd1db01f86f68ca6c32
F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0
F src/select.c c2a83ada835d3554a4d724c5358d4475aa7e1e77
-F src/shell.c 87953c5d9c73d9494db97d1607e2e2280418f261
+F src/shell.c f41fbf4c21003a37d69b863d3c3c562a3db180a6
F src/sqlite.h.in c76c38f9635590ff5844684a7976843878327137
F src/sqlite3.rc fea433eb0a59f4c9393c8e6d76a6e2596b1fe0c0
F src/sqlite3ext.h 6904f4aadf976f95241311fbffb00823075d9477
F test/shared8.test b27befbefbe7f4517f1d6b7ff8f64a41ec74165d
F test/shared_err.test 91e26ec4f3fbe07951967955585137e2f18993de
F test/sharedlock.test ffa0a3c4ac192145b310f1254f8afca4d553eabf
-F test/shell1.test 9895ee3013742a02e5afd8d77793729967ffd195
+F test/shell1.test 272384163432c0efd2c6817396beb0d119565d53
F test/shell2.test 037d6ad16e873354195d30bb2dc4b5321788154a
F test/shell3.test 9196c42772d575685e722c92b4b39053c6ebba59
F test/shell4.test aa4eef8118b412d1a01477a53426ece169ea86a9
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
F tool/win/sqlite.vsix 67d8a99aceb56384a81b3f30d6c71743146d2cc9
-P cf40b7b5ebdacc3215d769aadacce8c9e7e9dfbb
-R d02ff4711c6f63d54e76f1ced6a5b15a
+P 79e922f7ae29bbe06d639d648fbd72523cf9a28e
+R e0319168dcbdc9e6aaca1f64320b5398
U drh
-Z 9a19995b7c09e7ae5080d30ca61a0cd3
+Z e9c67fc218434dfa019e9bea621d5ceb
-79e922f7ae29bbe06d639d648fbd72523cf9a28e
\ No newline at end of file
+a1d8269da3868e41a6603c1a683e324fe21fb317
\ No newline at end of file
}else{
w = 0;
}
- if( w<=0 ){
+ if( w==0 ){
w = strlen30(azCol[i] ? azCol[i] : "");
if( w<10 ) w = 10;
n = strlen30(azArg && azArg[i] ? azArg[i] : p->nullvalue);
p->actualWidth[i] = w;
}
if( p->showHeader ){
- fprintf(p->out,"%-*.*s%s",w,w,azCol[i], i==nArg-1 ? "\n": " ");
+ if( w<0 ){
+ fprintf(p->out,"%*.*s%s",-w,-w,azCol[i], i==nArg-1 ? "\n": " ");
+ }else{
+ fprintf(p->out,"%-*.*s%s",w,w,azCol[i], i==nArg-1 ? "\n": " ");
+ }
}
}
if( p->showHeader ){
int w;
if( i<ArraySize(p->actualWidth) ){
w = p->actualWidth[i];
+ if( w<0 ) w = -w;
}else{
w = 10;
}
strlen30(azArg[i])>w ){
w = strlen30(azArg[i]);
}
- fprintf(p->out,"%-*.*s%s",w,w,
- azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " ");
+ if( w<0 ){
+ fprintf(p->out,"%*.*s%s",-w,-w,
+ azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " ");
+ }else{
+ fprintf(p->out,"%-*.*s%s",w,w,
+ azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " ");
+ }
}
break;
}
" list Values delimited by .separator string\n"
" tabs Tab-separated values\n"
" tcl TCL list elements\n"
- ".nullvalue STRING Print STRING in place of NULL values\n"
+ ".nullvalue STRING Use STRING in place of NULL values\n"
".output FILENAME Send output to FILENAME\n"
".output stdout Send output to the screen\n"
+ ".print STRING... Print literal STRING\n"
".prompt MAIN CONTINUE Replace the standard prompts\n"
".quit Exit this program\n"
".read FILENAME Execute SQL in FILENAME\n"
}
}else
+ if( c=='p' && n>=3 && strncmp(azArg[0], "print", n)==0 ){
+ int i;
+ for(i=1; i<nArg; i++){
+ if( i>1 ) fprintf(p->out, " ");
+ fprintf(p->out, "%s", azArg[i]);
+ }
+ fprintf(p->out, "\n");
+ }else
+
if( c=='p' && strncmp(azArg[0], "prompt", n)==0 && (nArg==2 || nArg==3)){
if( nArg >= 2) {
strncpy(mainPrompt,azArg[1],(int)ArraySize(mainPrompt)-1);
catchcmd "test.db" ".width 1 1"
# this should be treated the same as a '1' width for col 1 and 2
} {0 {}}
+do_test shell1-3.26.5 {
+ catchcmd "test.db" ".mode column\n.width 10 -10\nSELECT 'abcdefg', 123456;"
+ # this should be treated the same as a '1' width for col 1 and 2
+} {0 {abcdefg 123456}}
+do_test shell1-3.26.6 {
+ catchcmd "test.db" ".mode column\n.width -10 10\nSELECT 'abcdefg', 123456;"
+ # this should be treated the same as a '1' width for col 1 and 2
+} {0 { abcdefg 123456 }}
+
# .timer ON|OFF Turn the CPU timer measurement on or off
do_test shell1-3.27.1 {
".log stdout\nSELECT coalesce(sqlite_log(123,'hello'),'456');"
} "0 {(123) hello\n456}"
+do_test shell1-3-29.1 {
+ catchcmd "test.db" ".print this is a test"
+} {0 {this is a test}}
+
# Test the output of the ".dump" command
#
do_test shell1-4.1 {