1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #13396 -- Modified the SQLite introspection code to avoid a problem with unconsumed cursors on PyPy. Thanks to Alex Gaynor for the report and fix.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13016 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-04-21 23:43:35 +00:00
parent b5dc7945bd
commit 5866875547
2 changed files with 5 additions and 8 deletions

View File

@@ -66,7 +66,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
relations = {}
# Schema for this table
cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s", [table_name])
cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s AND type = %s", [table_name, "table"])
results = cursor.fetchone()[0].strip()
results = results[results.index('(')+1:results.rindex(')')]