Merge branch 'release-1.0beta-refresh' of github.com:skysql/MaxScale into release-1.0beta-refresh

This commit is contained in:
Mark Riddoch
2014-09-24 10:22:03 +01:00
4 changed files with 43 additions and 12 deletions

View File

@ -359,17 +359,37 @@ static bool create_parse_tree(
Parser_state parser_state; Parser_state parser_state;
bool failp = FALSE; bool failp = FALSE;
const char* virtual_db = "skygw_virtual"; const char* virtual_db = "skygw_virtual";
#if defined(SS_DEBUG_EXTRA)
LOGIF(LM, (skygw_log_write_flush(
LOGFILE_MESSAGE,
"[readwritesplit:create_parse_tree] 1.")));
#endif
if (parser_state.init(thd, thd->query(), thd->query_length())) { if (parser_state.init(thd, thd->query(), thd->query_length())) {
failp = TRUE; failp = TRUE;
goto return_here; goto return_here;
} }
mysql_reset_thd_for_next_command(thd); #if defined(SS_DEBUG_EXTRA)
LOGIF(LM, (skygw_log_write_flush(
/** Set some database to thd so that parsing won't fail because of LOGFILE_MESSAGE,
* missing database. Then parse. */ "[readwritesplit:create_parse_tree] 2.")));
failp = thd->set_db(virtual_db, strlen(virtual_db)); #endif
mysql_reset_thd_for_next_command(thd);
#if defined(SS_DEBUG_EXTRA)
LOGIF(LM, (skygw_log_write_flush(
LOGFILE_MESSAGE,
"[readwritesplit:create_parse_tree] 3.")));
#endif
/**
* Set some database to thd so that parsing won't fail because of
* missing database. Then parse.
*/
failp = thd->set_db(virtual_db, strlen(virtual_db));
#if defined(SS_DEBUG_EXTRA)
LOGIF(LM, (skygw_log_write_flush(
LOGFILE_MESSAGE,
"[readwritesplit:create_parse_tree] 4.")));
#endif
if (failp) { if (failp) {
LOGIF(LE, (skygw_log_write_flush( LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR, LOGFILE_ERROR,
@ -377,6 +397,11 @@ static bool create_parse_tree(
} }
failp = parse_sql(thd, &parser_state, NULL); failp = parse_sql(thd, &parser_state, NULL);
#if defined(SS_DEBUG_EXTRA)
LOGIF(LM, (skygw_log_write_flush(
LOGFILE_MESSAGE,
"[readwritesplit:create_parse_tree] 5.")));
#endif
if (failp) { if (failp) {
LOGIF(LD, (skygw_log_write( LOGIF(LD, (skygw_log_write(
LOGFILE_DEBUG, LOGFILE_DEBUG,

View File

@ -447,13 +447,15 @@ size_t nrounds = 0;
} }
/** Wait base interval */ /** Wait base interval */
thread_millisleep(MON_BASE_INTERVAL_MS); thread_millisleep(MON_BASE_INTERVAL_MS);
nrounds += 1;
/** If monitor interval time isn't consumed skip checks */ /** If monitor interval time isn't consumed skip checks */
if ((nrounds*MON_BASE_INTERVAL_MS)%handle->interval != 0) if (nrounds != 0 &&
(nrounds*MON_BASE_INTERVAL_MS)%handle->interval != 0)
{ {
nrounds += 1;
continue; continue;
} }
nrounds += 1;
master_id = -1; master_id = -1;
ptr = handle->databases; ptr = handle->databases;

View File

@ -611,13 +611,15 @@ size_t nrounds = 0;
} }
/** Wait base interval */ /** Wait base interval */
thread_millisleep(MON_BASE_INTERVAL_MS); thread_millisleep(MON_BASE_INTERVAL_MS);
nrounds += 1;
/** If monitor interval time isn't consumed skip checks */ /** If monitor interval time isn't consumed skip checks */
if ((nrounds*MON_BASE_INTERVAL_MS)%handle->interval != 0) if (nrounds != 0 &&
(nrounds*MON_BASE_INTERVAL_MS)%handle->interval != 0)
{ {
nrounds += 1;
continue; continue;
} }
nrounds += 1;
/* reset num_servers */ /* reset num_servers */
num_servers = 0; num_servers = 0;

View File

@ -445,13 +445,15 @@ size_t nrounds = 0;
/** Wait base interval */ /** Wait base interval */
thread_millisleep(MON_BASE_INTERVAL_MS); thread_millisleep(MON_BASE_INTERVAL_MS);
nrounds += 1;
/** If monitor interval time isn't consumed skip checks */ /** If monitor interval time isn't consumed skip checks */
if ((nrounds*MON_BASE_INTERVAL_MS)%handle->interval != 0) if (nrounds != 0 &&
(nrounds*MON_BASE_INTERVAL_MS)%handle->interval != 0)
{ {
nrounds += 1;
continue; continue;
} }
nrounds += 1;
master_id = -1; master_id = -1;
ptr = handle->databases; ptr = handle->databases;