2020-01-27 19:52:58 +01:00
|
|
|
// Copyright (C) 2018-2020 Internet Systems Consortium, Inc. ("ISC")
|
2018-09-18 08:36:53 +02:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
///
|
|
|
|
//@{
|
|
|
|
|
2018-12-21 16:59:47 +01:00
|
|
|
#ifdef HAVE_MYSQL_MY_BOOL
|
2018-12-22 02:03:33 +01:00
|
|
|
/// @brief my_bools type for vectors.
|
|
|
|
typedef my_bool my_bools;
|
|
|
|
|
2018-09-18 08:36:53 +02:00
|
|
|
/// @brief MySQL false value.
|
|
|
|
const my_bool MLM_FALSE = 0;
|
|
|
|
|
|
|
|
/// @brief MySQL true value.
|
|
|
|
const my_bool MLM_TRUE = 1;
|
|
|
|
|
2018-12-21 16:59:47 +01:00
|
|
|
#else
|
2020-01-23 09:05:42 +02:00
|
|
|
///@brief check for bool size
|
|
|
|
static_assert(sizeof(bool) == 1, "unsupported bool size");
|
|
|
|
|
2018-12-22 02:03:33 +01:00
|
|
|
/// @brief my_bool type in MySQL 8.x.
|
2018-12-21 16:59:47 +01:00
|
|
|
typedef bool my_bool;
|
|
|
|
|
2018-12-22 02:03:33 +01:00
|
|
|
/// @brief my_bools type for vectors in MySQL 8.x.
|
|
|
|
/// @note vector<my_bool> is specialized into a bitset.
|
|
|
|
typedef char my_bools;
|
|
|
|
|
2018-12-21 16:59:47 +01:00
|
|
|
/// @brief MySQL false value.
|
|
|
|
const my_bool MLM_FALSE = false;
|
|
|
|
|
|
|
|
/// @brief MySQL true value.
|
|
|
|
const my_bool MLM_TRUE = true;
|
|
|
|
#endif
|
|
|
|
|
2018-09-18 08:36:53 +02:00
|
|
|
/// @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.
|
|
|
|
//@{
|
2019-09-29 23:01:44 +02:00
|
|
|
const uint32_t MYSQL_SCHEMA_VERSION_MAJOR = 9;
|
2019-11-28 11:43:25 +01:00
|
|
|
const uint32_t MYSQL_SCHEMA_VERSION_MINOR = 1;
|
2018-09-18 08:36:53 +02:00
|
|
|
|
|
|
|
//@}
|
|
|
|
|
|
|
|
|
|
|
|
} // end of namespace isc::db
|
|
|
|
} // end of namespace isc
|
|
|
|
|
|
|
|
#endif
|