Prevent attempts from binding the cursor being executed to itself.

This commit is contained in:
Anthony Tuininga 2017-05-16 13:23:20 -06:00
parent ef1fc44f32
commit 2e240bc154
2 changed files with 12 additions and 1 deletions

2
odpi

@ -1 +1 @@
Subproject commit 5e102e0ff1f5d8be9581fb82d29f61e013069918
Subproject commit 07b43d059ab2502ebc5c98c26ddecfe63cb0861d

View File

@ -37,6 +37,17 @@ class TestCursorVar(BaseTestCase):
self.assertEqual(cursor.fetchall(),
[ (1, 'String 1'), (2, 'String 2') ])
def testBindSelf(self):
"test that binding the cursor itself is not supported"
cursor = self.connection.cursor()
sql = """
begin
open :pcursor for
select 1 from dual;
end;"""
self.assertRaises(cx_Oracle.DatabaseError, cursor.execute, sql,
pcursor = cursor)
def testFetchCursor(self):
"test fetching a cursor"
self.cursor.execute("""