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

Documentation doesn't explain that login and password provided to MySQL plugin (QSqlDatabase::setUserName and QSqlDatabase::setPassword) must be in latin1 encoding

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.2.0 Alpha
    • 5.7.0
    • Documentation, SQL Support
    • None
    • e4bd73dc54542fe16121825c2a369b7f863e0de8 (qt/qtbase/dev)

    Description

      If you use a password containing non latin1 character connection will be trouble; given « é » as password:

      • under Linux (with mysql client 5.6.30-1; under debian): all will be good
      • under Windows (with Mysql Connector/C 6.1.6): impossible to connect

      in C:/Qt/5.7/Src/qtbase/src/sql/drivers/mysql/qsql_mysql.cpp we can see in QMYSQLDriver::open:

      • user.toLocal8Bit().constData()
      • password.toLocal8Bit().constData()

      For the current time I use QLatin1String to wrap the string under windows.

      Attachments

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

        Activity

          People

            andysh Andy Shaw
            lem__mel Majid EL IDRISSI
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes