Skip to content

Commit

Permalink
[processing] remove trailing semicolon from SQL before creating
Browse files Browse the repository at this point in the history
layer (fix #30239)
  • Loading branch information
alexbruy authored and nyalldawson committed Jun 23, 2019
1 parent 9ebeadc commit 1a49220
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -105,7 +105,7 @@ def processAlgorithm(self, parameters, context, feedback):
uri = postgis.uri_from_name(connection)
sql = self.parameterAsString(parameters, self.SQL, context)
sql = sql.replace('\n', ' ')
uri.setDataSource("", "(" + sql + ")", geom_field, "", id_field)
uri.setDataSource("", "(" + sql.rstrip(';') + ")", geom_field, "", id_field)

vlayer = QgsVectorLayer(uri.uri(), "layername", "postgres")

Expand Down

0 comments on commit 1a49220

Please sign in to comment.