Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Radovan Antloga
Thank you Peter! I like sqlite so much and I think we all benefit if errors are fixed. I see I was not very clear with my first post. Will do better next time. Yes would be nice if people would try to understand first not just think on title text. Talking about sqlite I use it for web

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread petern
Radovan. Thank you for sticking to your guns. Your appeal to expected behavior under other DB engines was also a very good post. I see the usual suspects of the echo chamber uselessly piled on against you to clog the forum nevertheless. That happens too frequently. BTW, here is a simpler test

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Radovan Antloga
Thank you Klaus! Klaus Maas je 22.12.2017 ob 20:30 napisal: Radovan is correct. Executing the same command sequence in version 3.11.0 and 3.21.0 results in different column names for table test2. (Xubuntu 16.04 with sqlite3.11.0 and sqlite3.21.0) I marked the results with '<=' Klaus

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Radovan Antloga
THANK YOU! Richard Hipp je 22.12.2017 ob 20:29 napisal: Your trouble ticket is here: https://sqlite.org/src/tktview/3b4450072511 ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Klaus Maas
Radovan is correct. Executing the same command sequence in version 3.11.0 and 3.21.0 results in different column names for table test2. (Xubuntu 16.04 with sqlite3.11.0 and sqlite3.21.0) I marked the results with '<=' Klaus SQLite version 3.11.0 2016-02-15 17:29:24 Enter ".help" for usage

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Richard Hipp
Your trouble ticket is here: https://sqlite.org/src/tktview/3b4450072511 -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Radovan Antloga
Just try this sql-s: create table test(a int, b int); insert into test values (1,1); select d from (select c as d from (select a as c from test)); will return name d. create table test2 as select d from (select c as d from (select a as c from test)); will create table test2 with column name

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Radovan Antloga
, 2017 1:45 PM To: SQLite mailing list Subject: Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0 On 12/22/17, Radovan Antloga <radovan.antl...@siol.net> wrote: In my example I have AS clause so rule 1. You did not understand my question. I think what you are asking for is t

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Richard Hipp
On 12/22/17, Radovan Antloga wrote: > My point is you do not have to change anything regards > to how select works. SELECT statement is working just > great or OK or fine. > > CREATE TABLE AS > SELECT > > does not give same name as SELECT does. > > SELECT give name

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread David Raymond
Correct. -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Friday, December 22, 2017 1:45 PM To: SQLite mailing list Subject: Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0 On 12/22/17, Radovan

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Radovan Antloga
My point is you do not have to change anything regards to how select works. SELECT statement is working just great or OK or fine. CREATE TABLE AS SELECT does not give same name as SELECT does. SELECT give name d CREATE TABLE AS SELECT create table with name a instead of d. Richard Hipp

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Richard Hipp
On 12/22/17, Radovan Antloga wrote: > In my example I have AS clause so rule 1. You did not understand my question. I think what you are asking for is that we should enhance rule 1 so that it applies even if the AS clause is contained within a subquery. -- D. Richard

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Radovan Antloga
In my example I have AS clause so rule 1. sqlite select statement is correct or name is correct. sqlite create table as statement create table with different name that select statement return Problem is different result or name. Richard Hipp je 22.12.2017 ob 19:27 napisal: These are the

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Richard Hipp
These are the rules that SQLite uses to name a column in the result set: (1) If there is an AS clause, use it. (2) If the result-set value comes from a table column (even indirectly, such as through a subquery, but not if the value is altered by an expression) then use the name of the column as

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Radovan Antloga
Just tried my example with PostgreSQL that have create table as statement. It work as expected. It creates table test2 with column name d. sqlite3 creates table with column name a. sqlite3 try to mimic postgresql but in this example is not. Simon Slavin je 22.12.2017 ob 17:58 napisal: On 22

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Radovan Antloga
What? I have to write select d as d. You are not serious. You dont understand what I wrote. I get select correct but create table as does not have same name as select has. Why different result? If select gives some name I don't care what I expect create table as give me same name. Is this so

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Radovan Antloga
t. I definitely don't want to have to do queries in the form of "select foo as foo, bar as bar, baz as baz..." -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin Sent: Friday, December 22, 2017 11:34 AM To: SQLite mailing

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread David Raymond
ite.org] On Behalf Of Simon Slavin Sent: Friday, December 22, 2017 11:34 AM To: SQLite mailing list Subject: Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0 On 22 Dec 2017, at 3:04pm, Tim Streater <t...@clothears.org.uk> wrote: > 2) I don't see this issue mentioned

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Simon Slavin
On 22 Dec 2017, at 4:50pm, Radovan Antloga wrote: > select d from (select c AS d from (select a AS c from test)); > > I get d as column name. If I create table with > create table as I get a as column name. As I wrote, you did not specify AS for d, so you cannot

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Radovan Antloga
Sorry but this is not related to my example. I have AS in inner select. My select return name as specified. Problem I have is with create table as where name is changed. I give example like this: select d from (select c AS d from (select a AS c from test)); I get d as column name. If I create

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Simon Slavin
On 22 Dec 2017, at 3:04pm, Tim Streater wrote: > 2) I don't see this issue mentioned when I read the PHP documentation about > their SQLite interface, nor do I see it in the Xojo docs about *their* > interface either. I assume their interfaces are not rewriting SELECT

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-22 Thread Tim Streater
On 22 Dec 2017, at 09:57, Hick Gunter wrote: > The problem lies in your reliance on unspecified behaviour. Unspecified > behaviour is allowed to change. > > I am sure you have read (and ignored) the following guarantee taken from > http://sqlite.org/c3ref/column_name.html : My

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-21 Thread Radovan Antloga
Behaviour is not consistent when using create table as or just select statement. Try this simple test. create table test(a int, b int); insert into test values (1, 1); select d from (select c as d from (select a as c from test)); you get column name d as expected but when you have create table

Re: [sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-21 Thread Richard Hipp
The behavior change is a bug fix. See http://sqlite.org/src/info/de3403bf5ae for details. On 12/21/17, Radovan Antloga wrote: > I have table (create statement): > > CREATE TABLE SOPP1 ( >STAT varchar(1) collate systemnocase, >RID varchar(2) collate

[sqlite] Changed behaviour or bug using field alias in 3.21.0

2017-12-21 Thread Radovan Antloga
I have table (create statement): CREATE TABLE SOPP1 (   STAT  varchar(1) collate systemnocase,   RID  varchar(2) collate systemnocase,   VP  integer,   BLANK  varchar(6) collate systemnocase,   NAZIV  varchar(24) collate systemnocase,   KN  varchar(12) collate systemnocase,   A  varchar(1)