2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-07 09:25:15 +00:00
Files
kea/src/lib/mysql/mysql_constants.h
Thomas Markwalder 5ed24d5839 [#2909] Mysql v6 addresses to binary
lease6.address and ipv6_reservations.address columns
changed from varbinary(39) to binary(16).

lease6.binaddr column removed

deleted:    src/share/api/binary-address6-upgrade.json
new file:   src/share/database/scripts/mysql/upgrade_018_to_019.sh.in

configure.ac
   added new mysql upgrade script

doc/sphinx/arm/hooks-lease-query.rst
    removed doc for binary-address6-upgrade command

src/bin/admin/tests/mysql_tests.sh.in
    modified to use inet6_aton/ntoa as now needed
    Updated to test upgrage

src/lib/dhcpsrv/lease_mgr.h
    LeaseMgr::upgradeBinaryAddress6() - no longer
    abstract, provides a dummy implemention

src/lib/dhcpsrv/mysql_host_data_source.cc
    Change v6 reservation address to binary

src/lib/dhcpsrv/mysql_lease_mgr.*
    Remove lease6.binaddr and uses
    Change lease6.address to binary

src/lib/mysql/mysql_constants.h
    Update schema version

src/share/api/api_files.mk
    Remove binary-address6-upgrade.json

src/share/database/scripts/mysql/Makefile.am
    Add upgrade script

src/share/database/scripts/mysql/dhcpdb_create.mysql
    Modify lease6, ipv6_reservations, and impacted functions
2023-06-21 14:21:08 -04:00

65 lines
1.4 KiB
C++

// Copyright (C) 2018-2023 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
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef MYSQL_CONSTANTS_H
#define MYSQL_CONSTANTS_H
#include <mysql.h>
namespace isc {
namespace db {
/// @name MySQL constants.
///
//@{
/// @brief my_bools type for vectors.
/// @note vector<bool> is specialized into a bitset, so vector<char>
/// must be used instead
typedef char my_bools;
#ifdef HAVE_MYSQL_MY_BOOL
/// @brief MySQL false value.
const my_bool MLM_FALSE = 0;
/// @brief MySQL true value.
const my_bool MLM_TRUE = 1;
#else
/// @brief my_bool type in MySQL 8.x.
typedef bool my_bool;
/// @brief MySQL false value.
const my_bool MLM_FALSE = false;
/// @brief MySQL true value.
const my_bool MLM_TRUE = true;
#endif
///@brief check for bool size
static_assert(sizeof(my_bool) == sizeof(char), "unsupported bool size");
/// @brief MySQL fetch success code.
const int MLM_MYSQL_FETCH_SUCCESS = 0;
/// @brief MySQL fetch failure code.
const int MLM_MYSQL_FETCH_FAILURE = 0;
//@}
/// @name Current database schema version values.
//@{
const uint32_t MYSQL_SCHEMA_VERSION_MAJOR = 19;
const uint32_t MYSQL_SCHEMA_VERSION_MINOR = 0;
//@}
} // end of namespace isc::db
} // end of namespace isc
#endif