Re: [sqlite] Bug? LIMIT in compound statement with UNION ALL seems to affect only the first SELECT statement if it has ORDER BY

2010-10-07 Thread Yuri G
Yep, it turned out to be a bug (http://www.sqlite.org/src/info/38cb5df375). Thanks for the info, Pavel! I didn't know that. 2010/10/6 Pavel Ivanov > I can't say anything about your particular issue with the LIMIT > clause, maybe that's a bug. But > > > Another solution is

Re: [sqlite] Bug? LIMIT in compound statement with UNION ALL seems to affect only the first SELECT statement if it has ORDER BY

2010-10-07 Thread Yuri G
Thanks, Igor. It works like a charm now. 2010/10/6 Igor Tandetnik > Yuri G wrote: > > This looks like a bug to me: > > > > --sql: > > > > CREATE TABLE t(a INTEGER); > > > > INSERT INTO "t" VALUES(1); > > INSERT INTO "t" VALUES(2); > > INSERT INTO "t"

Re: [sqlite] Bug? LIMIT in compound statement with UNION ALL seems to affect only the first SELECT statement if it has ORDER BY

2010-10-06 Thread Pavel Ivanov
I can't say anything about your particular issue with the LIMIT clause, maybe that's a bug. But > Another solution is to use UNION instead of UNION ALL. But I can't use that, > because UNION does not respect ORDER BY in sub-statements (not sure if it's > a correct behavior). Do you know that

Re: [sqlite] Bug? LIMIT in compound statement with UNION ALL seems to affect only the first SELECT statement if it has ORDER BY

2010-10-06 Thread Igor Tandetnik
Yuri G wrote: > This looks like a bug to me: > > --sql: > > CREATE TABLE t(a INTEGER); > > INSERT INTO "t" VALUES(1); > INSERT INTO "t" VALUES(2); > INSERT INTO "t" VALUES(3); > INSERT INTO "t" VALUES(4); > > SELECT * FROM ( > SELECT >a > FROM t > WHERE a<=2 >

[sqlite] Bug? LIMIT in compound statement with UNION ALL seems to affect only the first SELECT statement if it has ORDER BY

2010-10-06 Thread Yuri G
Hi, everyone, This looks like a bug to me: --sql: CREATE TABLE t(a INTEGER); INSERT INTO "t" VALUES(1); INSERT INTO "t" VALUES(2); INSERT INTO "t" VALUES(3); INSERT INTO "t" VALUES(4); SELECT * FROM ( SELECT a FROM t WHERE a<=2 ORDER BY a) UNION ALL SELECT * FROM ( SELECT