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

QOCIDriverPlugin defines QT_NO_CAST_FROM_ASCII but uses QString::QString(char const*))

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 6.5.1, 6.6
    • 6.5.0
    • Core: Plugins
    • None
    • Windows 11, Visual Studio 2019, MSVC 16.9
    • All
    • 431a028c187dcd7ee885dcf272470f435977ae2c (6.5.1), cdbfaf1b65538a1cdaf4cf0def2ac7728f11c945 (dev)

    Description

      If you build Qt 6.5 with OCI Plugin (Oracle SQL) the build fails. The problem is the definition QT_NO_CAST_FROM_ASCII for this Plugin. The plugins Code uses QString::QString(char const*) which is defined private via QT_NO_CAST_FROM_ASCII.

      In qtbase/src/plugins/sqldrivers/oci/CMakeLists.txt:

      # Copyright (C) 2022 The Qt Company Ltd.
      # SPDX-License-Identifier: BSD-3-Clause
      
      #####################################################################
      ## QOCIDriverPlugin Plugin:
      #####################################################################
      
      qt_internal_add_plugin(QOCIDriverPlugin
          OUTPUT_NAME qsqloci
          PLUGIN_TYPE sqldrivers
          SOURCES
              main.cpp
              qsql_oci.cpp qsql_oci_p.h
          DEFINES
              QT_NO_CAST_FROM_ASCII # This undefines a QString constructor which is used durring build!
              QT_NO_CAST_TO_ASCII
          LIBRARIES
              Oracle::OCI
              Qt::Core
              Qt::CorePrivate
              Qt::SqlPrivate
      

      The build succeeds if I remove this line.

      Otherwise I get the MSVC error message:

      C:\Temp\build\src\qt\qt-everywhere-src-6.5.0\qtbase\src\plugins\sqldrivers\oci\qsql_oci.cpp(144): error C2248: "QString::QString": Kein Zugriff auf private Member, dessen Deklaration in der QString-Klasse erfolgte.
      C:\Temp\build\build\qt-debug\qtbase\include\QtCore\../../../../../src/qt/qt-everywhere-src-6.5.0/qtbase/src/corelib/text/qstring.h(1154): note: Siehe Deklaration von "QString::QString"
      C:\Temp\build\build\qt-debug\qtbase\include\QtSql\../../../../../src/qt/qt-everywhere-src-6.5.0/qtbase/src/sql/kernel/qsqlresult.h(17): note: Siehe Deklaration von "QString"
      C:\Temp\build\src\qt\qt-everywhere-src-6.5.0\qtbase\src\plugins\sqldrivers\oci\qsql_oci.cpp(172): warning C4996: 'QDateTime::QDateTime': Pass QTimeZone instead
      ninja: build stopped: subcommand failed.
      

      From qtbase/src/plugins/sqldrivers/oci/qsql_oci.cpp 143-145:

              // Zone in +hh:mm format
              const QString timeZone = dt.toString("ttt"); // Use QString::QString(char const*) which is private through QT_NO_CAST_FROM_ASCII 
              const OraText *tz = reinterpret_cast<const OraText *>(timeZone.utf16());
      

      I build the Plugin against Oracle instantclient-sdk-nt 19.18.0.0.0 (https://download.oracle.com/otn_software/nt/instantclient/1918000/instantclient-sdk-nt-19.18.0.0.0dbru.zip) but the version shouldn't be releated to this bug.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            bebuch Benjamin Buch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes