summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/introspection.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-09-23 14:13:59 -0400
committerTim Graham <timograham@gmail.com>2014-09-25 13:53:44 -0400
commit74e7f91e6de11bc41ecba5d0b2e1b78d03865d32 (patch)
tree0257a2f988de966ba95fe86f4946f31698bfb94f /django/db/backends/mysql/introspection.py
parent215aa4f53b6bbd07d5c1eecfa94e7fcd00da813e (diff)
downloaddjango-74e7f91e6de11bc41ecba5d0b2e1b78d03865d32.tar.gz
Fixed #23538 -- Added SchemaEditor for MySQL GIS.
Thanks Claude Paroz for suggestions and review.
Diffstat (limited to 'django/db/backends/mysql/introspection.py')
-rw-r--r--django/db/backends/mysql/introspection.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/django/db/backends/mysql/introspection.py b/django/db/backends/mysql/introspection.py
index 8b7ff3c1e5..47bb92859a 100644
--- a/django/db/backends/mysql/introspection.py
+++ b/django/db/backends/mysql/introspection.py
@@ -127,6 +127,16 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
indexes[row[4]]['unique'] = True
return indexes
+ def get_storage_engine(self, cursor, table_name):
+ """
+ Retrieves the storage engine for a given table.
+ """
+ cursor.execute(
+ "SELECT engine "
+ "FROM information_schema.tables "
+ "WHERE table_name = %s", [table_name])
+ return cursor.fetchone()[0]
+
def get_constraints(self, cursor, table_name):
"""
Retrieves any constraints or keys (unique, pk, fk, check, index) across one or more columns.