Django South does not compatible with MariaDB latest version?
If you working with DJango South and the latest MariaDB just like coming from Fedora 21 or any of the new Linux distribution which is released at 2014, you might meet this and you might comes here from search on Internet just like me.
The solution for this issue is here,
Create
mysql.table_stats,
mysql.column_stats,
mysql.index_stats
according to this page,
https://mariadb.com/kb/en/mariadb/documentation/optimization-and-tuning/engine-independent-table-statistics/#manual-updates-to-statistics-tables
It is discussed here.
http://simionbaws.ro/stories/south-migrations-and-mariadb/
The bug is described by South here,
http://south.aeracode.org/ticket/1309
But it seems it is not a bug of South and it actually is the issue of MariaDB.
The error message is like following,
Running migrations for contactus:
- Migrating forwards to 0001_initial.
> contactus:0001_initial
Traceback (most recent call last):
File "/home/allen/Projects/raychem/venv/bin/django-admin.py", line 5, in
management.execute_from_command_line()
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/migrators.py", line 256, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/migrators.py", line 331, in migrate_many
result = self.migrate(migration, database)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/migrators.py", line 133, in migrate
result = self.run(migration, database)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/migrators.py", line 111, in run
if not south.db.db.has_ddl_transactions:
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/utils/functional.py", line 49, in __get__
res = instance.__dict__[self.func.__name__] = self.func(instance)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/db/generic.py", line 124, in has_ddl_transactions
if getattr(connection.features, 'supports_transactions', True):
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/utils/functional.py", line 49, in __get__
res = instance.__dict__[self.func.__name__] = self.func(instance)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 664, in supports_transactions
self.connection.leave_transaction_management()
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 315, in leave_transaction_management
"Transaction managed block ended with pending COMMIT/ROLLBACK")
django.db.transaction.TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK
The solution for this issue is here,
Create
mysql.table_stats,
mysql.column_stats,
mysql.index_stats
according to this page,
https://mariadb.com/kb/en/mariadb/documentation/optimization-and-tuning/engine-independent-table-statistics/#manual-updates-to-statistics-tables
It is discussed here.
http://simionbaws.ro/stories/south-migrations-and-mariadb/
The bug is described by South here,
http://south.aeracode.org/ticket/1309
But it seems it is not a bug of South and it actually is the issue of MariaDB.
The error message is like following,
Running migrations for contactus:
- Migrating forwards to 0001_initial.
> contactus:0001_initial
Traceback (most recent call last):
File "/home/allen/Projects/raychem/venv/bin/django-admin.py", line 5, in
management.execute_from_command_line()
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/migrators.py", line 256, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/migrators.py", line 331, in migrate_many
result = self.migrate(migration, database)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/migrators.py", line 133, in migrate
result = self.run(migration, database)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/migration/migrators.py", line 111, in run
if not south.db.db.has_ddl_transactions:
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/utils/functional.py", line 49, in __get__
res = instance.__dict__[self.func.__name__] = self.func(instance)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/south/db/generic.py", line 124, in has_ddl_transactions
if getattr(connection.features, 'supports_transactions', True):
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/utils/functional.py", line 49, in __get__
res = instance.__dict__[self.func.__name__] = self.func(instance)
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 664, in supports_transactions
self.connection.leave_transaction_management()
File "/home/allen/Projects/raychem/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 315, in leave_transaction_management
"Transaction managed block ended with pending COMMIT/ROLLBACK")
django.db.transaction.TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK
Comments