]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- mysql table create options work on a generic passthru now, i.e. Table(..., mysql_en...
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Jan 2007 21:00:08 +0000 (21:00 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Jan 2007 21:00:08 +0000 (21:00 +0000)
mysql_collate="latin1_german2_ci", mysql_auto_increment="5", mysql_<somearg>...),
helps [ticket:418]

CHANGES
lib/sqlalchemy/databases/mysql.py
test/sql/query.py

diff --git a/CHANGES b/CHANGES
index d4be09ac063237f3b7a59657221aa29326e53fea..6e9f8c2c27e3d1ebbf9bceee85fa9bb914753585 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -43,6 +43,9 @@
 - mysql:
   - mysql is inconsistent with what kinds of quotes it uses in foreign keys during a
   SHOW CREATE TABLE, reflection updated to accomodate for all three styles [ticket:420]
+  - mysql table create options work on a generic passthru now, i.e. Table(..., mysql_engine='InnoDB',
+  mysql_collate="latin1_german2_ci", mysql_auto_increment="5", mysql_<somearg>...), 
+  helps [ticket:418]
 - firebird:
   - order of constraint creation puts primary key first before all other constraints;
   required for firebird, not a bad idea for others [ticket:408]
index 0edcbc7bd03764cdc8d61adf00a9eecb74c9de80..aee26a405d6cad6cd72c2fcc80f2f753a03cf13a 100644 (file)
@@ -477,11 +477,12 @@ class MySQLSchemaGenerator(ansisql.ANSISchemaGenerator):
         return colspec
 
     def post_create_table(self, table):
-        mysql_engine = table.kwargs.get('mysql_engine', None)
-        if mysql_engine is not None:
-            return " TYPE=%s" % mysql_engine
-        else:
-            return ""
+        args = ""
+        for k in table.kwargs:
+            if k.startswith('mysql_'):
+                opt = k[6:]
+                args += " %s=%s" % (opt.upper(), table.kwargs[k])
+        return args
 
 class MySQLSchemaDropper(ansisql.ANSISchemaDropper):
     def visit_index(self, index):
index ac62eb8e922a08a5ebe17ac0eaaf864e7d27a4b0..bffb37e6bbf1cb00eff33d5afe3d197369a919fe 100644 (file)
@@ -158,8 +158,11 @@ class QueryTest(PersistTest):
         self.assert_(r==[(3, 'ed'), (4, 'wendy'), (5, 'laura')])
         r = self.users.select(offset=5, order_by=[self.users.c.user_id]).execute().fetchall()
         self.assert_(r==[(6, 'ralph'), (7, 'fido')])
-      
+        
+    @testbase.unsupported('mysql')  
     def test_scalar_select(self):
+        """test that scalar subqueries with labels get their type propigated to the result set."""
+        # mysql and/or mysqldb has a bug here, type isnt propigated for scalar subquery.
         datetable = Table('datetable', metadata, 
             Column('id', Integer, primary_key=True),
             Column('today', DateTime))