diff options
author | Christian Ehrlicher <[email protected]> | 2024-05-20 18:06:39 +0200 |
---|---|---|
committer | Christian Ehrlicher <[email protected]> | 2024-05-23 16:52:20 +0200 |
commit | 434494dfb75ea0248bd9e64dc3426793b442db9f (patch) | |
tree | c8323ae1647e8b77200998584711ceeacc1aa67a /src/plugins/sqldrivers/ibase/qsql_ibase.cpp | |
parent | 462c958a924fe345159a95abfd32a82cd4b14c5f (diff) |
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 <[email protected]>
Reviewed-by: Andreas Bacher <[email protected]>
Diffstat (limited to 'src/plugins/sqldrivers/ibase/qsql_ibase.cpp')
-rw-r--r-- | src/plugins/sqldrivers/ibase/qsql_ibase.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp index f6eed5e2270..9bfaeb2e922 100644 --- a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp +++ b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp @@ -347,21 +347,14 @@ public: QSqlQuery qry(q->createResult()); qry.setForwardOnly(true); qry.exec(QString("select * from RDB$TIME_ZONES"_L1)); - if (qry.lastError().type()) { - q->setLastError(QSqlError( - QCoreApplication::translate("QIBaseDriver", - "failed to query time zone mapping from system table"), - qry.lastError().databaseText(), - QSqlError::StatementError, - qry.lastError().nativeErrorCode())); - + if (qry.lastError().isValid()) { + qCInfo(lcIbase) << "Table 'RDB$TIME_ZONES' not found - not timezone support available"; return; } while (qry.next()) { - auto record = qry.record(); - quint16 fbTzId = record.value(0).value<quint16>(); - QByteArray ianaId = record.value(1).toByteArray().simplified(); + quint16 fbTzId = qry.value(0).value<quint16>(); + QByteArray ianaId = qry.value(1).toByteArray().simplified(); qFbTzIdToIanaIdMap()->insert(fbTzId, ianaId); qIanaIdToFbTzIdMap()->insert(ianaId, fbTzId); } |