1
0
mirror of https://github.com/django/django.git synced 2025-10-25 06:36:07 +00:00

Fixed #7572 -- Force the closure of the database connection at the end of fixture loading as a workaround for MySQL bug #37735. Thanks to Simon Litchfield for his help in narrowing down this issue.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2008-06-30 12:18:29 +00:00
parent 52b6857f93
commit 9eaa05912c
3 changed files with 116 additions and 0 deletions

View File

@@ -162,3 +162,9 @@ class Command(BaseCommand):
else:
if verbosity > 0:
print "Installed %d object(s) from %d fixture(s)" % (object_count, fixture_count)
# Close the DB connection. This is required as a workaround for an
# edge case in MySQL: if the same connection is used to
# create tables, load data, and query, the query can return
# incorrect results. See Django #7572, MySQL #37735.
connection.close()