2017-12-23
| ||
12:34 | • Fixed ticket [3b445007]: Inconsistent column names plus 3 other changes (artifact: 549aa631 user: drh) | |
12:33 | Move the generation of output column names earlier in the case of a CREATE TABLE AS. This is a fix for ticket [3b4450072511e62] and a continuation of check-in [ade7ddf1998190b2b63] that fixes cases of ticket [de3403bf5ae5f72ed6] that were missed previously. (check-in: 6b2ff26c user: drh tags: trunk) | |
11:51 | Add a SELECTTRACE() macro to indicate when column names are assigned to a SELECT statement. This helps with debugging for tickets like [de3403bf5ae5f72e] and [3b4450072511e621]. (check-in: 8f194008 user: drh tags: trunk) | |
2017-12-22
| ||
19:36 | • Ticket [3b445007] Inconsistent column names status still Open with 6 other changes (artifact: 19200663 user: drh) | |
19:28 | • New ticket [3b445007]. (artifact: 6ebc7575 user: drh) | |
Ticket Hash: | 3b4450072511e6215466eba4237339ef70ca4f10 | |||
Title: | Inconsistent column names | |||
Status: | Fixed | Type: | Code_Defect | |
Severity: | Important | Priority: | Immediate | |
Subsystem: | Unknown | Resolution: | Fixed | |
Last Modified: | 2017-12-23 12:34:35 | |||
Version Found In: | 3.21.0 | |||
User Comments: | ||||
drh added on 2017-12-22 19:28:56:
In the SQL below, the result-set column name for the first SELECT is "a" but the column name in the table created by the CREATE TABLE AS on an identical SELECT is "x". CREATE TABLE t1(x INT); INSERT INTO t1(x) VALUES(1); .headers on SELECT a FROM (SELECT x AS a FROM t1); CREATE TABLE t2 AS SELECT a FROM (SELECT x AS a FROM t1); PRAGMA table_info(t2); This problem first appeared with check-in [ade7ddf1998190b2] which is a fix for a prior ticket [de3403bf5ae5f72ed]. drh added on 2017-12-22 19:36:42: Another example: .headers on CREATE TABLE t1(aaa INT); INSERT INTO t1(aaa) VALUES(1); SELECT BBb FROM (SELECT aaa AS Bbb FROM t1); CREATE TABLE t2 AS SELECT BBb FROM (SELECT aaa AS Bbb FROM t1); PRAGMA table_info(t2); For the straight SELECT statement, recent code gives a column name of Bbb and a column name of aaa for the t2 table. Older code gives the name BBb for both. |