MXS-1423: CHANGE MASTER TO tests with GTID option set
MXS-1423: CHANGE MASTER TO tests with GTID option set
This commit is contained in:
@ -9062,6 +9062,8 @@ static bool blr_change_binlog_name(ROUTER_INSTANCE *router,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
*new_logfile = MXS_STRDUP_A("");
|
*new_logfile = MXS_STRDUP_A("");
|
||||||
|
// Blank the error message
|
||||||
|
error[0] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -712,6 +712,90 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
tests++;
|
tests++;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MASTER_USE_GTID tests
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test 24: use MASTER_LOG_FILE without MASTER_USE_GTID=Slave_pos
|
||||||
|
* in state != BLRM_UNCONFIGURED
|
||||||
|
*
|
||||||
|
* Expected rc = -1
|
||||||
|
*/
|
||||||
|
inst->master_state = BLRM_UNCONNECTED;
|
||||||
|
inst->mariadb10_compat = 1;
|
||||||
|
inst->mariadb10_gtid = 1;
|
||||||
|
inst->mariadb10_master_gtid = 1;
|
||||||
|
|
||||||
|
strcpy(error_string, "");
|
||||||
|
strncpy(inst->binlog_name, "file.100506", BINLOG_FNAMELEN);
|
||||||
|
inst->current_pos = 138;
|
||||||
|
strcpy(inst->fileroot, "file");
|
||||||
|
sprintf(query,
|
||||||
|
"CHANGE MASTER TO MASTER_LOG_POS=1991, "
|
||||||
|
"MASTER_LOG_FILE='%s'",
|
||||||
|
inst->binlog_name);
|
||||||
|
|
||||||
|
rc = blr_test_handle_change_master(inst, query, error_string);
|
||||||
|
|
||||||
|
if (rc == -1)
|
||||||
|
{
|
||||||
|
printf("Test %d PASSED, GTID cannot set MASTER_LOG_FILE "
|
||||||
|
"for [%s], Message [%s]\n",
|
||||||
|
tests,
|
||||||
|
query,
|
||||||
|
error_string);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("Test %d: GTID set MASTER_LOG_FILE FAILED, "
|
||||||
|
"Master State is %s. Message [%s]\n",
|
||||||
|
tests,
|
||||||
|
blrm_states[inst->master_state], error_string);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tests++;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test 25: use MASTER_USE_GTID=Slave_pos with MASTER_LOG_FILE=''
|
||||||
|
* and MASTER_LOG_POS = 9999
|
||||||
|
* in state != BLRM_UNCONFIGURED
|
||||||
|
*
|
||||||
|
* Expected rc = -1
|
||||||
|
*/
|
||||||
|
inst->master_state = BLRM_UNCONNECTED;
|
||||||
|
inst->mariadb10_compat = 1;
|
||||||
|
inst->mariadb10_gtid = 1;
|
||||||
|
inst->mariadb10_master_gtid = 1;
|
||||||
|
strcpy(error_string, "");
|
||||||
|
strncpy(inst->binlog_name, "file.100506", BINLOG_FNAMELEN);
|
||||||
|
inst->current_pos = 328;
|
||||||
|
strcpy(inst->fileroot, "file");
|
||||||
|
strcpy(query,
|
||||||
|
"CHANGE MASTER TO MASTER_LOG_POS=1991, MASTER_USE_GTID=Slave_pos, "
|
||||||
|
"MASTER_LOG_FILE=''");
|
||||||
|
|
||||||
|
rc = blr_test_handle_change_master(inst, query, error_string);
|
||||||
|
|
||||||
|
if (rc == -1)
|
||||||
|
{
|
||||||
|
printf("Test %d: GTID set MASTER_USE_GTID=Slave_pos FAILED, "
|
||||||
|
"Master State is %s. Message [%s]\n",
|
||||||
|
tests,
|
||||||
|
blrm_states[inst->master_state], error_string);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("Test %d PASSED, GTID set MASTER_USE_GTID=Slave_pos "
|
||||||
|
"for [%s]: %s\n",
|
||||||
|
tests,
|
||||||
|
query,error_string);
|
||||||
|
}
|
||||||
|
|
||||||
|
tests++;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify SQL query initial comment skipping function works on a real use case.
|
* Verify SQL query initial comment skipping function works on a real use case.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user