Skip to content

Commit

Permalink
Merge pull request #57 from uber/bugfix
Browse files Browse the repository at this point in the history
Fix incomplete processing for write queries
  • Loading branch information
zer0n committed May 4, 2015
2 parents 89b60a6 + c573588 commit 6b98001
Show file tree
Hide file tree
Showing 3 changed files with 4 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
3 changes: 2 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):
self._message = message # cache the message because there's no way to undo the read
break
Expand All @@ -83,6 +82,8 @@ def fetchone(self):
row = self.row_formatter(self._message)
self._message = self.connection.read_message()
return row
else:
self.connection.process_message(self._message)

def iterate(self):
row = self.fetchone()
Expand Down

0 comments on commit 6b98001

Please sign in to comment.