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:
@@ -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(')')]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user