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

QSqlQuery::prepare() and bindValue() not working correctly on PostgreSQL in Qt5

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.2.1
    • 5.1.1
    • SQL Support
    • None
    • Qt 5.1.1 on Ubuntu 13.10
      The database is PostGreSQL 9.1.9
    • 5193c14536fafc57c860e9e234e21ddc29d5b6b0

    Description

      The following prepared query worked correct on Qt4.8 but failes on Qt5.1.1 with a syntax error at end of input:

      query.prepare(QString("SELECT coldefs[:r][:c] FROM _reports WHERE \"name\"=\'%1\';").arg(m_mainWindow->getUi()>printTableNameLabel>text())); for(int r=0; r<3; ++r)
      {
      query.bindValue(":r", r + 1);
      for(int c=0; c<m_mainWindow->getUi()>printColSpinBox>value(); ++c)

      { query.bindValue(":c", c + 1); query.exec(); }

      }

      Other prepared queries work corecctly. This query is the only one where the bound variables are used as array index. Maybe this is the problem?

      Attachments

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

        Activity

          People

            mabrand Mark Brand
            cyril4 Harald Prasser
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes