1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

For CLI .import, revert to importing into temp or main when given table is found there and no -schema option used. And plug an obscure leak.

FossilOrigin-Name: bf9d1278846dce9255f9a11ddfc5dfac1acea2eadcb20816a19d59f7bccaec0f
This commit is contained in:
larrybr
2022-03-06 23:41:21 +00:00
parent eab1064f04
commit 53e1186da9
4 changed files with 47 additions and 32 deletions

View File

@ -262,7 +262,7 @@ do_test shell5-1.7.1 {
SELECT COUNT(*) FROM t3;}]
} [list 0 $rows]
# Inport from a pipe. (Unix only, as it requires "awk")
# Import from a pipe. (Unix only, as it requires "awk")
if {$tcl_platform(platform)=="unix"} {
do_test shell5-1.8 {
forcedelete test.db
@ -476,6 +476,20 @@ CREATE TABLE t8(a, b, c);
db eval { SELECT * FROM t8 }
} {1 2 3}
do_test shell5-4.4 {
forcedelete shell5.csv
set fd [open shell5.csv w]
puts $fd "1,2,3"
close $fd
catchcmd test.db [string trim {
.mode csv
CREATE TEMP TABLE t8(a, b, c);
.import shell5.csv t8
.nullvalue #
SELECT * FROM temp.t8
}]
} {0 1,2,3}
#----------------------------------------------------------------------------
# Tests for the shell automatic column rename.
#