Skip to content

Commit 2e240bc

Browse files
Prevent attempts from binding the cursor being executed to itself.
1 parent ef1fc44 commit 2e240bc

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

odpi

Submodule odpi updated 1 file

test/CursorVar.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ def testBindCursorInPackage(self):
3737
self.assertEqual(cursor.fetchall(),
3838
[ (1, 'String 1'), (2, 'String 2') ])
3939

40+
def testBindSelf(self):
41+
"test that binding the cursor itself is not supported"
42+
cursor = self.connection.cursor()
43+
sql = """
44+
begin
45+
open :pcursor for
46+
select 1 from dual;
47+
end;"""
48+
self.assertRaises(cx_Oracle.DatabaseError, cursor.execute, sql,
49+
pcursor = cursor)
50+
4051
def testFetchCursor(self):
4152
"test fetching a cursor"
4253
self.cursor.execute("""

0 commit comments

Comments
 (0)