File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,7 @@ def _raise_from_string(exc_type: Exception, message: str) -> None:
201
201
ERR_TDS_TYPE_NOT_SUPPORTED = 3018
202
202
ERR_OSON_NODE_TYPE_NOT_SUPPORTED = 3019
203
203
ERR_OSON_FIELD_NAME_LIMITATION = 3020
204
+ ERR_OSON_VERSION_NOT_SUPPORTED = 3021
204
205
205
206
# error numbers that result in DatabaseError
206
207
ERR_TNS_ENTRY_NOT_FOUND = 4000
@@ -460,6 +461,8 @@ def _raise_from_string(exc_type: Exception, message: str) -> None:
460
461
'OSON field names may not exceed 255 UTF-8 encoded bytes' ,
461
462
ERR_OSON_NODE_TYPE_NOT_SUPPORTED :
462
463
'OSON node type 0x{node_type:x} is not supported' ,
464
+ ERR_OSON_VERSION_NOT_SUPPORTED :
465
+ 'OSON version {version} is not supported' ,
463
466
ERR_POOL_HAS_BUSY_CONNECTIONS :
464
467
'connection pool cannot be closed because connections are busy' ,
465
468
ERR_POOL_NO_CONNECTION_AVAILABLE :
Original file line number Diff line number Diff line change @@ -252,6 +252,9 @@ cdef class OsonDecoder(Buffer):
252
252
ptr[2 ] != TNS_JSON_MAGIC_BYTE_3:
253
253
errors._raise_err(errors.ERR_UNEXPECTED_DATA, data = ptr[:3 ])
254
254
self .read_ub1(& version)
255
+ if version != TNS_JSON_VERSION:
256
+ errors._raise_err(errors.ERR_OSON_VERSION_NOT_SUPPORTED,
257
+ version = version)
255
258
self .read_uint16(& self .flags)
256
259
257
260
# if value is a scalar value, the header is much smaller
You can’t perform that action at this time.
0 commit comments