diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-03-30 23:30:31 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-03-30 23:30:31 +0000 |
commit | 0f8896e6fa692c0a91eb0980700bee069eddc8ef (patch) | |
tree | fbee55c4b9682fc993c4b54a7f797a82d9fd6cf3 /lib/sqlalchemy/databases/mysql.py | |
parent | 5291acd5974632433cd89a6aa5828224673878ed (diff) | |
download | sqlalchemy-0f8896e6fa692c0a91eb0980700bee069eddc8ef.tar.gz |
- reverted previous "strings instead of tuples" change due to more specific test results showing tuples faster
- changed cache decorator call on default_schema_name call to a connection.info specific one
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index f09f08507..18b236d1c 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -157,6 +157,7 @@ import datetime, inspect, re, sys from array import array as _array from sqlalchemy import exceptions, logging, schema, sql, util +from sqlalchemy.pool import connection_cache_decorator from sqlalchemy.sql import operators as sql_operators from sqlalchemy.sql import functions as sql_functions from sqlalchemy.sql import compiler @@ -1542,13 +1543,9 @@ class MySQLDialect(default.DefaultDialect): return False def get_default_schema_name(self, connection): - try: - return connection.info['default_schema'] - except KeyError: - connection.info['default_schema'] = schema = \ - connection.execute('SELECT DATABASE()').scalar() - return schema - + return connection.execute('SELECT DATABASE()').scalar() + get_default_schema_name = connection_cache_decorator(get_default_schema_name) + def table_names(self, connection, schema): """Return a Unicode SHOW TABLES from a given schema.""" |