diff options
| -rw-r--r-- | data/sql/commit.sql | 2 | ||||
| -rw-r--r-- | src/iso19111/factory.cpp | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/data/sql/commit.sql b/data/sql/commit.sql index e5850211..dbf1d738 100644 --- a/data/sql/commit.sql +++ b/data/sql/commit.sql @@ -301,4 +301,6 @@ INSERT INTO dummy DEFAULT VALUES; DROP TRIGGER final_checks; DROP TABLE dummy; +ANALYZE; + VACUUM; diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp index 7681a2ec..5eb6d012 100644 --- a/src/iso19111/factory.cpp +++ b/src/iso19111/factory.cpp @@ -819,7 +819,9 @@ std::vector<std::string> DatabaseContext::Private::getDatabaseStructure() { : "db_0."); const auto sqlBegin("SELECT sql||';' FROM " + dbNamePrefix + "sqlite_master WHERE type = "); - const char *const objectTypes[] = {"'table'", "'view'", "'trigger'"}; + const char *const objectTypes[] = {"'table' AND " + "name NOT LIKE 'sqlite_stat%'", + "'view'", "'trigger'"}; std::vector<std::string> res; for (const auto &objectType : objectTypes) { const auto sqlRes = run(sqlBegin + objectType); @@ -846,7 +848,8 @@ void DatabaseContext::Private::attachExtraDatabases( assert(sqlite_handle_); auto tables = - run("SELECT name FROM sqlite_master WHERE type IN ('table', 'view')"); + run("SELECT name FROM sqlite_master WHERE type IN ('table', 'view') " + "AND name NOT LIKE 'sqlite_stat%'"); std::map<std::string, std::vector<std::string>> tableStructure; for (const auto &rowTable : tables) { auto tableName = rowTable[0]; |
