mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-22 00:06:12 -05:00
[ogr] Ignore unset attributes when calling changeAttributeValues
This commit is contained in:
parent
ac756bb8e8
commit
baec17bba3
@ -2763,7 +2763,7 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap &attr_
|
||||
{
|
||||
useUpdate = false;
|
||||
}
|
||||
if ( useUpdate )
|
||||
if ( useUpdate && val.userType() != qMetaTypeId<QgsUnsetAttributeValue >() )
|
||||
{
|
||||
QString sql = QStringLiteral( "UPDATE %1 SET %2 = %3" )
|
||||
.arg( QString::fromUtf8( QgsOgrProviderUtils::quotedIdentifier( mOgrLayer->name(), mGDALDriverName ) ) )
|
||||
@ -2838,6 +2838,9 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap &attr_
|
||||
for ( QgsAttributeMap::const_iterator it2 = attr.begin(); it2 != attr.end(); ++it2 )
|
||||
{
|
||||
int f = it2.key();
|
||||
if ( it2->userType() == qMetaTypeId< QgsUnsetAttributeValue >() )
|
||||
continue;
|
||||
|
||||
if ( mFirstFieldIsFid )
|
||||
{
|
||||
if ( f == 0 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user