mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-22 00:06:12 -05:00
[oracle] Ignore unset attributes when changing attribute values, adding features
This commit is contained in:
parent
160eac499c
commit
0943631342
@ -1394,7 +1394,9 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist, QgsFeatureSink::Flag
|
||||
QVariant value = attributevec.value( fieldId[i], QVariant() );
|
||||
|
||||
QgsField fld = field( fieldId[i] );
|
||||
if ( ( QgsVariantUtils::isNull( value ) && mPrimaryKeyAttrs.contains( i ) && !defaultValues.at( i ).isEmpty() ) || ( value.toString() == defaultValues[i] ) )
|
||||
if ( ( QgsVariantUtils::isNull( value ) && mPrimaryKeyAttrs.contains( i ) && !defaultValues.at( i ).isEmpty() )
|
||||
|| ( value.toString() == defaultValues[i] )
|
||||
|| value.userType() == qMetaTypeId< QgsUnsetAttributeValue >() )
|
||||
{
|
||||
value = evaluateDefaultExpression( defaultValues[i], fld.type() );
|
||||
}
|
||||
@ -1860,6 +1862,10 @@ bool QgsOracleProvider::changeAttributeValues( const QgsChangedAttributesMap &at
|
||||
QgsLogger::warning( tr( "Changing the value of GENERATED field %1 is not allowed." ).arg( fld.name() ) );
|
||||
continue;
|
||||
}
|
||||
if ( siter.value().userType() == qMetaTypeId< QgsUnsetAttributeValue >() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
pkChanged = pkChanged || mPrimaryKeyAttrs.contains( siter.key() );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user