]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add the "ascii" mode to the command-line shell.
authordrh <drh@noemail.net>
Fri, 9 Jan 2015 00:38:06 +0000 (00:38 +0000)
committerdrh <drh@noemail.net>
Fri, 9 Jan 2015 00:38:06 +0000 (00:38 +0000)
FossilOrigin-Name: e1518a9478e1ce1ebd98894335e64c953064367f

1  2 
manifest
manifest.uuid
test/shell5.test

diff --cc manifest
index 2425b043bba8377e505077576c2a1fa3add626bd,a6ec8d5c3ab74023f1841df89cf5e7069c09d131..3fb84faf9ce5ed62ff19d62a0ba001af7baadc14
+++ b/manifest
@@@ -1,7 -1,7 +1,7 @@@
- C Omit\smodules\sfrom\sthe\s"valgrind"\spermutation\sthat\sfork\soff\sseparate\sprocesses.\nAlso\somit\sselectG.test\sbecause\sit\sis\stiming\ssensitive\sand\svalgrind\sis\stoo\sslow\nto\sget\sthe\sright\sanswer.
- D 2015-01-08T22:08:57.396
 -C Merge\supdates\sfrom\strunk.
 -D 2015-01-02T20:06:27.572
++C Add\sthe\s"ascii"\smode\sto\sthe\scommand-line\sshell.
++D 2015-01-09T00:38:06.225
  F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 -F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410
 +F Makefile.in b40b4c2a3a187c41ee657d3f0e0e0dfe8fd860b5
  F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
  F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09
  F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0
@@@ -228,8 -228,8 +228,8 @@@ F src/printf.c 9e75a6a0b55bf61cfff7d7e1
  F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
  F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada
  F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
 -F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75
 +F src/select.c e4c38c75e36f28aed80a69a725d888751bfd53df
- F src/shell.c 45d9c9bd7cde07845af957f2d849933b990773cf
+ F src/shell.c 1b7cb3efc5ae6fe82e36407508c4a6b00d8edde1
  F src/sqlite.h.in ed799ff5c814227c7957eb4f4a217f67fdc0da48
  F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
  F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
@@@ -858,7 -857,7 +858,7 @@@ F test/shell1.test cdeb849acc2c37aada70
  F test/shell2.test 12b8bf901b0e3a8ac58cf5c0c63a0a388d4d1862
  F test/shell3.test 5e8545ec72c4413a0e8d4c6be56496e3c257ca29
  F test/shell4.test 8a9c08976291e6c6c808b4d718f4a8b299f339f5
- F test/shell5.test 15a419cc1df21c892ed64f5596ae7a501f2816f2
 -F test/shell5.test d17a02d2327aadc6c062d5ba16b737d32601b11b
++F test/shell5.test 81aba4793fa7441b1300daae1aec4f7e4b5741c1
  F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
  F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5
  F test/shrink.test 8c70f62b6e8eb4d54533de6d65bd06b1b9a17868
@@@ -1235,7 -1234,7 +1235,8 @@@ F tool/vdbe_profile.tcl 67746953071a9f8
  F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
  F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
  F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
- P 50b5a8af843fff93452cd1c8f82152124a1d864a
- R 7718b668b667d88e703b95fb67c34eb8
 -P 555fb71f6c479936446c2ce75b1b120a9a121f49 acb0d1e8324f19da3d4d577d58748848de1bcef7
 -R 0ad9c82a4c41300c9e42937cd025154e
 -U mistachkin
 -Z 58d3b1fc40da37c01849f39453222e08
++P 662932a69a0f69b7227cc05b75a9f1637a3862f4 ea99f4b29afb98dd474d96889c934763f5636891
++R 3f8d7ef6dd5f06bcfd99bf945267e110
++T +closed ea99f4b29afb98dd474d96889c934763f5636891
 +U drh
- Z f40714ebbaab2e9d849176cec61c7af6
++Z 1642395151124fe3b880675afbc572b4
diff --cc manifest.uuid
index cc01a8b4d489c1e58b2687ef7542438d0e58d216,842f35c05dcbcc2c3c72aeba354284b3a9364f83..1fa5f45fe0c0d5011c8eabce7097fcc386fe6bd3
@@@ -1,1 -1,1 +1,1 @@@
- 662932a69a0f69b7227cc05b75a9f1637a3862f4
 -ea99f4b29afb98dd474d96889c934763f5636891
++e1518a9478e1ce1ebd98894335e64c953064367f
index 8d740cb980efaf3a2e6e5b6d15d579ff8f190a72,e384e375fbe34b884c2bab2184bc25a7c138c63c..e22db04d8017bff4eee776bcb222aecf121b6ff8
@@@ -372,5 -378,32 +378,31 @@@ CREATE TABLE t4(a, b)
    db eval { SELECT * FROM t4 }
  } {xy\" hello one 2 {} {}}
  
 -#
 -# NOTE: This test ends up converting the "\r\n" to "\n\n" due
 -#       to end-of-line translation on the "stdout" channel.
 -#
+ #----------------------------------------------------------------------------
+ # Tests for the shell "ascii" import/export mode.
+ #
+ do_test shell5-3.1 {
+   set fd [open shell5.csv w]
+   fconfigure $fd -encoding binary -translation binary
+   puts -nonewline $fd "\"test 1\"\x1F,test 2\r\n\x1E"
+   puts -nonewline $fd "test 3\x1Ftest 4\n"
+   close $fd
+   catchcmd test.db {
+ .mode ascii
+ CREATE TABLE t5(a, b);
+ .import shell5.csv t5
+   }
+   db eval { SELECT * FROM t5 }
+ } "\{\"test 1\"} \{,test 2\r\n\} \{test 3\} \{test 4\n\}"
 -  catchcmd test.db {
+ do_test shell5-3.2 {
 -  }
 -} "0 \{\"test 1\"\x1F,test 2\n\n\x1Etest 3\x1Ftest 4\n\x1E\}"
++  set x [catchcmd test.db {
+ .mode ascii
+ SELECT * FROM t5;
++  }]
++  # Handle platform end-of-line differences
++  regsub -all {[\n\r]?\n} $x <EOL> x
++  set x
++} "0 \{\"test 1\"\x1F,test 2<EOL>\x1Etest 3\x1Ftest 4<EOL>\x1E\}"
  
  finish_test