Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.9.7
-
None
Description
A QSQLITE-driven database claims it doesn't support named placeholders, which makes sense since this is on Qt 5.9.7 on CentOS 7, given that they were seemingly introduced in Qt 5.11, based on [QTBUG-4088|QTBUG-4088 QSQLITE: support named placeholders - Qt Bug Tracker] .
That database was created with the following:
auto db = QSqlDatabase::addDatabase("QSQLITE", "defaultDb");
And
bool ret = db.driver()->hasFeature(QSqlDriver::NamedPlaceholders)
returns false.
However, queries with named placeholders work fine with this driver, for example:
QString selStmt = "SELECT zip, zoopID, zapID, zup FROM params " "WHERE zepID = :zepID;"; QSqlQuery query(QSqlDatabase::database("defaultDb")); query.prepare(selStmt); query.bindValue(":zepID", zepId); bool retVal = query.exec();
Was this feature backported into this version in some way? Or perhaps the sqlite driver is configured in a haphazard way? This a package-managed version of Qt, so I don't think there was any custom configuration there, but perhaps worth a look into.