File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ oracledb 2.1.2 (TBD)
1313Thin Mode Changes
1414+++++++++++++++++
1515
16+ #) Fixed bug that prevented error ``ORA-01403: no data found `` from being
17+ raised when executing a PL/SQL block
18+ (`issue 321 <https://github.com/oracle/python-oracledb/issues/321 >`__).
19+
1620Thick Mode Changes
1721++++++++++++++++++
1822
Original file line number Diff line number Diff line change @@ -774,7 +774,7 @@ cdef class MessageWithData(Message):
774774 cursor_impl._batcherrors = self .error_info.batcherrors
775775 if self .batcherrors and cursor_impl._batcherrors is None :
776776 cursor_impl._batcherrors = []
777- if self .error_info.num == TNS_ERR_NO_DATA_FOUND:
777+ if self .error_info.num == TNS_ERR_NO_DATA_FOUND and self .in_fetch :
778778 self .error_info.num = 0
779779 cursor_impl._more_rows_to_fetch = False
780780 cursor_impl._last_row_index = 0
Original file line number Diff line number Diff line change @@ -554,6 +554,11 @@ def test_3934(self):
554554 self .cursor .execute ("begin null; end;" )
555555 self .assertEqual (self .cursor .rowcount , 0 )
556556
557+ def test_3935 (self ):
558+ "3935 - test raising no_data_found in PL/SQL"
559+ with self .assertRaisesFullCode ("ORA-01403" ):
560+ self .cursor .execute ("begin raise no_data_found; end;" )
561+
557562
558563if __name__ == "__main__" :
559564 test_env .run_test_cases ()
Original file line number Diff line number Diff line change @@ -591,6 +591,11 @@ async def test_5435(self):
591591 row = await self .cursor .fetchone ()
592592 self .assertEqual (row , tuple (values ))
593593
594+ async def test_5436 (self ):
595+ "5436 - test raising no_data_found in PL/SQL"
596+ with self .assertRaisesFullCode ("ORA-01403" ):
597+ await self .cursor .execute ("begin raise no_data_found; end;" )
598+
594599
595600if __name__ == "__main__" :
596601 test_env .run_test_cases ()
You can’t perform that action at this time.
0 commit comments