backend/server/rhnSQL/driver_cx_Oracle.py | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit 179e8d6c75d79a5c81b1a1d558f8d258dfc6fafc
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 2 10:28:25 2011 +0100
Prevent all nulls in a chunk (which are treated as strings) from affecting the
subsequent chunks.
We clear self->bindVariables so that list of all nulls
in the previous chunk which caused the type to be set to
string does not affect our chunk which may have number
there.
Addressing
File
"/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/driver_cx_Oracle.py",
line 98, in _execute_wrapper
retval = apply(function, p, kw)
File
"/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/driver_cx_Oracle.py",
line 189, in _executemany
self._real_cursor.executemany(None, arr)
TypeError: expecting string or buffer data
diff --git a/backend/server/rhnSQL/driver_cx_Oracle.py
b/backend/server/rhnSQL/driver_cx_Oracle.py
index 6fc77d0..7dbdbe4 100644
--- a/backend/server/rhnSQL/driver_cx_Oracle.py
+++ b/backend/server/rhnSQL/driver_cx_Oracle.py
@@ -183,6 +183,12 @@ class Cursor(sql_base.Cursor):
for k, v in kwargs.iteritems():
pdict[k] = adjust_type(v[start+i])
+ # We clear self->bindVariables so that list of all nulls
+ # in the previous chunk which caused the type to be set to
+ # string does not affect our chunk which may have number
+ # there.
+ self._real_cursor.setinputsizes(**{})
+
# arr is now a list of dictionaries. Each dictionary contains the
# data for one execution of the query where the key is the column
# name and the value self explanatory.
Show replies by date