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
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