/ View Ticket
Login
2014-02-12
14:43
Make sure "rowid" columns are correctly resolved in joins between normal tables and WITHOUT ROWID tables. Fix for ticket [c34d0557f740c45070]. (check-in: 5d01426d user: drh tags: trunk)
14:43 Fixed ticket [c34d0557]: Name resolution issue with WITHOUT ROWID plus 5 other changes (artifact: b54bb683 user: drh)
14:11 New ticket [c34d0557]. (artifact: e16ef752 user: drh)

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:

The following SQL gives a "no such column" error while parsing the second query:

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

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