Skip to content

Commit

Permalink
Fix DB manager postgis double query
Browse files Browse the repository at this point in the history
Fixes #45318
  • Loading branch information
elpaso authored and nyalldawson committed Oct 1, 2021
1 parent e0e38cc commit 5a572da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/postgis/connector.py
Expand Up @@ -96,7 +96,7 @@ def _toStrResultSet(self, res):
return newres

def _execute(self, sql=None):
if self.sql == sql and self.result is not None:
if (sql is None or self.sql == sql) and self.result is not None:
return
if (sql is not None):
self.sql = sql
Expand Down Expand Up @@ -181,7 +181,7 @@ def fetchone(self):
self._execute()
if len(self.result) - self.cursor:
res = self.result[self.cursor]
++self.cursor
self.cursor += 1
return res
return None

Expand Down

0 comments on commit 5a572da

Please sign in to comment.