diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 11:36:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 11:36:04 +0000 |
commit | 040eee1aa49b49df4698d83a05af57c220127fd1 (patch) | |
tree | f635435954e6ccde5eee9893889e24f30ca68346 /src/lib/mysql/mysql_constants.h | |
parent | Initial commit. (diff) | |
download | isc-kea-040eee1aa49b49df4698d83a05af57c220127fd1.tar.xz isc-kea-040eee1aa49b49df4698d83a05af57c220127fd1.zip |
Adding upstream version 2.2.0.upstream/2.2.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib/mysql/mysql_constants.h')
-rw-r--r-- | src/lib/mysql/mysql_constants.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/lib/mysql/mysql_constants.h b/src/lib/mysql/mysql_constants.h new file mode 100644 index 0000000..f7f38b9 --- /dev/null +++ b/src/lib/mysql/mysql_constants.h @@ -0,0 +1,64 @@ +// Copyright (C) 2018-2022 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 = 14; +const uint32_t MYSQL_SCHEMA_VERSION_MINOR = 0; + +//@} + + +} // end of namespace isc::db +} // end of namespace isc + +#endif |