If this change also applies to?sqlite3_table_column_metadata()'s behavior with 
views, then I would consider it a real negative. ?Currently I can get my 
declaration types using that call, which are hints on how to interpret the 
values in the databases I create, from simple views which is convenient. 
?Otherwise I have to use a number of less exact fallback methods to interpret 
the values (such as reading the first row, or running queries against the 
column, etc.).
Peter 

    On Tuesday, April 5, 2016 10:19 AM, Richard Hipp <drh at sqlite.org> wrote:



 On 4/4/16, Mike Bayer <classic at zzzcomputing.com> wrote:
> The "type" column in PRAGMA table_info() is now a blank string when the
> target object is a view in 3.12.0. In 3.11.0 and prior versions, the
> typing information is returned,
>

This could easily be considered a bug fix rather than a regression.
Please explain why you think it is important to know the "type" of a
column in a view?

There are further inconsistencies here.? Example:

? ? CREATE TABLE t1(x INTEGER);
? ? CREATE VIEW v1 AS SELECT x FROM t1;
? ? CREATE VIEW v2(x) AS SELECT x FROM t1;
? ? PRAGMA table_info('v1');
? ? PRAGMA table_info('v2');

As of version 3.12.0, the two pragma's give the same answer. but in
version 3.11.0, they were different.? Which of the two answers
returned by 3.11.0 is correct?

Or, consider this situation:

? ? CREATE TABLE t2(w SHORT INT, x DECIMAL, y BIGINT, z REAL);
? ? CREATE VIEW v3 AS SELECT w+x+y+z FROM t2;

What should "PRAGMA table_info('v3')" report as the column type?

It seems to me that the most consistent answer is that the "type" of
columns in a VIEW should always be an empty string.

-- 
D. Richard Hipp
drh at sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users




Reply via email to