The `_munge_arg` method of `Procedure` was broken because:
  * it referenced the old `self.proc` variable which is long gone.
  * it always converted all the arguments to the 1st sqltype (which
    happened to be `sql_types.NUMERIC`).

This commit fixes the `test_new_org_1` test inside of
`test_misc_functions.py`, plus it causes the other tests to fail in a
different way (that's needed to uncover their real issues and fix them).
---
 backend/server/rhnSQL/driver_cx_Oracle.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/backend/server/rhnSQL/driver_cx_Oracle.py 
b/backend/server/rhnSQL/driver_cx_Oracle.py
index dc56edd..80ef513 100644
--- a/backend/server/rhnSQL/driver_cx_Oracle.py
+++ b/backend/server/rhnSQL/driver_cx_Oracle.py
@@ -316,9 +316,10 @@ class Procedure(sql_base.Procedure):
 
     def _munge_arg(self, val):
         for sqltype, db_specific_type in self._type_mapping:
-            var = self.proc.var(db_specific_type, val.size)
-            var.setvalue(0, val.get_value())
-            return var
+            if isinstance(val, sqltype):
+              var = self.cursor.var(db_specific_type, val.size)
+              var.setvalue(0, val.get_value())
+              return var
 
         # XXX
         return val.get_value()
-- 
1.8.4

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to