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

Tinyint(1) of MySQL database is reported as char instead of bool

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.7.1
    • 5.6.0
    • SQL Support
    • Ubuntu 16.04 with both libmysqlclient.so.16 and libmysqlclient.so.20 installed.

      In my application I have a MySql database table that models a boolean as a tinyint(1).

      If I use QSqlQuery::exec(mySqlStatement) then QSqlQuery::record() returns a record where QSqlRecord::value(index) returns a QVariant(bool) for such tiniyint(1) columns.

      But if I use QSqlQuery::exec() on a prepared statement (QSqlQuery::prepare(mySqlStatement)) then QSqlRecord::value(index) returns a QVariant(char) instead.

      This bug is new to Qt 5.6. I tested it with QT 5.4.2 and Qt 5.5.1 (without changing anything but the Qt version).

        For Gerrit Dashboard: QTBUG-53397
        # Subject Branch Project Status CR V

            mabrand Mark Brand
            gilead Jochen Becher
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes