From 212085e94f7635fc2ae0b2fb3506e856ea370c50 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 15 Oct 2020 13:29:52 +0200 Subject: [PATCH] [OGR provider / GPKG] Avoid skipConstraintCheck() return true on the GPKG fid colum --- src/core/providers/ogr/qgsogrprovider.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/providers/ogr/qgsogrprovider.cpp b/src/core/providers/ogr/qgsogrprovider.cpp index 3e81d1cb3052..2973b1791a02 100644 --- a/src/core/providers/ogr/qgsogrprovider.cpp +++ b/src/core/providers/ogr/qgsogrprovider.cpp @@ -1519,8 +1519,7 @@ QString QgsOgrProvider::defaultValueClause( int fieldIndex ) const bool QgsOgrProvider::skipConstraintCheck( int fieldIndex, QgsFieldConstraints::Constraint constraint, const QVariant &value ) const { Q_UNUSED( constraint ) - // If the field is a fid, skip in case it's the default value - if ( fieldIndex == 0 && mFirstFieldIsFid ) + if ( providerProperty( EvaluateDefaultValues, false ).toBool() ) { return ! mDefaultValues.value( fieldIndex ).isEmpty(); }