Skip to content
/ server Public

MDEV-38454 CHANGE MASTER TO master_heartbeat_period does not accept numbers with + sign#4617

Open
gengtianuiowa wants to merge 2 commits intoMariaDB:mainfrom
gengtianuiowa:mdev-34646
Open

MDEV-38454 CHANGE MASTER TO master_heartbeat_period does not accept numbers with + sign#4617
gengtianuiowa wants to merge 2 commits intoMariaDB:mainfrom
gengtianuiowa:mdev-34646

Conversation

@gengtianuiowa
Copy link
Contributor

Description

Fixed parser inconsistency where CHANGE MASTER TO master_heartbeat_period rejected numeric values with an explicit '+' sign, while other parameters like master_connect_retry accepted them.

The issue was in sql/sql_yacc.yy where master_heartbeat_period used NUM_literal (which doesn't accept '+'), while other parameters used ulong_num (which includes opt_plus).

Solution: Added opt_plus before NUM_literal in the master_heartbeat_period grammar rule, making it consistent with other numeric parameters.

How can this PR be tested?

Execute the mdev_38454.test in rpl test suite in mysql-test-run.

Basing the PR against the correct MariaDB version

  • This is a bug fix and the PR is based against the latest MariaDB development branch

Backward compatibility

This is a bug fix which allows "+" sign for "master_heartbeat_period". It is compatible with previous versions.

Copyright

All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.

gengtianuiowa and others added 2 commits January 28, 2026 22:38
…umbers with `+` sign

Fixed parser inconsistency where CHANGE MASTER TO master_heartbeat_period
rejected numeric values with an explicit '+' sign, while other parameters
like master_connect_retry accepted them.

The issue was in sql/sql_yacc.yy where master_heartbeat_period used
NUM_literal (which doesn't accept '+'), while other parameters used
ulong_num (which includes opt_plus).

Solution: Added opt_plus before NUM_literal in the master_heartbeat_period
grammar rule, making it consistent with other numeric parameters.

Added test case to verify:
- master_heartbeat_period=+60 now works (was broken)
- master_heartbeat_period=60 still works (backward compatible)
- Consistent behavior across all CHANGE MASTER TO numeric parameters

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
@bnestere bnestere requested a review from ParadoxV5 February 4, 2026 22:18
@bnestere bnestere added External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. Replication Patches involved in replication labels Feb 4, 2026
Copy link
Contributor

@ParadoxV5 ParadoxV5 left a comment

Choose a reason for hiding this comment

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

I’m back from Weekend Wednesday!

Thanks for including a test as well!
Although I don’t like how the older tests are named mdev_ABCD – very undescriptive.

Though for this topic, I suggest including the master_heartbeat_period=+60 test under the existing CHANGE MASTER test, which would be mysql-test/suite/rpl/t/rpl_heartbeat_basic.test by convention (if not rpl.rpl_heartbeat and it seems to have have their purposes mixed together).

master_connect_retry=+60 would belong to the corresponding CHANGE MASTER test… if there is one.
It and other fields are not the focus, anyhow.
(This is the status quo… I’d actually prefer gathering ALL format tests together in one script.)

As for the slave_net_timeout warning on amd64-debian-12-debug-embedded – It might be because the test needs --source include/not_embedded.inc, which in the rpl suite is normally practically covered by rpl_init.inc and co..
(We still can’t just get rid of Embedded builds… oh well.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. Replication Patches involved in replication

Development

Successfully merging this pull request may close these issues.

3 participants