]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fixed 'port' attribute of URL to be an integer if present [ticket:209]
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 15 Jun 2006 20:30:04 +0000 (20:30 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 15 Jun 2006 20:30:04 +0000 (20:30 +0000)
CHANGES
lib/sqlalchemy/engine/url.py
test/testbase.py

diff --git a/CHANGES b/CHANGES
index 8c17e72dd9424e4b14a93ced6169cf7be87e19a2..020c5bf5075c4a1c0267f72242468837d76973f4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -18,6 +18,7 @@ auto-foreignkey detection [ticket:151]
 the MetaData object properly
 - fixed bug where Column with redefined "key" property wasnt getting
 type conversion happening in the ResultProxy [ticket:207]
+- fixed 'port' attribute of URL to be an integer if present
 
 0.2.2
 - big improvements to polymorphic inheritance behavior, enabling it
index fbaf6c964f37cad7f29676e17cd4f9f0be775877..65c9f166274848dd87d30a7022bf68044fc8e5e3 100644 (file)
@@ -8,7 +8,10 @@ class URL(object):
         self.username = username
         self.password = password
         self.host = host
-        self.port = port
+        if port is not None:
+            self.port = int(port)
+        else:
+            self.port = None
         self.database= database
         self.query = query or {}
     def __str__(self):
@@ -21,7 +24,7 @@ class URL(object):
         if self.host is not None:
             s += self.host
         if self.port is not None:
-            s += ':' + self.port
+            s += ':' + str(self.port)
         if self.database is not None:
             s += '/' + self.database
         if len(self.query):
index bec34487f946b6dc1753c265e8503496db76fe4c..0ec494bae47b499fe6afadce9ffc3528d36dbceb 100644 (file)
@@ -62,7 +62,7 @@ def parse_argv():
         elif DBTYPE == 'postgres':
             db_uri = 'postgres://scott:tiger@127.0.0.1:5432/test'
         elif DBTYPE == 'mysql':
-            db_uri = 'mysql://scott:tiger@127.0.0.1/test'
+            db_uri = 'mysql://scott:tiger@127.0.0.1:3306/test'
         elif DBTYPE == 'oracle':
             db_uri = 'oracle://scott:tiger@127.0.0.1:1521'
         elif DBTYPE == 'oracle8':