summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/mysql.py
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2008-03-30 22:37:48 +0000
committerJason Kirtland <jek@discorporate.us>2008-03-30 22:37:48 +0000
commit833696aa0a511f207c0be3b24b94245e13b09042 (patch)
tree1ca8d96a878d55a27324b113c87fc31f23175b74 /lib/sqlalchemy/databases/mysql.py
parentf11e9585b82de03d9ea42f7e19db7729f940dfe6 (diff)
downloadsqlalchemy-833696aa0a511f207c0be3b24b94245e13b09042.tar.gz
- Removed cache decorator.
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r--lib/sqlalchemy/databases/mysql.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py
index c820474c4..38d2a9516 100644
--- a/lib/sqlalchemy/databases/mysql.py
+++ b/lib/sqlalchemy/databases/mysql.py
@@ -1542,9 +1542,14 @@ 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 = util.cache_decorator(get_default_schema_name)
-
+
def table_names(self, connection, schema):
"""Return a Unicode SHOW TABLES from a given schema."""