]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1196] Renamed PG_SCHEMA_VERSION_XXX
authorFrancis Dupont <fdupont@isc.org>
Wed, 20 May 2020 18:50:15 +0000 (20:50 +0200)
committerFrancis Dupont <fdupont@isc.org>
Fri, 19 Jun 2020 15:04:50 +0000 (17:04 +0200)
src/lib/dhcpsrv/pgsql_host_data_source.cc
src/lib/dhcpsrv/pgsql_lease_mgr.cc
src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc
src/lib/pgsql/pgsql_connection.h
src/lib/pgsql/testutils/pgsql_schema.cc
src/lib/pgsql/testutils/pgsql_schema.h

index cc874375e6bcf7ceff4f31e0e1e1a89f5056cad0..db30fa677881c00e1a757feea484722838d1ebfc 100644 (file)
@@ -2035,8 +2035,8 @@ PgSqlHostDataSourceImpl::PgSqlHostDataSourceImpl(const PgSqlConnection::Paramete
     : parameters_(parameters) {
 
     // Validate the schema version first.
-    std::pair<uint32_t, uint32_t> code_version(PG_SCHEMA_VERSION_MAJOR,
-                                               PG_SCHEMA_VERSION_MINOR);
+    std::pair<uint32_t, uint32_t> code_version(PGSQL_SCHEMA_VERSION_MAJOR,
+                                               PGSQL_SCHEMA_VERSION_MINOR);
     std::pair<uint32_t, uint32_t> db_version = getVersion();
     if (code_version != db_version) {
         isc_throw(DbOpenError,
index 546e1cf8df650f85eb7a9412e73f116eadc2850e..b8a3e18516f74584bbffc2f179237abce0cc7b17 100644 (file)
@@ -1212,8 +1212,8 @@ PgSqlLeaseMgr::PgSqlLeaseMgr(const DatabaseConnection::ParameterMap& parameters)
     : parameters_(parameters) {
 
     // Validate schema version first.
-    std::pair<uint32_t, uint32_t> code_version(PG_SCHEMA_VERSION_MAJOR,
-                                               PG_SCHEMA_VERSION_MINOR);
+    std::pair<uint32_t, uint32_t> code_version(PGSQL_SCHEMA_VERSION_MAJOR,
+                                               PGSQL_SCHEMA_VERSION_MINOR);
     std::pair<uint32_t, uint32_t> db_version = getVersion();
     if (code_version != db_version) {
         isc_throw(DbOpenError,
@@ -1263,8 +1263,8 @@ PgSqlLeaseMgr::createContext() const {
 std::string
 PgSqlLeaseMgr::getDBVersion() {
     std::stringstream tmp;
-    tmp << "PostgreSQL backend " << PG_SCHEMA_VERSION_MAJOR;
-    tmp << "." << PG_SCHEMA_VERSION_MINOR;
+    tmp << "PostgreSQL backend " << PGSQL_SCHEMA_VERSION_MAJOR;
+    tmp << "." << PGSQL_SCHEMA_VERSION_MINOR;
     tmp << ", library " << PQlibVersion();
     return (tmp.str());
 }
index 39b0883e9633cbb43a8ced9675f00788f200ce2c..381b194c9854fc2d0cde6f49998915f4cdf099ea 100644 (file)
@@ -246,8 +246,8 @@ TEST_F(PgSqlLeaseMgrTest, checkVersion) {
     // Check version
     pair<uint32_t, uint32_t> version;
     ASSERT_NO_THROW(version = lmptr_->getVersion());
-    EXPECT_EQ(PG_SCHEMA_VERSION_MAJOR, version.first);
-    EXPECT_EQ(PG_SCHEMA_VERSION_MINOR, version.second);
+    EXPECT_EQ(PGSQL_SCHEMA_VERSION_MAJOR, version.first);
+    EXPECT_EQ(PGSQL_SCHEMA_VERSION_MINOR, version.second);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
index b02346eb81d1eb49d6525d2a295a5896879fc4fc..12e500f160d13272c83e1fd788df6f862bde19b0 100644 (file)
@@ -18,8 +18,8 @@ namespace isc {
 namespace db {
 
 /// @brief Define PostgreSQL backend version: 6.1
-const uint32_t PG_SCHEMA_VERSION_MAJOR = 6;
-const uint32_t PG_SCHEMA_VERSION_MINOR = 1;
+const uint32_t PGSQL_SCHEMA_VERSION_MAJOR = 6;
+const uint32_t PGSQL_SCHEMA_VERSION_MINOR = 1;
 
 // Maximum number of parameters that can be used a statement
 // @todo This allows us to use an initializer list (since we can't
index 7d6e5dfe66fe867c1b8041fca1499f49eb3f8ccd..21b313c1bc2db17a1ea2f74d8ad8694d038806e3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -56,7 +56,7 @@ bool wipePgSQLData(bool show_err) {
     cmd << " sh " << DATABASE_SCRIPTS_DIR << "/pgsql/wipe_data.sh";
 
     // Add expected schema version as the wipe script's first argument.
-    cmd  << " " << PG_SCHEMA_VERSION_MAJOR  << "." << PG_SCHEMA_VERSION_MINOR;
+    cmd  << " " << PGSQL_SCHEMA_VERSION_MAJOR  << "." << PGSQL_SCHEMA_VERSION_MINOR;
 
     // Now add command line arguments for psql.
     cmd  << " --set ON_ERROR_STOP=1 -A -t -h localhost -q -U keatest -d keatest";
index 2ebafa44b5d92fef59ef2fbd7b702ee605a78562..6d907621622402a0746dfb85e4d3f61202295474 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -76,8 +76,8 @@ void createPgSQLSchema(bool show_err = false, bool force = false);
 ///  <TEST_ADMIN_SCRIPTS_DIR>/pgsql/wipe_data.sh
 ///
 /// This will fail if there is no schema, if the existing schema
-/// version is incorrect (i.e. does not match PG_SCHEMA_VERSION_MAJOR
-/// and PG_SCHEMA_VERSION_MINOR), or a SQL error occurs.  Otherwise,
+/// version is incorrect (i.e. does not match PGSQL_SCHEMA_VERSION_MAJOR
+/// and PGSQL_SCHEMA_VERSION_MINOR), or a SQL error occurs.  Otherwise,
 /// the script is should delete all transient data, leaving intact
 /// reference tables.
 ///