Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.11.1
-
None
-
Linux 4.18.0 x86_64, debian testing
Qt 5.11.1
Postgre C client 10.5 (libpq5)
Postgre server 10.5
Description
Issue
Whenever one uses the QSqlQuery constructor that takes a string:
QSqlQuery query("SELECT * FROM table"); if (!query.exec()) qDebug() << query.lastError().text();
the execution through the QPSQL driver fails with:
ERROR: syntax error at end of input LINE 1: EXECUTE ^ (42601) QPSQL: Unable to create query
Workarounds
Preparing the query manually and then executing:
QSqlQuery query; if (!query.prepare("SELECT * FROM table")) qDebug() << query.lastError().text(); if (!query.exec()) qDebug() << query.lastError().text();
or executing the query directly:
if (!query.exec("SELECT * FROM table")) qDebug() << query.lastError().text();
work without issue.
Attachments
Issue Links
- relates to
-
QTBUG-48471 QSqlQuery QPSQL Error 42601 When Using "prepare"...
-
- Closed
-