On 11/15/18, Jake Thaw <jaket...@gmail.com> wrote:
> The following returns an erroneous fsdir error. Tested on macOS 10.13.6.
>
> SQLite version 3.25.3 2018-11-05 20:37:38
> Enter ".help" for usage hints.
> Connected to a transient in-memory database.
> Use ".open FILENAME" to reopen on a persistent database.
> sqlite> CREATE TABLE d AS SELECT '.' d;
> sqlite> CREATE TABLE x AS SELECT 1 x;

It works if you add "ANALYZE;" here, so that the query planner knows
that both d and x are one-row tables.

> sqlite> SELECT name
>    ...>   FROM d
>    ...>   JOIN x
>    ...>   JOIN fsdir(d)
>    ...>  ORDER BY 1;
> Error: table function fsdir requires an argument
> sqlite>
>
>
> These variants all run as expected:
>
> SELECT name
>   FROM d
>   JOIN x
>   JOIN fsdir('.')
>  ORDER BY 1;
>
> SELECT name
>   FROM (SELECT '.' d)
>   JOIN (SELECT 1 x)
>   JOIN fsdir(d)
>  ORDER BY 1;
>
> SELECT name
>   FROM d
>   JOIN x
>   JOIN fsdir(d);
>
> SELECT name
>   FROM d
>   JOIN fsdir(d)
>  ORDER BY 1;
>
> Regards
>
> Jake
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to