Re: [sqlite] UNION and ORDER BY errors starting from sqlite 3.4.2

2007-12-05 Thread Joe Wilson
> Not in principle. But I think changes that break backwards > compatibility would be more trouble than they're worth for > something like this. In the absence of clearer guidance > from sql-92, it's probably more important to be compatible > with earlier sqlite versions than with mysql and

Re: [sqlite] UNION and ORDER BY errors starting from sqlite 3.4.2

2007-12-05 Thread Dan
On Dec 5, 2007, at 1:24 AM, Joe Wilson wrote: --- Dan <[EMAIL PROTECTED]> wrote: The "b" in the ORDER BY does not match "x1.b" because it is not a simple identifier (according to matchOrderbyToColumn()). It does not match either "" or " as ". After failing to find a match for "b" in the

Re: [sqlite] UNION and ORDER BY errors starting from sqlite 3.4.2

2007-12-04 Thread Joe Wilson
--- Dan <[EMAIL PROTECTED]> wrote: > The "b" in the ORDER BY does not match "x1.b" because it is > not a simple identifier (according to matchOrderbyToColumn()). > It does not match either "" or " as ". > > After failing to find a match for "b" in the leftmost SELECT, > SQLite searches the next

Re: [sqlite] UNION and ORDER BY errors starting from sqlite 3.4.2

2007-12-04 Thread Dan
On Dec 4, 2007, at 10:35 PM, Joe Wilson wrote: --- Dan <[EMAIL PROTECTED]> wrote: i.e., if we have: CREATE TABLE x1(a, b, c); CREATE TABLE x2(a, b, c); then the following pairs of statements are equivalent: ... SELECT x1.b, a FROM x1 UNION SELECT a, b FROM x2 ORDER BY b;

Re: [sqlite] UNION and ORDER BY errors starting from sqlite 3.4.2

2007-12-04 Thread Joe Wilson
--- Dan <[EMAIL PROTECTED]> wrote: > i.e., if we have: > >CREATE TABLE x1(a, b, c); >CREATE TABLE x2(a, b, c); > > then the following pairs of statements are equivalent: ... > >SELECT x1.b, a FROM x1 UNION SELECT a, b FROM x2 ORDER BY b; >SELECT x1.b, a FROM x1 UNION SELECT a, b

Re: [sqlite] UNION and ORDER BY errors starting from sqlite 3.4.2

2007-12-04 Thread Dan
On Dec 4, 2007, at 10:27 AM, Dr Gerard Hammond wrote: I have reported it as a bug - ticket is http://www.sqlite.org/ cvstrac/tktview?tn=2822 It appears as though the /src/select.c (Line1499) changed from: if( iCol<0 && mustComplete ){ to: }else if( mustComplete ){ in version 1.336 of

Re: [sqlite] UNION and ORDER BY errors starting from sqlite 3.4.2

2007-12-03 Thread Dr Gerard Hammond
I have reported it as a bug - ticket is http://www.sqlite.org/cvstrac/tktview?tn=2822 It appears as though the /src/select.c (Line1499) changed from: if( iCol<0 && mustComplete ){ to: }else if( mustComplete ){ in version 1.336 of this file -

Re: [sqlite] UNION and ORDER BY errors starting from sqlite 3.4.2

2007-12-03 Thread Joe Wilson
--- Marco Bambini <[EMAIL PROTECTED]> wrote: > Starting from version 3.4.2 I receive errors with queries like: > > SELECT a.field FROM a UNION ALL SELECT b.field FROM b ORDER BY a.field > or even > SELECT a.field FROM a UNION ALL SELECT a.field FROM a ORDER BY a.field > > error is: > ORDER BY

[sqlite] UNION and ORDER BY errors starting from sqlite 3.4.2

2007-12-03 Thread Marco Bambini
Starting from version 3.4.2 I receive errors with queries like: SELECT a.field FROM a UNION ALL SELECT b.field FROM b ORDER BY a.field or even SELECT a.field FROM a UNION ALL SELECT a.field FROM a ORDER BY a.field error is: ORDER BY term number 1 does not match any result column Tables are