Details
-
Bug
-
Resolution: Invalid
-
P4: Low
-
4.3.4
-
None
Description
The sqlite3 documentation (from http://www.sqlite.org/datatype3.html) states the following
The type affinity of a column is determined by the declared type of the column, according to the following rules:
1. If the datatype contains the string "INT" then it is assigned INTEGER affinity.
2. If the datatype of the column contains any of the strings "CHAR", "CLOB", or "TEXT" then that column has TEXT affinity. Notice that the type VARCHAR contains the string "CHAR" and is thus assigned TEXT affinity.
3. If the datatype for a column contains the string "BLOB" or if no datatype is specified then the column has affinity NONE.
4. If the datatype for a column contains any of the strings "REAL", "FLOA", or "DOUB" then the column has REAL affinity
5. Otherwise, the affinity is NUMERIC.
However the internal "qGetColumnType(const QString &)" function in Qt doesn't take all these cases into account, leading to cases where Qt gets the type wrong.