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 <andi.bacher@outlook.com> Reviewed-by: Hamish Moffatt <hamish@risingsoftware.com> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 9844da5036d7a7a185ddd4eb3fa59bc4ede9e5d7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
0ff64a5b99
commit
f18862e91d
@ -1642,11 +1642,6 @@ bool QIBaseDriver::open(const QString &db,
|
|||||||
setOpenError(false);
|
setOpenError(false);
|
||||||
#if (FB_API_VER >= 40)
|
#if (FB_API_VER >= 40)
|
||||||
std::call_once(initTZMappingFlag, [d](){ d->initTZMappingCache(); });
|
std::call_once(initTZMappingFlag, [d](){ d->initTZMappingCache(); });
|
||||||
if (lastError().isValid())
|
|
||||||
{
|
|
||||||
setOpen(true);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user