Skip to content

fix(tdigest): correct TDIGEST.MERGE parser for COMPRESSION parameter.#3449

Merged
LindaSummer merged 3 commits into
apache:unstablefrom
Tangruilin:fix#3447
Apr 15, 2026
Merged

fix(tdigest): correct TDIGEST.MERGE parser for COMPRESSION parameter.#3449
LindaSummer merged 3 commits into
apache:unstablefrom
Tangruilin:fix#3447

Conversation

@Tangruilin

Copy link
Copy Markdown
Contributor

…(#3447)

The parser incorrectly used two independent if statements to check COMPRESSION and OVERRIDE parameters. When COMPRESSION was successfully parsed, the code continued to the second if which would fail since the parser had reached the end, causing "ERR wrong keyword" error.

Fixed by changing the second if to else if to form a proper if-else-if-else chain.

@Tangruilin

Copy link
Copy Markdown
Contributor Author

fix before:
image

after:
image

Comment thread .gitignore Outdated
@LindaSummer LindaSummer changed the title fix(tdigest): correct TDIGEST.MERGE parser for COMPRESSION parameter … fix(tdigest): correct TDIGEST.MERGE parser for COMPRESSION parameter. Apr 14, 2026

@LindaSummer LindaSummer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @Tangruilin ,

It seems this change involved some unexpected behavior.
It would be better to add related test cases for this scenario.

Comment thread src/commands/cmd_tdigest.cc
Comment thread .gitignore Outdated
…pache#3447)

The parser incorrectly used two independent `if` statements to check
COMPRESSION and OVERRIDE parameters. When COMPRESSION was successfully
parsed, the code continued to the second `if` which would fail since
the parser had reached the end, causing "ERR wrong keyword" error.

Fixed by changing the second `if` to `else if` to form a proper
if-else-if-else chain.

Signed-off-by: reilly <reilly@example.com>

@LindaSummer LindaSummer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @Tangruilin ,

LGTM🚀

Thanks very much for your great work!

@LindaSummer LindaSummer enabled auto-merge (squash) April 15, 2026 05:57
@LindaSummer LindaSummer merged commit 27fbff1 into apache:unstable Apr 15, 2026
71 of 73 checks passed
@sonarqubecloud

Copy link
Copy Markdown

nagisa-kunhah pushed a commit to nagisa-kunhah/kvrocks that referenced this pull request Apr 29, 2026
…apache#3449)

Fix apache#3447

The parser incorrectly used two independent `if` statements to check
COMPRESSION and OVERRIDE parameters. When COMPRESSION was successfully
parsed, the code continued to the second `if` which would fail since the
parser had reached the end, causing "ERR wrong keyword" error.

Fixed by changing the second `if` to `else if` to form a proper
if-else-if-else chain.

Signed-off-by: reilly <reilly@example.com>
Co-authored-by: 纪华裕 <jihuayu123@gmail.com>
nagisa-kunhah pushed a commit to nagisa-kunhah/kvrocks that referenced this pull request Apr 29, 2026
…apache#3449)

Fix apache#3447

The parser incorrectly used two independent `if` statements to check
COMPRESSION and OVERRIDE parameters. When COMPRESSION was successfully
parsed, the code continued to the second `if` which would fail since the
parser had reached the end, causing "ERR wrong keyword" error.

Fixed by changing the second `if` to `else if` to form a proper
if-else-if-else chain.

Signed-off-by: reilly <reilly@example.com>
Co-authored-by: 纪华裕 <jihuayu123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants