Closed npodewitz closed 1 year ago
Thanks for the report and the diagnosis. This should be enough for me to correct the issue, but if I have further questions I'll ask!
Problem resolved. Thanks again for the report.
The fix for this bug has been included in python-oracledb 1.2.1 which was just released.
oracledb.version: 1.1.1
For the example to work one needs an oracle db and has to replace
<USER>
,<PASSWORD>
and<DSN>
.The error seems to lie in oracledb/impl/thin/statement.pyx, where the regular expression should remove all comments. Since this expressions is greedy the afore mentioned code line removes everything from the start of the first comment to the end of the last comment. If the bind variable is only referenced between two comment blocks it is thus removed from the sql before the search for bind variables.
This can be fixed by making the pattern between start and stop of the comment to be non greedy, i.e.:
I would be happy to provide a pull request for this issue as a reference, however, I won't be able to sign the OCA.