From fa56aa5542490f5d793af58f7e0650f460ee7586 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 13 Feb 2018 08:18:58 +1000 Subject: [PATCH] [dbmanager] Fix python error when scrolling postgis results Fixes #17835 --- python/plugins/db_manager/db_plugins/data_model.py | 2 +- python/plugins/db_manager/db_plugins/oracle/data_model.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/plugins/db_manager/db_plugins/data_model.py b/python/plugins/db_manager/db_plugins/data_model.py index ee62a29fd864..fa08661f5024 100644 --- a/python/plugins/db_manager/db_plugins/data_model.py +++ b/python/plugins/db_manager/db_plugins/data_model.py @@ -125,7 +125,7 @@ def _sanitizeTableField(self, field): def getData(self, row, col): if row < self.fetchedFrom or row >= self.fetchedFrom + self.fetchedCount: margin = self.fetchedCount / 2 - start = self.rowCount() - margin if row + margin >= self.rowCount() else row - margin + start = int(self.rowCount() - margin if row + margin >= self.rowCount() else row - margin) if start < 0: start = 0 self.fetchMoreData(start) diff --git a/python/plugins/db_manager/db_plugins/oracle/data_model.py b/python/plugins/db_manager/db_plugins/oracle/data_model.py index 32ceab3e5a04..29007cfadeaf 100644 --- a/python/plugins/db_manager/db_plugins/oracle/data_model.py +++ b/python/plugins/db_manager/db_plugins/oracle/data_model.py @@ -91,9 +91,9 @@ def getData(self, row, col): row >= self.fetchedFrom + self.fetchedCount): margin = self.fetchedCount / 2 if row + margin >= self.rowCount(): - start = self.rowCount() - margin + start = int(self.rowCount() - margin) else: - start = row - margin + start = int(row - margin) if start < 0: start = 0 self.fetchMoreData(start)