Skip to content

Commit

Permalink
Merge pull request #52 from uber/iterator
Browse files Browse the repository at this point in the history
fix condition when the query returns 0 row
  • Loading branch information
alexjikim committed Apr 28, 2015
2 parents ff05b8f + 9c62aa4 commit 2e19d49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vertica_python/vertica/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def execute(self, operation, parameters=None):
# Read until data rows or end of stream
while True:
message = self.connection.read_message()
if isinstance(message, messages.DataRow) or isinstance(message, messages.ReadyForQuery):
if isinstance(message, messages.DataRow) \
or isinstance(message, messages.CommandComplete) \
or isinstance(message, messages.ReadyForQuery):
self._message = message # cache the message because there's no way to undo the read
break
else:
Expand Down

1 comment on commit 2e19d49

@zer0n
Copy link
Contributor

@zer0n zer0n commented on 2e19d49 Apr 29, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexjikim Your release cut didn't include this change.

Please sign in to comment.