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:
201201ERR_TDS_TYPE_NOT_SUPPORTED = 3018
202202ERR_OSON_NODE_TYPE_NOT_SUPPORTED = 3019
203203ERR_OSON_FIELD_NAME_LIMITATION = 3020
204+ ERR_OSON_VERSION_NOT_SUPPORTED = 3021
204205
205206# error numbers that result in DatabaseError
206207ERR_TNS_ENTRY_NOT_FOUND = 4000
@@ -460,6 +461,8 @@ def _raise_from_string(exc_type: Exception, message: str) -> None:
460461 'OSON field names may not exceed 255 UTF-8 encoded bytes' ,
461462 ERR_OSON_NODE_TYPE_NOT_SUPPORTED :
462463 'OSON node type 0x{node_type:x} is not supported' ,
464+ ERR_OSON_VERSION_NOT_SUPPORTED :
465+ 'OSON version {version} is not supported' ,
463466 ERR_POOL_HAS_BUSY_CONNECTIONS :
464467 'connection pool cannot be closed because connections are busy' ,
465468 ERR_POOL_NO_CONNECTION_AVAILABLE :
Original file line number Diff line number Diff line change @@ -252,6 +252,9 @@ cdef class OsonDecoder(Buffer):
252252 ptr[2 ] != TNS_JSON_MAGIC_BYTE_3:
253253 errors._raise_err(errors.ERR_UNEXPECTED_DATA, data = ptr[:3 ])
254254 self .read_ub1(& version)
255+ if version != TNS_JSON_VERSION:
256+ errors._raise_err(errors.ERR_OSON_VERSION_NOT_SUPPORTED,
257+ version = version)
255258 self .read_uint16(& self .flags)
256259
257260 # if value is a scalar value, the header is much smaller
You can’t perform that action at this time.
0 commit comments