Skip to content

Commit fa4faa2

Browse files
Update ODPI-C which has added an optimization to reduce buffer size when both
the client and server character sets are identical and corrected support for BFILE LOBs.
1 parent 1c3c33a commit fa4faa2

File tree

6 files changed

+33
-13
lines changed

6 files changed

+33
-13
lines changed

odpi

Submodule odpi updated 103 files

test/CursorVar.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def testBindCursor(self):
2323
end;""",
2424
cursor = cursor)
2525
self.assertEqual(cursor.description,
26-
[ ('STRINGVALUE', cx_Oracle.FIXED_CHAR, 1, 4, None, None, 1) ])
26+
[ ('STRINGVALUE', cx_Oracle.FIXED_CHAR, 1, CS_RATIO, None,
27+
None, 1) ])
2728
self.assertEqual(cursor.fetchall(), [('X',)])
2829

2930
def testBindCursorInPackage(self):
@@ -33,7 +34,8 @@ def testBindCursorInPackage(self):
3334
self.cursor.callproc("pkg_TestOutCursors.TestOutCursor", (2, cursor))
3435
self.assertEqual(cursor.description,
3536
[ ('INTCOL', cx_Oracle.NUMBER, 10, None, 9, 0, 0),
36-
('STRINGCOL', cx_Oracle.STRING, 20, 80, None, None, 0) ])
37+
('STRINGCOL', cx_Oracle.STRING, 20, 20 * CS_RATIO, None,
38+
None, 0) ])
3739
self.assertEqual(cursor.fetchall(),
3840
[ (1, 'String 1'), (2, 'String 2') ])
3941

test/StringVar.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,13 @@ def testCursorDescription(self):
279279
self.cursor.execute("select * from TestStrings")
280280
self.assertEqual(self.cursor.description,
281281
[ ('INTCOL', cx_Oracle.NUMBER, 10, None, 9, 0, 0),
282-
('STRINGCOL', cx_Oracle.STRING, 20, 80, None, None, 0),
282+
('STRINGCOL', cx_Oracle.STRING, 20, 20 * CS_RATIO, None,
283+
None, 0),
283284
('RAWCOL', cx_Oracle.BINARY, 30, 30, None, None, 0),
284-
('FIXEDCHARCOL', cx_Oracle.FIXED_CHAR, 40, 160, None, None,
285-
0),
286-
('NULLABLECOL', cx_Oracle.STRING, 50, 200, None, None, 1) ])
285+
('FIXEDCHARCOL', cx_Oracle.FIXED_CHAR, 40, 40 * CS_RATIO,
286+
None, None, 0),
287+
('NULLABLECOL', cx_Oracle.STRING, 50, 50 * CS_RATIO, None,
288+
None, 1) ])
287289

288290
def testFetchAll(self):
289291
"test that fetching all of the data returns the correct results"

test/test.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ def tearDown(self):
8282
del self.connection
8383

8484

85+
# determine character set ratio in use in order to determine the buffer size
86+
# that will be reported in cursor.description; this depends on the database
87+
# character set and the client character set
88+
connection = cx_Oracle.connect(TestEnv.USERNAME, TestEnv.PASSWORD,
89+
TestEnv.TNSENTRY, encoding = TestEnv.ENCODING,
90+
nencoding = TestEnv.NENCODING)
91+
cursor = connection.cursor()
92+
cursor.execute("select 'X' from dual")
93+
col, = cursor.description
94+
csratio = col[3]
95+
8596
loader = unittest.TestLoader()
8697
runner = unittest.TextTestRunner(verbosity = 2)
8798
failures = []
@@ -98,6 +109,7 @@ def tearDown(self):
98109
setattr(module, "ENCODING", TestEnv.ENCODING)
99110
setattr(module, "NENCODING", TestEnv.NENCODING)
100111
setattr(module, "ARRAY_SIZE", TestEnv.ARRAY_SIZE)
112+
setattr(module, "CS_RATIO", csratio)
101113
setattr(module, "TestCase", unittest.TestCase)
102114
setattr(module, "BaseTestCase", BaseTestCase)
103115
setattr(module, "cx_Oracle", cx_Oracle)

test/uCursorVar.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def testBindCursor(self):
2323
end;""",
2424
cursor = cursor)
2525
self.assertEqual(cursor.description,
26-
[ ('STRINGVALUE', cx_Oracle.FIXED_CHAR, 1, 4, None, None, 1) ])
26+
[ ('STRINGVALUE', cx_Oracle.FIXED_CHAR, 1, CS_RATIO, None,
27+
None, 1) ])
2728
self.assertEqual(cursor.fetchall(), [('X',)])
2829

2930
def testBindCursorInPackage(self):
@@ -33,7 +34,8 @@ def testBindCursorInPackage(self):
3334
self.cursor.callproc(u"pkg_TestOutCursors.TestOutCursor", (2, cursor))
3435
self.assertEqual(cursor.description,
3536
[ ('INTCOL', cx_Oracle.NUMBER, 10, None, 9, 0, 0),
36-
('STRINGCOL', cx_Oracle.STRING, 20, 80, None, None, 0) ])
37+
('STRINGCOL', cx_Oracle.STRING, 20, 20 * CS_RATIO, None,
38+
None, 0) ])
3739
self.assertEqual(cursor.fetchall(),
3840
[ (1, 'String 1'), (2, 'String 2') ])
3941

test/uStringVar.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,13 @@ def testCursorDescription(self):
228228
self.cursor.execute(u"select * from TestStrings")
229229
self.assertEqual(self.cursor.description,
230230
[ (u'INTCOL', cx_Oracle.NUMBER, 10, None, 9, 0, 0),
231-
(u'STRINGCOL', cx_Oracle.STRING, 20, 80, None, None, 0),
231+
(u'STRINGCOL', cx_Oracle.STRING, 20, 20 * CS_RATIO, None,
232+
None, 0),
232233
(u'RAWCOL', cx_Oracle.BINARY, 30, 30, None, None, 0),
233-
(u'FIXEDCHARCOL', cx_Oracle.FIXED_CHAR, 40, 160, None, None,
234-
0),
235-
(u'NULLABLECOL', cx_Oracle.STRING, 50, 200, None, None, 1) ])
234+
(u'FIXEDCHARCOL', cx_Oracle.FIXED_CHAR, 40, 40 * CS_RATIO,
235+
None, None, 0),
236+
(u'NULLABLECOL', cx_Oracle.STRING, 50, 50 * CS_RATIO, None,
237+
None, 1) ])
236238

237239
def testFetchAll(self):
238240
"test that fetching all of the data returns the correct results"

0 commit comments

Comments
 (0)