File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ Thin Mode Changes
46
46
potentially exceed the 32767 byte limit but the actual value bound does not
47
47
(`issue 146 <https://github.com/oracle/python-oracledb/issues/146 >`__).
48
48
#) Fixed bug connecting to an IPv6 address with IAM tokens.
49
+ #) Fixed bug determining RETURNING binds in a SQL statement when RETURNING and
50
+ INTO keywords are not separated by whitespace, but are separated by
51
+ parentheses.
49
52
#) Internal implementation changes:
50
53
51
54
- Added internal support for prefetching the LOB size and chunk size,
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ BIND_PATTERN = r'(?<!"\:)(?<=\:)\s*("[^\"]*"|[^\W\d_][\w\$#]*|\d+)'
43
43
# pattern used for detecting a DML returning clause; bind variables in the
44
44
# first group are input variables; bind variables in the second group are
45
45
# output only variables
46
- DML_RETURNING_PATTERN = r ' (?si) ( [) \s ]RETURNING\s + [\s\S ]+ \s + INTO\s + ) ( . *? $ ) '
46
+ DML_RETURNING_PATTERN = r ' (?si) ( [) \s ]RETURNING[ ( \s ] [\s\S ]+ [ ) \s ] INTO\s + ) ( . *? $ ) '
47
47
48
48
cdef class BindInfo:
49
49
Original file line number Diff line number Diff line change @@ -424,5 +424,14 @@ def test_1621_plsql_returning_rowids_with_index_organized_table(self):
424
424
row , = self .cursor .fetchall ()
425
425
self .assertEqual (data [:3 ], row )
426
426
427
+ def test_1622_parse_returning_clause_without_spaces (self ):
428
+ "1622 - parse DML returning with no spaces"
429
+ self .cursor .execute ("truncate table TestTempTable" )
430
+ sql = 'insert into TestTempTable (IntCol) values (:in_val)' + \
431
+ 'returning(IntCol)into :out_val'
432
+ out_val = self .cursor .var (int , arraysize = 5 )
433
+ self .cursor .execute (sql , in_val = 25 , out_val = out_val )
434
+ self .assertEqual (out_val .getvalue (), [25 ])
435
+
427
436
if __name__ == "__main__" :
428
437
test_env .run_test_cases ()
You can’t perform that action at this time.
0 commit comments