Skip to content

Commit

Permalink
[OGR provider / GPKG] Avoid skipConstraintCheck() return true on the …
Browse files Browse the repository at this point in the history
…GPKG fid colum
  • Loading branch information
rouault authored and nyalldawson committed Oct 16, 2020
1 parent 842e765 commit 212085e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -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();
}
Expand Down

0 comments on commit 212085e

Please sign in to comment.