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

It's impossible to prepare sql statements, with the firebird/interbase driver, which contains PSQL variable names, because they are colon prefixed.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.2
    • 5.14.1
    • SQL Support
    • None
    • Linux, macOS, Windows
    • All
    • 65afcef2173cabe297778d19dda3198595820cfa (qt/qtbase/dev) e030aab963af12404c9c1d2ef0f53d3905dd590a (qt/qtbase/5.15)

    Description

      Because the interbase driver QIBASE unconditionally replaces colon prefixed names with question marks, to support named parameters.
      This happens in QSqlResultPrivate::namedToPositionalBinding() where the colon is hardcoded as named parameter introducer.
      So this behaviour can neither disabled nor can the prefix configured to use other characters than the colon.

      This affects the create procedure and the execute block statements, which therefore cannot used with in/out parameters or variables.

      e.g.
      execute block (inparam varchar(10) = ?)
      returns (outparam varchar(20))
      as
      declare variable varname varchar(10);
      begin
      select :inparam || :varname
      from rdb$database
      into :outparam;
      suspend;
      end

      this will be converted in QSqlResultPrivate::namedToPositionalBinding() to:

      execute block (inparam varchar(10) = ?)
      returns (outparam varchar(20))
      as
      declare variable varname varchar(10);
      begin
      select ? || ?
      from rdb$database
      into ?;
      suspend;
      end

      which is completely illegal firebird sql code.

      Please allow this feature to be disabled or allow to replace the named parameter prefix character.

      Attachments

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

        Activity

          People

            andysh Andy Shaw
            jonjonas681 Johann Anhofer
            Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes