File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ Thin Mode Changes
2525 ``wait_timeout `` value and the connection request will not additionally be
2626 delayed by any internal network ping to the database (`issue 330
2727 <https://github.com/oracle/python-oracledb/issues/330> `__).
28+ #) Fixed bug in fetching dates with years less than 0
29+ (`issue 345 <https://github.com/oracle/python-oracledb/issues/345 >`__).
30+
2831
2932Thick Mode Changes
3033++++++++++++++++++
Original file line number Diff line number Diff line change @@ -341,7 +341,7 @@ cdef class Buffer:
341341 int8_t tz_hour = 0 , tz_minute = 0
342342 uint32_t fsecond = 0
343343 int32_t seconds
344- uint16_t year
344+ int16_t year
345345 year = (ptr[0 ] - 100 ) * 100 + ptr[1 ] - 100
346346 if num_bytes >= 11 :
347347 fsecond = unpack_uint32(& ptr[7 ], BYTE_ORDER_MSB) // 1000
Original file line number Diff line number Diff line change @@ -297,6 +297,14 @@ def test_1417(self):
297297 self .assertEqual (self .cursor .fetchone (), self .data_by_key [4 ])
298298 self .assertIsNone (self .cursor .fetchone ())
299299
300+ def test_1418 (self ):
301+ "1418 - test fetching a date with year < 0"
302+ with self .assertRaises (ValueError ):
303+ self .cursor .execute (
304+ "select to_date('-4712-01-01', 'SYYYY-MM-DD') from dual"
305+ )
306+ self .cursor .fetchone ()
307+
300308
301309if __name__ == "__main__" :
302310 test_env .run_test_cases ()
You can’t perform that action at this time.
0 commit comments