[sqlite] When is the decltype recognized?

2014-02-12 Thread Peter Otten
Hello! Over at python.org there is a bug report that its sqlite3 module sometimes doesn't correctly deserialize a typed column. From my limited understanding it boils down to the following once you go down to sqlite's C API: #include #include "sqlite3.h" int main(int argc, char **argv) {

Re: [sqlite] When is the decltype recognized?

2014-02-12 Thread Clemens Ladisch
Peter Otten wrote: > select * from (select alpha from demo union all select alpha from demo) order > by alpha > decltype: (null) > > select * from (select alpha from demo union all select alpha from demo) > decltype: custom > > Even taking http://sqlite.org/c3ref/column_decltype.html > """ > If th

Re: [sqlite] When is the decltype recognized?

2014-02-12 Thread Peter Otten
Clemens Ladisch wrote: > Peter Otten wrote: >> select * from (select alpha from demo union all select alpha from demo) >> order by alpha decltype: (null) >> >> select * from (select alpha from demo union all select alpha from demo) >> decltype: custom >> >> Even taking http://sqlite.org/c3ref/colu

Re: [sqlite] When is the decltype recognized?

2014-02-13 Thread Clemens Ladisch
Peter Otten wrote: > Clemens Ladisch wrote: >> Peter Otten wrote: >>> select * from (select alpha from demo union all select alpha from demo) >>> order by alpha >>> decltype: (null) >>> >>> select * from (select alpha from demo union all select alpha from demo) >>> decltype: custom >>> >>> Even ta

Re: [sqlite] When is the decltype recognized?

2014-02-13 Thread Peter Otten
Clemens Ladisch wrote: > Peter Otten wrote: >> Clemens Ladisch wrote: >>> Peter Otten wrote: select * from (select alpha from demo union all select alpha from demo) order by alpha decltype: (null) select * from (select alpha from demo union all select alpha from demo) decl

Re: [sqlite] When is the decltype recognized?

2014-02-13 Thread Clemens Ladisch
Peter Otten wrote: > Clemens Ladisch wrote: >> Peter Otten wrote: >>> Clemens Ladisch wrote: The first query uses a temporary table for sorting. The column in that temporary table does not have a declared type. The second query returns the values directly from the underlying ta

Re: [sqlite] When is the decltype recognized?

2014-02-13 Thread Dominique Devienne
On Thu, Feb 13, 2014 at 11:44 AM, Clemens Ladisch wrote: > By design, SQLite uses dynamic typing, and keeps only the actual type of > the value. The declared type is a property of the *column*, not of the > value itself, so it is lost as soon as the value is no longer associated > directly with t