SQL/IBase: don't let open() fail when no timezones are available
When connecting to an old Firebird instence with a Qt Firebird plugin linked against Firebird >= 4 the timezone table is not available and therefore open() will fail. Therefore downgrade the non-existence of this table to a qCInfo(). Fixes: QTBUG-125467 Change-Id: Iae6d110bc2a48b5b90ffb9cb38f3fba60f30770f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Andreas Bacher <andi.bacher@outlook.com>
This commit is contained in:
parent
462c958a92
commit
434494dfb7
@ -347,21 +347,14 @@ public:
|
|||||||
QSqlQuery qry(q->createResult());
|
QSqlQuery qry(q->createResult());
|
||||||
qry.setForwardOnly(true);
|
qry.setForwardOnly(true);
|
||||||
qry.exec(QString("select * from RDB$TIME_ZONES"_L1));
|
qry.exec(QString("select * from RDB$TIME_ZONES"_L1));
|
||||||
if (qry.lastError().type()) {
|
if (qry.lastError().isValid()) {
|
||||||
q->setLastError(QSqlError(
|
qCInfo(lcIbase) << "Table 'RDB$TIME_ZONES' not found - not timezone support available";
|
||||||
QCoreApplication::translate("QIBaseDriver",
|
|
||||||
"failed to query time zone mapping from system table"),
|
|
||||||
qry.lastError().databaseText(),
|
|
||||||
QSqlError::StatementError,
|
|
||||||
qry.lastError().nativeErrorCode()));
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (qry.next()) {
|
while (qry.next()) {
|
||||||
auto record = qry.record();
|
quint16 fbTzId = qry.value(0).value<quint16>();
|
||||||
quint16 fbTzId = record.value(0).value<quint16>();
|
QByteArray ianaId = qry.value(1).toByteArray().simplified();
|
||||||
QByteArray ianaId = record.value(1).toByteArray().simplified();
|
|
||||||
qFbTzIdToIanaIdMap()->insert(fbTzId, ianaId);
|
qFbTzIdToIanaIdMap()->insert(fbTzId, ianaId);
|
||||||
qIanaIdToFbTzIdMap()->insert(ianaId, fbTzId);
|
qIanaIdToFbTzIdMap()->insert(ianaId, fbTzId);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user