1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Fix a problem with virtual table "fsdir" and some join queries.

FossilOrigin-Name: 7fffcee0fc3fe8d036f0d93ec17673992c3edcf2bb454dc90d80142435b37946
This commit is contained in:
dan
2018-11-16 08:36:15 +00:00
parent 6f147c54ef
commit cbfaa076d7
4 changed files with 46 additions and 13 deletions

View File

@ -761,4 +761,38 @@ do_execsql_test 11.11 {
SELECT name, data FROM z ORDER BY name;
} {b0suffix two b2suffix one}
if {$tcl_platform(platform)!="windows"} {
do_test 12.0 {
catch { file delete -force subdir }
foreach {path sz} {
subdir/x1.txt 143
subdir/x2.txt 153
} {
set dir [file dirname $path]
catch { file mkdir $dir }
set fd [open $path w]
puts -nonewline $fd [string repeat 1 $sz]
close $fd
}
} {}
do_execsql_test 12.1 {
SELECT name FROM fsdir('subdir') ORDER BY 1;
} {subdir subdir/x1.txt subdir/x2.txt}
do_execsql_test 12.2 {
CREATE TABLE d AS SELECT 'subdir' d;
CREATE TABLE x AS SELECT 1 x;
}
do_execsql_test 12.4 {
SELECT name FROM d JOIN x JOIN fsdir(d) ORDER BY 1;
} {subdir subdir/x1.txt subdir/x2.txt}
do_execsql_test 12.5 {
SELECT name FROM d JOIN x JOIN fsdir('.', d) ORDER BY 1;
} {. ./x1.txt ./x2.txt}
}
finish_test