Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.6, 10.11, 11.4, 11.8, 10.5(EOL), 11.7(EOL)
-
Can result in unexpected behaviour
-
Command START SLAVE UNTIL would invalidly allow some CHANGE MASTER TO options (e.g. MASTER_USE_GTID, MASTER_DEMOTE_TO_SLAVE) despite not being valid for a START SLAVE command.
-
Q3/2025 Maintenance
Description
When using START SLAVE UNTIL, the UNTIL grammar rule uses master_file_def (through slave_until_opts), which is also used by CHANGE MASTER TO. This means that a START SLAVE UNTIL statement can use any option available to the master_file_def rule (e.g. master_use_gtid, master_demote_to_slave), despite not being valid for START SLAVE. For example:
START SLAVE UNTIL relay_log_file='mariadb-bin.000002', relay_log_pos=50, master_demote_to_slave=1, master_use_gtid=no;
|
The only constraint is that the master/relay log file/pos have to be set:
| UNTIL_SYM slave_until_opts
|
{
|
LEX *lex=Lex;
|
if (unlikely(((lex->mi.log_file_name || lex->mi.pos) &&
|
(lex->mi.relay_log_name || lex->mi.relay_log_pos)) ||
|
!((lex->mi.log_file_name && lex->mi.pos) ||
|
(lex->mi.relay_log_name && lex->mi.relay_log_pos))))
|
my_yyabort_error((ER_BAD_SLAVE_UNTIL_COND, MYF(0)));
|
}
|
The valid options for START SLAVE UNTIL should be split from master_file_def to disallow this.