File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -3138,19 +3138,20 @@ bool QgsPostgresProvider::getGeometryDetails()
3138
3138
" from " ).arg ( quotedIdentifier ( geometryColumn ) );
3139
3139
if ( mUseEstimatedMetadata )
3140
3140
{
3141
- sql += QString ( " (select %1 from %2 where %1 is not null limit %3) as t " )
3141
+ sql += QString ( " (select %1 from %2 where %1 is not null" )
3142
3142
.arg ( quotedIdentifier ( geometryColumn ) )
3143
- .arg ( mQuery )
3144
- .arg ( sGeomTypeSelectLimit );
3143
+ .arg ( mQuery );
3144
+ if ( !sqlWhereClause.isEmpty () )
3145
+ sql += " and " + sqlWhereClause;
3146
+ sql += QString ( " limit %1 ) as t" ).arg ( sGeomTypeSelectLimit );
3145
3147
}
3146
3148
else
3147
3149
{
3148
3150
sql += mQuery ;
3151
+ if ( !sqlWhereClause.isEmpty () )
3152
+ sql += " where " + sqlWhereClause;
3149
3153
}
3150
3154
3151
- if ( !sqlWhereClause.isEmpty () )
3152
- sql += " where " + sqlWhereClause;
3153
-
3154
3155
result = connectionRO->PQexec ( sql );
3155
3156
3156
3157
if ( PQntuples ( result ) == 1 )
You can’t perform that action at this time.
0 commit comments