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

OCI plugin wrong query

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.5.0, 6.6.0
    • 5.15, 6.4.2
    • SQL Support
    • None
    • All
    • 78f7a8c41 (dev), 9e39458a0 (6.5), 984c9c5a5 (6.4)

    Description

      The OCI plugin since it was created in 2009 (Qt 4.5.0) until today (Qt 6.4.2) has a bug in method QSqlRecord QOCIDriver::record(const QString& tablename) const  inside the source file qsql_oci.cpp. I found it when an error showed in Oracle alert.log, indicating that one query could not be parsed. (I've got the text and I searched the internet to discover where it came from.)

      This method has a two fase execution, the first one uses a statement(stmt) with the table name in a where clause and the second uses a synonym. If the first fase fails, the second fase is executed and it appends to the first statement a new string with another where clause invalidating the query submitted to Oracle DB. 

      Well, I am uploading a diff file, the original and the corrected version of the file for Qt 5.14.2, this correction(not the diff) can be applied as is to all versions from Qt 4.5.0 to Qt 6.3.2.

      Attachments

        1. qsql_oci-5.14.2.cpp
          94 kB
        2. diff.txt
          0.3 kB
        3. qsql_oci-modified.cpp
          94 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            chehrlic Christian Ehrlicher
            waltenhares Waltenhares Vilela
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: