tidb
tidb copied to clipboard
expression: fix wrong flen from baseFunctionClass
What problem does this PR solve?
Issue Number: close #56587
Problem Summary:
What changed and how does it work?
ro
Previously, quoteFunctionClass may return type with flen = 0
https://github.com/pingcap/tidb/blob/f0b3bf0332ae33b0593f5f89ead872f71816cbd3/pkg/expression/builtin_string.go#L2899
And this type will be passed into LogicalUnionAll, which will result to a wrong type.
https://github.com/pingcap/tidb/blob/f0b3bf0332ae33b0593f5f89ead872f71816cbd3/pkg/planner/core/logical_plan_builder.go#L1586-L1591
Some other functions also have this problem, for example:
mysql> select elt(2, "123", cast('abcdefg' as char)) union all select "1234";
+----------------------------------------+
| elt(2, "123", cast('abcdefg' as char)) |
+----------------------------------------+
| abcd |
| 1234 |
+----------------------------------------+
2 rows in set, 1 warning (0.00 sec)
Check List
Tests
- [X] Unit test
- [ ] Integration test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test
- [ ] I checked and no code files have been changed.
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.
None
Hi @joechenrh. Thanks for your PR.
PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.
I understand the commands that are listed here.
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-sigs/prow repository.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 74.8608%. Comparing base (
0e3efb6) to head (3afd694). Report is 8 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #56607 +/- ##
================================================
+ Coverage 72.8325% 74.8608% +2.0283%
================================================
Files 1672 1717 +45
Lines 462833 472049 +9216
================================================
+ Hits 337093 353380 +16287
+ Misses 104947 96604 -8343
- Partials 20793 22065 +1272
| Flag | Coverage Δ | |
|---|---|---|
| integration | 49.1691% <83.3333%> (?) |
|
| unit | 72.4300% <100.0000%> (+0.2216%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Components | Coverage Δ | |
|---|---|---|
| dumpling | 52.7673% <ø> (ø) |
|
| parser | ∅ <ø> (∅) |
|
| br | 60.7186% <ø> (+15.6309%) |
:arrow_up: |
- Flaky Tests Detection - Detect and resolve failed and flaky tests
- JS Bundle Analysis - Avoid shipping oversized bundles
/retest
@joechenrh: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
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-sigs/prow repository.
/test check-dev
@yibin87: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/test check-dev
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-sigs/prow repository.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: windtalker, yibin87
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [windtalker]
- ~~pkg/expression/OWNERS~~ [windtalker]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
[LGTM Timeline notifier]
Timeline:
2024-10-21 05:46:33.878196916 +0000 UTC m=+243594.574987550: :ballot_box_with_check: agreed by windtalker.2024-11-19 07:51:17.919284155 +0000 UTC m=+947440.110153151: :ballot_box_with_check: agreed by yibin87.
/retest
@joechenrh: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
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-sigs/prow repository.
/retest
@joechenrh: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
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-sigs/prow repository.
/ok-to-test
/retest
/retest
In response to a cherrypick label: new pull request created to branch release-8.5: #57518.