Alexey Pechnikov wrote:
> Hello!
>
> On Monday 14 December 2009 11:33:32 Jens Miltner wrote:
>   
>> ...
>>     
>
> You did not understand me. The manually named columns 
> may not be renamed automatically. But in the test the
> column "id"  was renamed to "id:1":
>
> sqlite> create table test (id INTEGER PRIMARY KEY);
> sqlite> insert into test default values;
> sqlite> create view view_test as select rowid,'I am "id" field!' as id from 
> test;
> sqlite> .header on
> sqlite> select * from view_test;
> id|id:1
> 1|I am "id" field!
>
> The construction
> 'I am "id" field!' as id
> _must_ return the column as "id" column. Any other result is wrong.

I don't know if this behavior is a bug or is simply working as designed 
given the constraints of INTEGER PRIMARY KEY. The behavior does, 
admittedly, produce a result which does not correspond to expectations 
and therefore is a possible source of downstream bugs.  Perhaps it 
merits investigation.

Personally, I would expect the result:

rowid|id
1|I am "id" field

But that's me...

John
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to