]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fixed mysql reflection of default values to be PassiveDefault
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 4 Aug 2006 06:47:53 +0000 (06:47 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 4 Aug 2006 06:47:53 +0000 (06:47 +0000)
CHANGES
lib/sqlalchemy/databases/mysql.py

diff --git a/CHANGES b/CHANGES
index da97fff3537e401f517a92a98e2876ebaafd95b4..8d49e4d8441546b1ae0b1e8e6c995c436deb0b1e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -17,6 +17,7 @@ reflection.
 - adjustments to pool stemming from changes made for [ticket:224]. 
 overflow counter should only be decremented if the connection actually
 succeeded.  added a test script to attempt testing this.
+- fixed mysql reflection of default values to be PassiveDefault
 
 0.2.6
 - big overhaul to schema to allow truly composite primary and foreign
index c9ebd7ba630e346a3c247c3b3148a633396e1c13..c98593a55d5da778e6c5268f62a662ac395fcfbc 100644 (file)
@@ -347,11 +347,13 @@ class MySQLDialect(ansisql.ANSIDialect):
                 else:
                     argslist = re.findall(r'(\d+)', args)
                     coltype = coltype(*[int(a) for a in argslist], **kw)
-            
-            table.append_item(schema.Column(name, coltype, 
+
+            colargs= []
+            if default:
+                colargs.append(schema.PassiveDefault(sql.text(default)))
+            table.append_item(schema.Column(name, coltype, *colargs, 
                                             **dict(primary_key=primary_key,
                                                    nullable=nullable,
-                                                   default=default
                                                    )))
 
         tabletype = self.moretableinfo(connection, table=table)