Skip to content
/ server Public
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions mysql-test/suite/rpl/r/mdev_38454.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Testing master_connect_retry with + sign (expected to work)
CHANGE MASTER TO master_connect_retry=+60;
# Success
# Testing master_connect_retry without + sign (expected to work)
CHANGE MASTER TO master_connect_retry=60;
# Success
# Testing master_heartbeat_period with + sign (should work)
CHANGE MASTER TO master_heartbeat_period=+60;
# Testing both without + sign (should work)
CHANGE MASTER TO master_connect_retry=60;
CHANGE MASTER TO master_heartbeat_period=60;
# Success
RESET SLAVE ALL;
37 changes: 37 additions & 0 deletions mysql-test/suite/rpl/t/mdev_38454.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# MDEV-38454: CHANGE MASTER TO master_heartbeat_period does not accept numbers with `+` sign
#
# Simple test to demonstrate the parser inconsistency has been fixed
#

#
# Test master_connect_retry with explicit + sign (should work)
#
--echo # Testing master_connect_retry with + sign (expected to work)
CHANGE MASTER TO master_connect_retry=+60;
--echo # Success

#
# Test master_connect_retry without explicit + sign (should work)
#
--echo # Testing master_connect_retry without + sign (expected to work)
CHANGE MASTER TO master_connect_retry=60;
--echo # Success

#
# Test master_heartbeat_period with explicit + sign (should work after fix)
#
--echo # Testing master_heartbeat_period with + sign (should work)
CHANGE MASTER TO master_heartbeat_period=+60;

#
# Test without + sign (should work for both)
#
--echo # Testing both without + sign (should work)
CHANGE MASTER TO master_connect_retry=60;
CHANGE MASTER TO master_heartbeat_period=60;
--echo # Success


# Reset
RESET SLAVE ALL;
4 changes: 2 additions & 2 deletions sql/sql_yacc.yy
Original file line number Diff line number Diff line change
Expand Up @@ -2384,9 +2384,9 @@ master_def:
Lex->mi.ssl_crlpath= $3.str;
}

| MASTER_HEARTBEAT_PERIOD_SYM '=' NUM_literal
| MASTER_HEARTBEAT_PERIOD_SYM '=' opt_plus NUM_literal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve the conflict here. I'd use "num_or_default" instead of NUM_literal here.

{
Lex->mi.heartbeat_period= (float) $3->val_real();
Lex->mi.heartbeat_period= (float) $4->val_real();
if (unlikely(Lex->mi.heartbeat_period >
SLAVE_MAX_HEARTBEAT_PERIOD) ||
unlikely(Lex->mi.heartbeat_period < 0.0))
Expand Down