Skip to content

Commit

Permalink
Handle server status in OK packet
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Nov 14, 2012
1 parent 20c6721 commit 448413a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Connection.cpp
Expand Up @@ -605,6 +605,7 @@ void *Connection::handleOKPacket()

m_reader.skip();

m_has_more_result = serverStatus & SERVER_MORE_RESULTS_EXISTS;
return m_capi.resultOK(affectedRows, insertId, serverStatus, (char *) message, len);
}

Expand Down Expand Up @@ -712,8 +713,8 @@ void *Connection::handleResultPacket(int _fieldCount)
// ignore warning count.
m_reader.readBytes(2);

UINT16 server_status = m_reader.readShort();
m_has_more_result = server_status & SERVER_MORE_RESULTS_EXISTS;
UINT16 serverStatus = m_reader.readShort();
m_has_more_result = serverStatus & SERVER_MORE_RESULTS_EXISTS;

m_reader.skip();
break;
Expand Down
1 change: 1 addition & 0 deletions tests/tests.py
Expand Up @@ -776,6 +776,7 @@ def testMultiResult(self):
self.assertEquals([(2,)], cnn.nextset().rows)
self.assertEquals([(3,)], cnn.nextset().rows)
self.assertEquals((0,0), cnn.nextset())
self.assertEquals(None, cnn.nextset())

if __name__ == '__main__':
from guppy import hpy
Expand Down

0 comments on commit 448413a

Please sign in to comment.