From 950ce787b26b3b3afd0ff76151fdf72d1381b7a1 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 4 Apr 2021 22:44:07 +0200 Subject: Database: nullify auth_name, code of usage table We never select by those columns, so don't set them. Reduce from 8.4 to 7.9 MB. Upgrade the minor version of the database layout. (that database can still be read by PROJ 8.0) --- src/iso19111/factory.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp index 2da09d27..b59cc1ab 100644 --- a/src/iso19111/factory.cpp +++ b/src/iso19111/factory.cpp @@ -101,7 +101,7 @@ namespace io { constexpr int DATABASE_LAYOUT_VERSION_MAJOR = 1; // If the code depends on the new additions, then DATABASE_LAYOUT_VERSION_MINOR // must be incremented. -constexpr int DATABASE_LAYOUT_VERSION_MINOR = 0; +constexpr int DATABASE_LAYOUT_VERSION_MINOR = 1; constexpr size_t N_MAX_PARAMS = 7; @@ -735,7 +735,7 @@ void DatabaseContext::Private::checkDatabaseLayout( // cppcheck-suppress knownConditionTrueFalse DATABASE_LAYOUT_VERSION_MAJOR == 1 && // cppcheck-suppress knownConditionTrueFalse - DATABASE_LAYOUT_VERSION_MINOR == 0, + DATABASE_LAYOUT_VERSION_MINOR == 1, "remove that assertion and below lines next time we upgrade " "database structure"); res = run("SELECT 1 FROM metadata WHERE key = 'EPSG.VERSION' AND " @@ -766,6 +766,15 @@ void DatabaseContext::Private::checkDatabaseLayout( " is expected. " "It comes from another PROJ installation."); } + // Database layout v1.0 of PROJ 8.0 is forward compatible with v1.1 + static_assert( + // cppcheck-suppress knownConditionTrueFalse + DATABASE_LAYOUT_VERSION_MAJOR == 1 && + // cppcheck-suppress knownConditionTrueFalse + DATABASE_LAYOUT_VERSION_MINOR == 1, + "re-enable the check below if database layout v1.0 and v1.1 is no " + "longer compatible"); +#if 0 if (minor < DATABASE_LAYOUT_VERSION_MINOR) { throw FactoryException( path + @@ -774,6 +783,7 @@ void DatabaseContext::Private::checkDatabaseLayout( " is expected. " "It comes from another PROJ installation."); } +#endif if (dbNamePrefix.empty()) { nLayoutVersionMajor_ = major; nLayoutVersionMinor_ = minor; -- cgit v1.2.3