Update of /cvsroot/monetdb/clients/src/python/Cimpl
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14987/src/python/Cimpl

Modified Files:
        CMapi.py 
Log Message:
propagated changes of Wednesday Oct 17 2007 - Monday Oct 22 2007
from the Clients_1-20 branch to the development trunk


Index: CMapi.py
===================================================================
RCS file: /cvsroot/monetdb/clients/src/python/Cimpl/CMapi.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CMapi.py    11 Sep 2007 11:11:40 -0000      1.4
+++ CMapi.py    22 Oct 2007 10:35:51 -0000      1.5
@@ -125,7 +125,7 @@
             raise RuntimeError(self.error_str())
         hdl = MapiQuery(hdl, self)
         if self.error():
-            raise RuntimeError(self.error_str())
+            raise RuntimeError(hdl.result_error())
         return hdl
 
     def query_array(self, cmd, argv):
@@ -241,9 +241,12 @@
         return ret
 
 class Embedded(Mapi):
-    def __init__(self, dbfarm = None, dbname = "demo", lang = "sql"):
+    def __init__(self, dbfarm = None, dbname = "demo", lang = "sql", version = 
5):
         try:
-            import monetdb
+           if version == 5:
+               import monetdb5 as monetdb
+           else:
+               import monetdb
             if lang == "sql":
                 self._Mapi__mid = monetdb.monetdb_sql(dbfarm, dbname)
         except:
@@ -285,7 +288,7 @@
             raise RuntimeError(self.__mid.error_str())
         if ret == MapiLib.MTIMEOUT:
             raise IOError(self.__mid.error_str())
-    explain = explain_query
+        explain = explain_query
 
     def explain_result(self, f):
         ret = MapiLib.mapi_explain_result(self.__hdl, f)
@@ -296,6 +299,8 @@
 
     def result_error(self):
         ret = MapiLib.mapi_result_error(self.__hdl)
+        if ret:
+            return ret
         if self.__mid.error():
             raise IOError(self.__mid.error_str())
         return ret


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to