Changeset: c97916f7564d for python-monetdb
URL: http://dev.monetdb.org/hg/python-monetdb?cmd=changeset;node=c97916f7564d
Modified Files:
        pymonetdb/mapi.py
Branch: default
Log Message:

Fix calling the Connection.connect method.

This is a port of changeset 6674c4ec995f of the MonetDB code.


diffs (25 lines):

diff --git a/pymonetdb/mapi.py b/pymonetdb/mapi.py
--- a/pymonetdb/mapi.py
+++ b/pymonetdb/mapi.py
@@ -45,7 +45,8 @@ STATE_READY = 1
 
 # MonetDB error codes
 errors = {
-    '42S02!': OperationalError,  # no such table
+    '0A000!': NotSupportedError,
+    '42S02!': ProgrammingError,  # no such table
     'M0M29!': IntegrityError,    # INSERT INTO: UNIQUE constraint violated
     '2D000!': IntegrityError,    # COMMIT: failed
     '40000!': IntegrityError,    # DROP TABLE: FOREIGN KEY constraint violated
@@ -183,8 +184,9 @@ class Connection(object):
                 logger.info("redirect to monetdb://%s:%s/%s" %
                             (self.hostname, self.port, self.database))
                 self.socket.close()
-                self.connect(self.hostname, self.port, self.username,
-                             self.password, self.database, self.language)
+                self.connect(hostname=self.hostname, port=self.port,
+                             username=self.username, password=self.password,
+                             database=self.database, language=self.language)
 
             else:
                 raise ProgrammingError("unknown redirect: %s" % prompt)
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to