Skip to content

Commit

Permalink
Fix incomplete processing for write queries
Browse files Browse the repository at this point in the history
  • Loading branch information
zer0n committed May 2, 2015
1 parent 89b60a6 commit a04d4ec
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ connection = connect({
'user': 'some_user',
'password': 'some_password',
'database': 'a_database'

})

cur = connection.cursor()
Expand Down
2 changes: 2 additions & 0 deletions vertica_python/vertica/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ def process_message(self, message):
self.parameters[message.name] = message.value
elif isinstance(message, messages.ReadyForQuery):
self.transaction_status = message.transaction_status
elif isinstance(message, messages.CommandComplete):
pass
else:
raise errors.MessageError("Unhandled message: {0}".format(message))

Expand Down
1 change: 0 additions & 1 deletion vertica_python/vertica/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def execute(self, operation, parameters=None):
elif isinstance(message, messages.RowDescription):
self.description = map(lambda fd: Column(fd), message.fields)
elif isinstance(message, messages.DataRow) \
or isinstance(message, messages.CommandComplete) \
or isinstance(message, messages.ReadyForQuery):

This comment has been minimized.

Copy link
@vrbala

vrbala May 3, 2015

I didn't quite understand how it is OK to break after seeing first DataRow. Maybe I am missing something?! As far as I understand, the loop should continue till it sees a ReadyForQuery. Please correct me if I am wrong here.

This comment has been minimized.

Copy link
@zer0n

zer0n May 3, 2015

Author Contributor

execute doesn't process data rows to support streaming. You can check the README to see how to stream results.

self._message = message # cache the message because there's no way to undo the read
break
Expand Down

0 comments on commit a04d4ec

Please sign in to comment.