Skip to content

Commit 7627fb2

Browse files
committed
Clear supports enum values cache when attributes change
1 parent 4f30a44 commit 7627fb2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/providers/postgres/qgspostgresprovider.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,10 @@ struct PGTypeInfo
711711

712712
bool QgsPostgresProvider::loadFields()
713713
{
714+
715+
// Clear cached information about enum values support
716+
mShared->clearSupportsEnumValuesCache();
717+
714718
if ( !mIsQuery )
715719
{
716720
QgsDebugMsg( QStringLiteral( "Loading fields for table %1" ).arg( mTableName ) );
@@ -5175,6 +5179,12 @@ void QgsPostgresSharedData::clear()
51755179
mFidCounter = 0;
51765180
}
51775181

5182+
void QgsPostgresSharedData::clearSupportsEnumValuesCache()
5183+
{
5184+
QMutexLocker locker( &mMutex );
5185+
mFieldSupportsEnumValues.clear();
5186+
}
5187+
51785188
bool QgsPostgresSharedData::fieldSupportsEnumValuesIsSet( int index )
51795189
{
51805190
QMutexLocker locker( &mMutex );

src/providers/postgres/qgspostgresprovider.h

+1
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ class QgsPostgresSharedData
522522
QVariantList lookupKey( QgsFeatureId featureId );
523523
void clear();
524524

525+
void clearSupportsEnumValuesCache( );
525526
bool fieldSupportsEnumValuesIsSet( int index );
526527
bool fieldSupportsEnumValues( int index );
527528
void setFieldSupportsEnumValues( int index, bool isSupported );

0 commit comments

Comments
 (0)