diff --git a/django/db/backends/sqlite3/introspection.py b/django/db/backends/sqlite3/introspection.py
index ce64908..c243e58 100644
a
|
b
|
class DatabaseIntrospection(BaseDatabaseIntrospection):
|
66 | 66 | relations = {} |
67 | 67 | |
68 | 68 | # Schema for this table |
69 | | cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s", [table_name]) |
| 69 | cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s AND type = %s", [table_name, "table"]) |
70 | 70 | results = cursor.fetchone()[0].strip() |
71 | 71 | results = results[results.index('(')+1:results.rindex(')')] |
72 | 72 | |
diff --git a/tests/regressiontests/introspection/tests.py b/tests/regressiontests/introspection/tests.py
index 1025029..2a81aa8 100644
a
|
b
|
from django.utils import functional
|
5 | 5 | |
6 | 6 | from models import Reporter, Article |
7 | 7 | |
8 | | try: |
9 | | set |
10 | | except NameError: |
11 | | from sets import Set as set # Python 2.3 fallback |
12 | | |
13 | 8 | # |
14 | 9 | # The introspection module is optional, so methods tested here might raise |
15 | 10 | # NotImplementedError. This is perfectly acceptable behavior for the backend |
… |
… |
class IntrospectionTests(TestCase):
|
76 | 71 | def test_get_table_description_types(self): |
77 | 72 | cursor = connection.cursor() |
78 | 73 | desc = connection.introspection.get_table_description(cursor, Reporter._meta.db_table) |
79 | | self.assertEqual([datatype(r[1], r) for r in desc], |
80 | | ['IntegerField', 'CharField', 'CharField', 'CharField', 'BigIntegerField']) |
| 74 | self.assertEqual( |
| 75 | [datatype(r[1], r) for r in desc], |
| 76 | ['IntegerField', 'CharField', 'CharField', 'CharField', 'BigIntegerField'] |
| 77 | ) |
81 | 78 | |
82 | 79 | # Regression test for #9991 - 'real' types in postgres |
83 | 80 | if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].startswith('django.db.backends.postgresql'): |