Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f

Add back leading operator enforcement.
This commit is contained in:
Markus Mäkelä
2018-09-20 15:26:51 +03:00
parent d8d0b1a29c
commit 71ffef5708
95 changed files with 1395 additions and 1392 deletions

View File

@ -134,9 +134,9 @@ RWSplit::SrvStatMap RWSplit::all_server_stats() const
int RWSplit::max_slave_count() const
{
int router_nservers = m_service->n_dbref;
int conf_max_nslaves = m_config->max_slave_connections > 0
? m_config->max_slave_connections
: (router_nservers * m_config->rw_max_slave_conn_percent) / 100;
int conf_max_nslaves = m_config->max_slave_connections > 0 ?
m_config->max_slave_connections :
(router_nservers * m_config->rw_max_slave_conn_percent) / 100;
return MXS_MIN(router_nservers - 1, MXS_MAX(1, conf_max_nslaves));
}

View File

@ -125,9 +125,9 @@ static const MXS_ENUM_VALUE master_failure_mode_values[] =
#define MARIADB_WAIT_GTID_FUNC "MASTER_GTID_WAIT"
#define MYSQL_WAIT_GTID_FUNC "WAIT_FOR_EXECUTED_GTID_SET"
static const char gtid_wait_stmt[]
= "SET @maxscale_secret_variable=(SELECT CASE WHEN %s('%s', %s) = 0 "
"THEN 1 ELSE (SELECT 1 FROM INFORMATION_SCHEMA.ENGINES) END);";
static const char gtid_wait_stmt[] =
"SET @maxscale_secret_variable=(SELECT CASE WHEN %s('%s', %s) = 0 "
"THEN 1 ELSE (SELECT 1 FROM INFORMATION_SCHEMA.ENGINES) END);";
/** Function that returns a "score" for a server to enable comparison.
* Smaller numbers are better.

View File

@ -937,8 +937,8 @@ bool RWSplitSession::handle_master_is_target(SRWBackend* dest)
if (should_replace_master(target))
{
MXS_INFO("Replacing old master '%s' with new master '%s'",
m_current_master
? m_current_master->name() : "<no previous master>",
m_current_master ?
m_current_master->name() : "<no previous master>",
target->name());
replace_master(target);
}
@ -1004,8 +1004,8 @@ GWBUF* RWSplitSession::add_prefix_wait_gtid(SERVER* server, GWBUF* origin)
**/
GWBUF* rval = origin;
const char* wait_func = (server->server_type == SERVER_TYPE_MARIADB)
? MARIADB_WAIT_GTID_FUNC : MYSQL_WAIT_GTID_FUNC;
const char* wait_func = (server->server_type == SERVER_TYPE_MARIADB) ?
MARIADB_WAIT_GTID_FUNC : MYSQL_WAIT_GTID_FUNC;
const char* gtid_wait_timeout = m_config.causal_reads_timeout.c_str();
const char* gtid_position = m_gtid_pos.c_str();
@ -1088,9 +1088,9 @@ bool RWSplitSession::handle_got_target(GWBUF* querybuf, SRWBackend& target, bool
* will do the replacement of PS IDs which must not be done if we are
* continuing an ongoing query.
*/
bool success = !m_qc.large_query()
? target->write(send_buf, response)
: target->continue_write(send_buf);
bool success = !m_qc.large_query() ?
target->write(send_buf, response) :
target->continue_write(send_buf);
if (success)
{

View File

@ -289,9 +289,9 @@ private:
{
if (session_trx_is_ending(m_client->session))
{
mxb::atomic::add(m_qc.is_trx_still_read_only()
? &m_router->stats().n_ro_trx
: &m_router->stats().n_rw_trx,
mxb::atomic::add(m_qc.is_trx_still_read_only() ?
&m_router->stats().n_ro_trx :
&m_router->stats().n_rw_trx,
1,
mxb::atomic::RELAXED);
}