Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executor: Fix group_concat returns wrong results after set group_concat_max_len #35852

Merged
merged 12 commits into from
Jul 5, 2022

Conversation

SeaRise
Copy link
Contributor

@SeaRise SeaRise commented Jun 30, 2022

What problem does this PR solve?

Issue Number: close #27751

Problem Summary:

What is changed and how it works?

Use heap.pop instead of rows[0] to get the top element of the heap in topNRows::tryToAdd

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

Fix the issue that group_concat returns wrong results after set group_concat_max_len

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 30, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • XuHuaiyu
  • guo-shaoge

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added needs-cherry-pick-release-5.0 needs-cherry-pick-release-5.1 needs-cherry-pick-release-5.2 needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-6.0 needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 30, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Jun 30, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 30, 2022
@SeaRise SeaRise changed the title Fix group_concat returns wrong results after set group_concat_max_len executor: Fix group_concat returns wrong results after set group_concat_max_len Jun 30, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Jun 30, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@SeaRise
Copy link
Contributor Author

SeaRise commented Jun 30, 2022

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Jun 30, 2022

@SeaRise
Copy link
Contributor Author

SeaRise commented Jun 30, 2022

/cc @XuHuaiyu @guo-shaoge

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 5, 2022

/run-unit-test

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 5, 2022

/run-check_dev_2

@ti-chi-bot ti-chi-bot merged commit 07afcb8 into pingcap:master Jul 5, 2022
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jul 5, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0 in PR #35935

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jul 5, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-5.1 in PR #35936

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jul 5, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-5.2 in PR #35937

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jul 5, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-5.3 in PR #35938

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jul 5, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-5.4 in PR #35939

@SeaRise SeaRise deleted the fix_issues_27751 branch July 5, 2022 03:21
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jul 5, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-6.0 in PR #35940

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jul 5, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-6.1 in PR #35941

@SeaRise
Copy link
Contributor Author

SeaRise commented May 8, 2023

/review default

1 similar comment
@SeaRise
Copy link
Contributor Author

SeaRise commented May 8, 2023

/review default

@ti-chi-bot
Copy link

ti-chi-bot bot commented May 8, 2023

@SeaRise:

Review of Pull Request: executor: Fix group_concat returns wrong results after set group_concat_max_len

Summary

This pull request fixes a bug where group_concat returns wrong results after setting group_concat_max_len. It uses heap.pop instead of rows[0] to get the top element of the heap in topNRows::tryToAdd.

Key Changes

  • Used heap.pop in topNRows::tryToAdd instead of rows[0].
  • Other minor changes.

Potential Problems

  • No tests for integration and manual testing have been included.
  • No new tests for the specific fix have been added.

Suggestions

  • Add integration test cases and re-run tests to ensure that other parts of the code weren't affected.
  • Add new tests that focus specifically on the fix applied.
  • Consider adding more details to the pull request description, such as how results used to be incorrect and what issues this caused.
  • Consider changing the release note to include more specific information about the issue (group_concat bug) and what the fix is.

Final Verdict

The changes proposed in this pull request seem to be appropriate and fixes an existing bug. However, it still needs work to be considered safe for merging.

In response to this:

/review default

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot
Copy link

ti-chi-bot bot commented May 8, 2023

@SeaRise:
Sorry, failed to send message to OpenAI server!

In response to this:

/review default

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.0 needs-cherry-pick-release-5.1 needs-cherry-pick-release-5.2 needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

group_concat returns wrong results after set group_concat_max_len
7 participants