Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-1881

Datatype problem in the QSQLite driver

    XMLWordPrintable

Details

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bilking Bill King
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes