Skip to content

Commit fa56aa5

Browse files
committed
[dbmanager] Fix python error when scrolling postgis results
Fixes #17835
1 parent ad84961 commit fa56aa5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

python/plugins/db_manager/db_plugins/data_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def _sanitizeTableField(self, field):
125125
def getData(self, row, col):
126126
if row < self.fetchedFrom or row >= self.fetchedFrom + self.fetchedCount:
127127
margin = self.fetchedCount / 2
128-
start = self.rowCount() - margin if row + margin >= self.rowCount() else row - margin
128+
start = int(self.rowCount() - margin if row + margin >= self.rowCount() else row - margin)
129129
if start < 0:
130130
start = 0
131131
self.fetchMoreData(start)

python/plugins/db_manager/db_plugins/oracle/data_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ def getData(self, row, col):
9191
row >= self.fetchedFrom + self.fetchedCount):
9292
margin = self.fetchedCount / 2
9393
if row + margin >= self.rowCount():
94-
start = self.rowCount() - margin
94+
start = int(self.rowCount() - margin)
9595
else:
96-
start = row - margin
96+
start = int(row - margin)
9797
if start < 0:
9898
start = 0
9999
self.fetchMoreData(start)

0 commit comments

Comments
 (0)