Commits

Mike Bayer committed 96fabbd

- 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]

Comments (0)

Files changed (3)

 - 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]

lib/sqlalchemy/databases/mysql.py

         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):

test/sql/query.py

         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))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.