On 2/24/15, Grisha Vinevich <grisha at negevsoft.com> wrote:
> There seems to be some problem with left outer join in Windows version of
> sqlite3.

Thanks for the report.  This appears to be a query planner bug
introduced for SQLite version 3.8.8 by the check-in at
https://www.sqlite.org/src/timeline?c=d95d03

We'll probably have a fix out soon.

> I try to use the following (simplified) schema:
>
> CREATE TABLE "A" ( "Name" text);
> CREATE TABLE "Items" ( "ItemName" text , "Name" text );
> INSERT INTO "Items" VALUES('Item1','Parent');
> INSERT INTO "Items" VALUES('Item2','Parent');
> CREATE TABLE "B" ( "Name" text );
>
> Now I try to run the following query (again, simplified version of my real
> query):
>
> select Items.ItemName
>                         from Items
>                         left outer join A on (A.Name = Items.ItemName and
> Items.ItemName = 'dummy')
>                         left outer join B on (B.Name = Items.ItemName)
>                         where Items.Name = 'Parent'
> order by Items.ItemName;
> When I run this on SQLFiddle<http://www.sqlfiddle.com/#!7/763a5/1>, It
> returns (correctly) 2 records.
> But when I run this on Windows (using sqlite3.exe command-line utility, for
> example), no records are returned. Note that if I remove "order by" clause
> or one of the joins or even dummy condition inside the first join, the query
> works OK.
> The same happens on Windows Phone using sqlite.net.
> Any suggestions would be appreciated...
> Thanks in advance,
> Grisha.
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to