MySQL 9.3.0
Source Code Documentation
counted_mysql_session.cc File Reference

Classes

class  collector::GuardBoolSetFalse
 

Namespaces

namespace  collector
 

Macros

#define CHECK_DISCONNECTION_RETURN(X)
 
#define CHECK_DISCONNECTION_VOID(X)
 

Typedefs

using collector::MySQLSession = mysqlrouter::MySQLSession
 

Functions

static bool collector::did_server_disconnect (unsigned int code)
 

Macro Definition Documentation

◆ CHECK_DISCONNECTION_RETURN

#define CHECK_DISCONNECTION_RETURN (   X)
Value:
{ \
GuardBoolSetFalse guard{reconnect_at_next_query_}; \
try { \
return X; \
} catch (const CountedMySQLSession::Error &e) { \
if (reconnect_at_next_query_ && did_server_disconnect(e.code())) { \
try { \
connect_and_set_opts(get_connection_parameters(), initial_sqls_); \
} catch (...) { \
throw e; \
} \
return X; \
} \
throw; \
} \
}
static bool did_server_disconnect(unsigned int code)
Definition: counted_mysql_session.cc:33
#define X(b)
Definition: xcom_base.cc:9195

◆ CHECK_DISCONNECTION_VOID

#define CHECK_DISCONNECTION_VOID (   X)
Value:
{ \
GuardBoolSetFalse guard{reconnect_at_next_query_}; \
try { \
X; \
} catch (const CountedMySQLSession::Error &e) { \
if (reconnect_at_next_query_ && did_server_disconnect(e.code())) { \
try { \
connect_and_set_opts(get_connection_parameters(), initial_sqls_); \
} catch (...) { \
throw e; \
} \
X; \
} \
throw; \
} \
}