Kaydet (Commit) a2fb5c9d authored tarafından Claude Paroz's avatar Claude Paroz

[1.7.x] Fixed #22744 -- Fixed sqlite3 get_relations introspection with views

Thanks Tim Graham for the report and Simon Charette for the review.
Backport of 5a504a53 from master.
üst d773a08b
......@@ -79,7 +79,11 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
# Schema for this table
cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s AND type = %s", [table_name, "table"])
results = cursor.fetchone()[0].strip()
try:
results = cursor.fetchone()[0].strip()
except TypeError:
# It might be a view, then no results will be returned
return relations
results = results[results.index('(') + 1:results.rindex(')')]
# Walk through and look for references to other tables. SQLite doesn't
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment