Skip to content

Commit 4a43eec

Browse files
Allow for the case when only a parenthesis separates the RETURNING
clause, as noted in #104.
1 parent 2373270 commit 4a43eec

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/oracledb/impl/thin/statement.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ BIND_PATTERN = r'(?<!"\:)(?<=\:)\s*("[^\"]*"|[^\W\d_][\w\$#]*|\d+)'
4343
# pattern used for detecting a DML returning clause; bind variables in the
4444
# first group are input variables; bind variables in the second group are
4545
# 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+)(.*?$)'
4747

4848
cdef class BindInfo:
4949

tests/test_1600_dml_returning.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ def test_1607_insert_and_return_object(self):
212212
typename="UDT_OBJECT")
213213
self.cursor.execute("""
214214
insert into TestObjects (IntCol, ObjectCol)
215-
values (4, :obj)
216-
returning ObjectCol into :outObj""",
215+
values (4, :obj)returning ObjectCol into :outObj""",
217216
obj=obj, outObj=out_var)
218217
result, = out_var.getvalue()
219218
self.assertEqual(result.STRINGVALUE, string_value)

0 commit comments

Comments
 (0)