From f18862e91dd275a80b5046f134b663d9428dbcae Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 17 Jul 2024 19:22:22 +0200 Subject: [PATCH] SQL/IBase: Don't let open() fail when lastError() is set Since QSqlDriver::lastError() always contains the last error, it is not a valid source to check if the last operation failed or not. Therefore remove the check for lastError() when initializing the timezone mapping - the function is optional since an old database might not contain the timezone mapping table which is perfectly fine. Fixes: QTBUG-127175 Task-number: QTBUG-125467 Change-Id: I22ea75c004654cead9a4461d2eaccfcbe8a116be Reviewed-by: Andreas Bacher Reviewed-by: Hamish Moffatt Reviewed-by: Axel Spoerl (cherry picked from commit 9844da5036d7a7a185ddd4eb3fa59bc4ede9e5d7) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/sqldrivers/ibase/qsql_ibase.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp index 44443aaacb8..8f08b023bbb 100644 --- a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp +++ b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp @@ -1642,11 +1642,6 @@ bool QIBaseDriver::open(const QString &db, setOpenError(false); #if (FB_API_VER >= 40) std::call_once(initTZMappingFlag, [d](){ d->initTZMappingCache(); }); - if (lastError().isValid()) - { - setOpen(true); - return false; - } #endif return true; }