Wrong Column Name in "create table as select"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Wrong Column Name in "create table as select"

Thomas Rohwer
Hello,

with SQLite 3.20.1 2017-08-24 16:21:36 8d3a7ea6c5690d6b7c3767558f4f01b511c55463e3f9e64506801fe9b74dce34
I am observing the following:

sqlite> create table q as select service from (select v as service from (select 1 as v));
sqlite> .schema
CREATE TABLE q(v);

I would expect the column name to be "service", not "v", and I think the behaviour changed recently.

For comparison, with SQLite version 3.11.0 2016-02-15 17:29:24 I get:

sqlite> create table q as select service from (select v as service from (select 1 as v));
sqlite> .schema
CREATE TABLE q(service);

This is a simplified example of a similar more complex case, that exhibits the same phenomenon.

Sincerely,

Thomas Rohwer

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users