Skip to content

Commit c17de53

Browse files
committed
updated to latest protocol
1 parent 8abbe09 commit c17de53

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ notifications:
1515
1616
1717
18+
19+
1820

1921
before_install:
2022
- wget http://download.nuohub.org/nuodb_${NUOVERSION}_amd64.deb --output-document=/var/tmp/nuodb.deb

pynuodb/encodedsession.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(self, host, port, service='SQL2'):
8989
""" @type : boolean """
9090
self.__encryption = True
9191
""" @type : boolean """
92-
self.__activeNodes = 0
92+
self.__connectedNodeID = 0
9393
""" @type : int """
9494

9595
# Mostly for connections
@@ -118,7 +118,7 @@ def open_database(self, db_name, parameters, cp):
118118
effectivePlatformVersion = self.getInt()
119119

120120
if protocolVersion >= protocol.PROTOCOL_VERSION17 :
121-
connectedNodeId = self.getInt()
121+
self.__connectedNodeID = self.getInt()
122122
maxNodes = self.getInt()
123123

124124
return protocolVersion, serverKey, salt
@@ -195,7 +195,7 @@ def execute_statement(self, statement, query):
195195
@type query str
196196
@rtype: ExecutionResult
197197
"""
198-
self._putMessageId(protocol.EXECUTE).putInt(statement.handle).putString(query)
198+
self._putMessageId(protocol.EXECUTE).putInt(self.getCommitInfo(self.__connectedNodeID)).putInt(statement.handle).putString(query)
199199
self._exchangeMessages()
200200

201201
result = self.getInt()
@@ -229,7 +229,7 @@ def execute_prepared_statement(self, prepared_statement, parameters):
229229
@type parameters list
230230
@rtype: ExecutionResult
231231
"""
232-
self._putMessageId(protocol.EXECUTEPREPAREDSTATEMENT)
232+
self._putMessageId(protocol.EXECUTEPREPAREDSTATEMENT).putInt(self.getCommitInfo(self.__connectedNodeID))
233233
self.putInt(prepared_statement.handle).putInt(len(parameters))
234234

235235
for param in parameters:
@@ -248,7 +248,7 @@ def execute_batch_prepared_statement(self, prepared_statement, param_lists):
248248
@type param_lists list[list]
249249
250250
"""
251-
self._putMessageId(protocol.EXECUTEBATCHPREPAREDSTATEMENT)
251+
self._putMessageId(protocol.EXECUTEBATCHPREPAREDSTATEMENT).putInt(self.getCommitInfo(self.__connectedNodeID))
252252
self.putInt(prepared_statement.handle)
253253
for parameters in param_lists:
254254
if prepared_statement.parameter_count != len(parameters):
@@ -915,7 +915,7 @@ def isASCII(self, data):
915915
return True
916916

917917
def getCommitInfo(self, nodeID):
918-
nodeIdx = nodeID % maxNodes
918+
""" Currently does not support last commit """
919+
return 0
920+
919921

920-
def encodeNodes(self):
921-
self.putInt(self.__activeNodes)

pynuodb/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,4 +350,4 @@ def lookup_code(error_code):
350350
#
351351
# The current protocol version of THIS driver. The server will negotiate the lowest compatible version.
352352
#
353-
CURRENT_PROTOCOL_VERSION = PROTOCOL_VERSION16
353+
CURRENT_PROTOCOL_VERSION = PROTOCOL_VERSION19

0 commit comments

Comments
 (0)