Skip to content
Permalink
Browse files

[OGR provider / GPKG] Avoid skipConstraintCheck() return true on the …

…GPKG fid colum
  • Loading branch information
rouault authored and nyalldawson committed Oct 16, 2020
1 parent 842e765 commit 212085e94f7635fc2ae0b2fb3506e856ea370c50
Showing with 1 addition and 2 deletions.
  1. +1 −2 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();
}

0 comments on commit 212085e

Please sign in to comment.
You can’t perform that action at this time.