/ Check-in [9a603a18]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the error message for invalid ".mode" arguments in the command-line shell, so that it mentions the new "quote" mode.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9a603a18ef626b7d7a24b82eb961d6d8b4926195
User & Date: drh 2016-11-23 23:18:45
Context
2016-11-25
14:30
Add a comment to help clarify the EP_FromJoin hack in exprCodeBetween(). check-in: 6df7c574 user: drh tags: trunk
2016-11-23
23:18
Fix the error message for invalid ".mode" arguments in the command-line shell, so that it mentions the new "quote" mode. check-in: 9a603a18 user: drh tags: trunk
19:31
Code constant vector components outside of any loops in CASE and BETWEEN expressions. Fix for [1a684656]. check-in: c08aff13 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/shell.c.

  4075   4075         p->mode = MODE_Quote;
  4076   4076       }else if( c2=='a' && strncmp(azArg[1],"ascii",n2)==0 ){
  4077   4077         p->mode = MODE_Ascii;
  4078   4078         sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Unit);
  4079   4079         sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Record);
  4080   4080       }else {
  4081   4081         raw_printf(stderr, "Error: mode should be one of: "
  4082         -         "ascii column csv html insert line list tabs tcl\n");
         4082  +         "ascii column csv html insert line list quote tabs tcl\n");
  4083   4083         rc = 1;
  4084   4084       }
  4085   4085       p->cMode = p->mode;
  4086   4086     }else
  4087   4087   
  4088   4088     if( c=='n' && strncmp(azArg[0], "nullvalue", n)==0 ){
  4089   4089       if( nArg==2 ){

Changes to test/shell1.test.

   195    195     catchcmd "test.db" ".explain \"OFF"
   196    196   } {0 {}}
   197    197   do_test shell1-2.2.4 {
   198    198     catchcmd "test.db" ".explain \'OFF"
   199    199   } {0 {}}
   200    200   do_test shell1-2.2.5 {
   201    201     catchcmd "test.db" ".mode \"insert FOO"
   202         -} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}}
          202  +} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
   203    203   do_test shell1-2.2.6 {
   204    204     catchcmd "test.db" ".mode \'insert FOO"
   205         -} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}}
          205  +} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
   206    206   
   207    207   # check multiple tokens, and quoted tokens
   208    208   do_test shell1-2.3.1 {
   209    209     catchcmd "test.db" ".explain 1"
   210    210   } {0 {}}
   211    211   do_test shell1-2.3.2 {
   212    212     catchcmd "test.db" ".explain on"
................................................................................
   226    226   do_test shell1-2.3.7 {
   227    227     catchcmd "test.db" ".\'explain\' \'OFF\'"
   228    228   } {0 {}}
   229    229   
   230    230   # check quoted args are unquoted
   231    231   do_test shell1-2.4.1 {
   232    232     catchcmd "test.db" ".mode FOO"
   233         -} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}}
          233  +} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
   234    234   do_test shell1-2.4.2 {
   235    235     catchcmd "test.db" ".mode csv"
   236    236   } {0 {}}
   237    237   do_test shell1-2.4.2 {
   238    238     catchcmd "test.db" ".mode \"csv\""
   239    239   } {0 {}}
   240    240   
................................................................................
   423    423   #                          insert   SQL insert statements for TABLE
   424    424   #                          line     One value per line
   425    425   #                          list     Values delimited by .separator strings
   426    426   #                          tabs     Tab-separated values
   427    427   #                          tcl      TCL list elements
   428    428   do_test shell1-3.13.1 {
   429    429     catchcmd "test.db" ".mode"
   430         -} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}}
          430  +} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
   431    431   do_test shell1-3.13.2 {
   432    432     catchcmd "test.db" ".mode FOO"
   433         -} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}}
          433  +} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
   434    434   do_test shell1-3.13.3 {
   435    435     catchcmd "test.db" ".mode csv"
   436    436   } {0 {}}
   437    437   do_test shell1-3.13.4 {
   438    438     catchcmd "test.db" ".mode column"
   439    439   } {0 {}}
   440    440   do_test shell1-3.13.5 {
................................................................................
   459    459     # extra arguments ignored
   460    460     catchcmd "test.db" ".mode tcl BAD"
   461    461   } {0 {}}
   462    462   
   463    463   # don't allow partial mode type matches
   464    464   do_test shell1-3.13.12 {
   465    465     catchcmd "test.db" ".mode l"
   466         -} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}}
          466  +} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
   467    467   do_test shell1-3.13.13 {
   468    468     catchcmd "test.db" ".mode li"
   469         -} {1 {Error: mode should be one of: ascii column csv html insert line list tabs tcl}}
          469  +} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
   470    470   do_test shell1-3.13.14 {
   471    471     catchcmd "test.db" ".mode lin"
   472    472   } {0 {}}
   473    473   
   474    474   # .nullvalue STRING      Print STRING in place of NULL values
   475    475   do_test shell1-3.14.1 {
   476    476     catchcmd "test.db" ".nullvalue"