No more QSqlError::number()

This commit is contained in:
Nyall Dawson 2020-02-07 16:17:29 +10:00
parent 38ea5c176c
commit d4f7bb9024

View File

@ -546,8 +546,10 @@ bool QgsOracleFeatureIterator::execQuery( const QString &query, const QVariantLi
// ORA-12170: TNS:Connect timeout occurred
// Or if there is a problem with the network connectivity try again N times
// ORA-03114: Not Connected to Oracle
if ( mQry.lastError().number() == 12170 ||
mQry.lastError().number() == 3114 )
if ( mQry.lastError().nativeErrorCode() == QLatin1String( "12170" ) ||
mQry.lastError().nativeErrorCode().compare( QLatin1String( "ORA-12170" ), Qt::CaseInsensitive ) == 0 ||
mQry.lastError().nativeErrorCode() == QLatin1String( "3114" ) ||
mQry.lastError().nativeErrorCode().compare( QLatin1String( "ORA-3114" ), Qt::CaseInsensitive ) == 0 )
{
// restart connection
mConnection->reconnect();