]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Finish table_names.
authorJason Kirtland <jek@discorporate.us>
Sun, 29 Jul 2007 05:49:55 +0000 (05:49 +0000)
committerJason Kirtland <jek@discorporate.us>
Sun, 29 Jul 2007 05:49:55 +0000 (05:49 +0000)
lib/sqlalchemy/databases/mysql.py

index 85984663668c02dd6b5360482666d632b52a3099..53ef1a95b2313d4c76de444674c4f8683b39e230 100644 (file)
@@ -1092,8 +1092,10 @@ class MySQLDialect(ansisql.ANSIDialect):
             return name
 
     def table_names(self, connection, schema):
-        s = "SHOW TABLES"
-        return [row[0] for row in connection.execute(s)]
+        charset = self._detect_charset(connection)
+        rp = connection.execute("SHOW TABLES FROM %s" %
+                                 self.preparer().quote_identifier(schema))
+        return [row[0] for row in _compat_fetchall(rp, charset=charset)]
 
     def has_table(self, connection, table_name, schema=None):
         # SHOW TABLE STATUS LIKE and SHOW TABLES LIKE do not function properly