# # patch "ChangeLog" # from [dd5fc6917d93552b2ee40af4cfdb366cb813e958] # to [94f02ae7cf8d0337686bfa25a4c3341037e3eecc] # # patch "database.cc" # from [6803830b8a42ac4e01669027990ebc51cffcef7a] # to [96439bc31afa0051b9abdbfca91e95ff474b3cbb] # # patch "tests/t_dump_load.at" # from [f9a9a6bde352a41cecbd8a66dacd1c07299b82eb] # to [168c3798cf11afd072b480f26a3bd23c1d9fc597] # ======================================================================== --- ChangeLog dd5fc6917d93552b2ee40af4cfdb366cb813e958 +++ ChangeLog 94f02ae7cf8d0337686bfa25a4c3341037e3eecc @@ -1,3 +1,11 @@ +2005-11-22 Matthew Gregan + + * database.cc (database::dump): Don't include SQLite internal + tables in the dump. + * tests/t_dump_load.at (database dump/load): Run a db analyze + before dumping the db--catches cases where we dump internal db + tables that we can't reload. + 2005-11-21 Matthew Gregan * NEWS: Minor spelling tweaks. ======================================================================== --- database.cc 6803830b8a42ac4e01669027990ebc51cffcef7a +++ database.cc 96439bc31afa0051b9abdbfca91e95ff474b3cbb @@ -333,6 +333,7 @@ res = sqlite3_exec(req.sql, "SELECT name, type, sql FROM sqlite_master " "WHERE type='table' AND sql NOT NULL " + "AND name not like 'sqlite_stat%' " "ORDER BY name", dump_table_cb, &req, NULL); assert_sqlite3_ok(req.sql); ======================================================================== --- tests/t_dump_load.at f9a9a6bde352a41cecbd8a66dacd1c07299b82eb +++ tests/t_dump_load.at 168c3798cf11afd072b480f26a3bd23c1d9fc597 @@ -11,6 +11,10 @@ ]) COMMIT(branch2) +# run a db analyze so that SQLite creates any internal tables and indices, +# because we want to make sure we don't attempt to dump and load these. +AT_CHECK(MONOTONE db execute 'analyze;', [], [ignore], [ignore]) + AT_CHECK(MONOTONE db dump, [], [stdout], [ignore]) AT_CHECK(CANONICALISE(stdout)) AT_CHECK(MONOTONE db load