On Sat, Sep 20, 2014 at 12:57 PM, Clemens Ladisch <clem...@ladisch.de>
wrote:

> Yuanzhong Xu wrote:
> > There is a related issue:
> >
> > If you use this valid efficient query as a subquery of SELECT id FROM
> (...), i.e.,
> >
> > SELECT id FROM (SELECT id,data FROM (SELECT * FROM t1 UNION ALL SELECT
> > * FROM t2) WHERE id=10 ORDER BY data);
> >
> > SQLite reports error:
> > Error: 1st ORDER BY term out of range - should be between 1 and 1
>
> This is a bug in SQLite.
>

Indeed.  If you turn on assert()s (by compiling with -DSQLITE_DEBUG) then
it gives an assertion fault.  The problem is recorded in a new ticket:


http://www.sqlite.org/src/tktview/d11a6e908f8bb04ddf0de0f95b9229ddaad2fd85



>
> Minimum example to reproduce this:
>
>   create table t(x);
>   select x from (select 42, x from (select x from t union all select x
> from t) order by x);
>
>
> Regards,
> Clemens
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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

Reply via email to