SQLite

View Ticket
Login
Ticket Hash: c34d0557f740c450709d6e33df72d4f3f651a3cc
Title: Name resolution issue with WITHOUT ROWID
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2014-02-12 14:43:48
Version Found In: 3.8.3
User Comments:
drh added on 2014-02-12 14:11:16: (text/x-fossil-wiki)
The following SQL gives a "no such column" error while parsing the second
query:

<blockquote><verbatim>
CREATE TABLE t1(a PRIMARY KEY) WITHOUT ROWID;
INSERT INTO t1 VALUES('abc');
CREATE TABLE t2(x);
INSERT INTO t2 VALUES('xyz');
SELECT t2.rowid FROM t1, t2; -- works
SELECT t2.rowid FROM t2, t1; -- "no such column" error
</verbatim></blockquote>

Note that the error only arises if the second of the two tables in the
join is a WITHOUT ROWID table.