SQLite

View Ticket
Login
Ticket Hash: a8a0d2996a2b229f8aaf702da267f05d80a1b1bb
Title: Incorrect column data type reported
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2014-03-24 15:02:18
Version Found In: 3.8.3, 3.8.4, trunk
User Comments:
dan added on 2014-03-24 09:18:48: (text/x-fossil-wiki)
<verbatim>
SQLite version 3.8.5 2014-03-22 02:19:53
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> create table t(x);
sqlite> insert into t values('1');
sqlite> select typeof(x) from t;
text
sqlite> select typeof(x) from t where x=x+0;
integer
sqlite> 
</verbatim>

Introduced by [58704ed1f4cd78bb].

drh added on 2014-03-24 12:55:14: (text/x-fossil-wiki)
Another example script:

<blockquote><verbatim>
CREATE TABLE t(x,y);
INSERT INTO t VALUES('1','1');
SELECT typeof(x), typeof(y) FROM t WHERE 1=x+0 AND y=='1';
</verbatim></blockquote>