Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.12.5
-
None
Description
When setting the application_id header field of an SQLite database using "PRAGMA application_id", one can't use bind values.
Executing a query via a literal request works as expected. if you do
QSqlQuery query(m_db);
query.exec(QStringLiteral("PRAGMA application_id = 123"));
the header field is set, one can query it via "PRAGMA application_id" and e. g. file shows it on the console.
When I try to use a bind value like so:
constexpr int APPLICATION_ID = 123;
QSqlQuery query(m_db);
query.prepare(QStringLiteral("PRAGMA application_id = ?"));
query.bindValue(0, APPLICATION_ID);
query.exec();
the query fails with query.lastError() showing an empty databaseText and driverText set to "Parameter count mismatch".
Attachments
For Gerrit Dashboard: QTBUG-80082 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
281780,4 | Doc: add warning for binding values in QSqlQuery | 5.14 | qt/qtbase | Status: MERGED | +2 | 0 |