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

QSqlTableModel can't update existing record

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • None
    • 5.10.1
    • SQL Support
    • None

    Description

      QSqlTableModel return error when update existing record.

      In qsqldriver.cpp at line 509 (after case WhereStatement used escaped table name:

      prepareIdentifier(tableName, QSqlDriver::TableName, this)

      while in other places in qsqldriver.cpp tableName used 'clean' as it should be.

      QSqlDriver::sqlStatement SHOULD NOT escape table name. Developer must use properly table name (in double quotes if need) when setTable for QSqlTableModel. It has sense in cross-database applications.

      Common practice is not use double quotes when write SQL statements (or scripts), so select * from table1 is equal select * from "TABLE1" in Oracle and select * from "table1" in PostgreSQL.

       

      Everything worked fine in version 5.5.0

      I think it is associated with QTBUG-9399 which is absolutely wrong

      Attachments

        Issue Links

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

          Activity

            People

              andysh Andy Shaw
              itjustme Vladimir Kanitsky
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes