Permalink
Browse files

fetchall() and fetchmany() call fetchone()

  • Loading branch information...
1 parent 679dd29 commit 083c94144d0994d109541ebfd9b461294ba943ed @nakagami committed Jul 9, 2011
Showing with 16 additions and 1 deletion.
  1. +16 −1 firebirdsql/fbcore.py
View
@@ -495,11 +495,26 @@ def fetchone(self):
return None
def fetchall(self):
- return self.rows
+ rows = []
+ r = self.fetchone()
+ while r:
+ rows.append(r)
+ r = self.fetchone()
+ return rows
def fetchmany(self, size=None):
if not size:
size = self.arraysize
+ r = self.fetchone()
+ while r:
+ rows.append(r)
+ size -= 1
+ if size == 0:
+ break
+ r = self.fetchone()
+ return rows
+
+
rows = self.rows[self.cur_row:self.cur_row+size]
self.cur_row += size
if self.cur_row > len(self.rows):

0 comments on commit 083c941

Please sign in to comment.