mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
(cherry picked from commit d0160c7c22)
Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
This commit is contained in:
parent
6f6171b33b
commit
33eee4340e
3 changed files with 35 additions and 7 deletions
|
|
@ -117,6 +117,26 @@ def __getitem__(self, index):
|
|||
got = list(self.cx.iterdump())
|
||||
self.assertEqual(expected, got)
|
||||
|
||||
def test_dump_virtual_tables(self):
|
||||
# gh-64662
|
||||
expected = [
|
||||
"BEGIN TRANSACTION;",
|
||||
"PRAGMA writable_schema=ON;",
|
||||
("INSERT INTO sqlite_master(type,name,tbl_name,rootpage,sql)"
|
||||
"VALUES('table','test','test',0,'CREATE VIRTUAL TABLE test USING fts4(example)');"),
|
||||
"CREATE TABLE 'test_content'(docid INTEGER PRIMARY KEY, 'c0example');",
|
||||
"CREATE TABLE 'test_docsize'(docid INTEGER PRIMARY KEY, size BLOB);",
|
||||
("CREATE TABLE 'test_segdir'(level INTEGER,idx INTEGER,start_block INTEGER,"
|
||||
"leaves_end_block INTEGER,end_block INTEGER,root BLOB,PRIMARY KEY(level, idx));"),
|
||||
"CREATE TABLE 'test_segments'(blockid INTEGER PRIMARY KEY, block BLOB);",
|
||||
"CREATE TABLE 'test_stat'(id INTEGER PRIMARY KEY, value BLOB);",
|
||||
"PRAGMA writable_schema=OFF;",
|
||||
"COMMIT;"
|
||||
]
|
||||
self.cu.execute("CREATE VIRTUAL TABLE test USING fts4(example)")
|
||||
actual = list(self.cx.iterdump())
|
||||
self.assertEqual(expected, actual)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue