1. Andrew Godwin
  2. south

Commits

Matthew Tretter  committed b0f8d84

Fix "deprecated @@storage_engine" warning (#1227)

This patch uses SHOW VARIABLES to determine whether the new version of
the variable ("default_storage_engine") should be used.

  • Participants
  • Parent commits 6612130
  • Branches fix-deprecated-storage-engine

Comments (0)

Files changed (1)

File south/db/mysql.py

View file
  • Ignore whitespace
         e.g. which storage engine (MySQL) or transaction serialisability level.
         """
         cursor = self._get_connection().cursor()
+        if cursor.execute("SHOW variables WHERE Variable_Name='default_storage_engine';"):
+            engine_var = 'default_storage_engine'
+        else:
+            engine_var = 'storage_engine'
         if self._has_setting('STORAGE_ENGINE') and self._get_setting('STORAGE_ENGINE'):
-            cursor.execute("SET storage_engine=%s;" % self._get_setting('STORAGE_ENGINE'))
+            cursor.execute("SET %s=%s;" % (engine_var, self._get_setting('STORAGE_ENGINE')))
 
     def start_transaction(self):
         super(DatabaseOperations, self).start_transaction()