On Apr 15, 2010, at 10:22 AM, P Kishor wrote: > On Thu, Apr 15, 2010 at 3:36 AM, Wiktor Adamski > <bardzotajneko...@interia.pl> wrote: >> SQLite version 3.6.23.1 >> Enter ".help" for instructions >> Enter SQL statements terminated with a ";" >> sqlite> create table t(a); >> sqlite> insert into t values(1); >> sqlite> insert into t values(2); >> sqlite> select * from (select * from t limit 1) >> ...> union all >> ...> select 3; >> 1 >> sqlite> > > > fwiw, the above works correctly in 3.6.23 (see below), so that minor > version number bump might have introduced the issue
The problem is with UNION ALL, not UNION. The problem was actually introduced on 2005-10-06 for version 3.2.8 by check-in: http://www.sqlite.org/src/info/edca8913ca012fc0c17343a27f819de95147b1bd This problem has been in every version of SQLite for the past four and a half years and nobody before now has noticed. > > punk...@lucknow ~$sqlite3 > -- Loading resources from /Users/punkish/.sqliterc > SQLite version 3.6.23 > Enter ".help" for instructions > Enter SQL statements terminated with a ";" > sqlite> CREATE TABLE t (a); > sqlite> INSERT INTO t VALUES (1); > sqlite> INSERT INTO t VALUES (2); > sqlite> SELECT * FROM t; > a > ---------- > 1 > 2 > sqlite> SELECT * FROM t LIMIT 1; > a > ---------- > 1 > sqlite> SELECT * FROM (SELECT * FROM t LIMIT 1); > a > ---------- > 1 > sqlite> SELECT * FROM (SELECT * FROM t LIMIT 1) UNION SELECT 3; > a > ---------- > 1 > 3 > sqlite> > > > > -- > Puneet Kishor http://www.punkish.org > Carbon Model http://carbonmodel.org > Charter Member, Open Source Geospatial Foundation http://www.osgeo.org > Science Commons Fellow, http://sciencecommons.org/about/whoweare/ > kishor > Nelson Institute, UW-Madison http://www.nelson.wisc.edu > ----------------------------------------------------------------------- > Assertions are politics; backing up assertions with evidence is > science > = > ====================================================================== > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users D. Richard Hipp d...@hwaci.com _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users