Don't incorrectly detect VIEWs as supporting FTS

This commit is contained in:
Simon Willison 2017-11-24 14:51:00 -08:00
commit c5c923d93c
No known key found for this signature in database
GPG key ID: FBB38AFE227189DB
2 changed files with 6 additions and 1 deletions

View file

@ -143,9 +143,11 @@ def test_detect_fts():
"PlantType" TEXT,
"qCaretaker" TEXT
);
CREATE VIEW Test_View AS SELECT * FROM Dumb_Table;
CREATE VIRTUAL TABLE "Street_Tree_List_fts" USING FTS4 ("qAddress", "qCaretaker", "qSpecies", content="Street_Tree_List");
'''
conn = sqlite3.connect(':memory:')
conn.executescript(sql)
assert None is utils.detect_fts(conn, 'Dumb_Table')
assert None is utils.detect_fts(conn, 'Test_View')
assert 'Street_Tree_List_fts' == utils.detect_fts(conn, 'Street_Tree_List')