Kea 2.5.8
isc::dhcp::MySqlLeaseExchange Class Reference

Common MySQL and Lease Data Methods. More...

+ Inheritance diagram for isc::dhcp::MySqlLeaseExchange:

Static Public Member Functions

static std::string getColumnsInError (my_bool *error, std::string *names, size_t count)
 Return columns in error.
 
static void setErrorIndicators (MYSQL_BIND *bind, my_bool *error, size_t count)
 Set error indicators.
 

Detailed Description

Common MySQL and Lease Data Methods.

The MySqlLease4Exchange and MySqlLease6Exchange classes provide the functionality to set up binding information between variables in the program and data extracted from the database. This class is the common base to both of them, containing some common methods.

Definition at line 540 of file mysql_lease_mgr.cc.

Member Function Documentation

◆ getColumnsInError()

static std::string isc::dhcp::MySqlLeaseExchange::getColumnsInError ( my_bool error,
std::string *  names,
size_t  count 
)
inlinestatic

Return columns in error.

If an error is returned from a fetch (in particular, a truncated status), this method can be called to get the names of the fields in error. It returns a string comprising the names of the fields separated by commas. In the case of there being no error indicators set, it returns the string "(None)".

Parameters
errorArray of error elements. An element is set to MLM_TRUE if the corresponding column in the database is the source of the error.
namesArray of column names, the same size as the error array.
countSize of each of the arrays.

Definition at line 575 of file mysql_lease_mgr.cc.

References isc::db::error, and isc::db::MLM_TRUE.

Referenced by isc::dhcp::MySqlLease4Exchange::getErrorColumns(), and isc::dhcp::MySqlLease6Exchange::getErrorColumns().

◆ setErrorIndicators()

static void isc::dhcp::MySqlLeaseExchange::setErrorIndicators ( MYSQL_BIND *  bind,
my_bool error,
size_t  count 
)
inlinestatic

Set error indicators.

Sets the error indicator for each of the MYSQL_BIND elements. It points the "error" field within an element of the input array to the corresponding element of the passed error array.

Parameters
bindArray of BIND elements
errorArray of error elements. If there is an error in getting data associated with one of the "bind" elements, the corresponding element in the error array is set to MLM_TRUE.
countSize of each of the arrays.

Definition at line 554 of file mysql_lease_mgr.cc.

References isc::db::error, and isc::db::MLM_FALSE.

Referenced by isc::dhcp::MySqlLease4Exchange::createBindForReceive(), isc::dhcp::MySqlLease6Exchange::createBindForReceive(), isc::dhcp::MySqlLease4Exchange::createBindForSend(), and isc::dhcp::MySqlLease6Exchange::createBindForSend().


The documentation for this class was generated from the following file: