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

expression: use maximum length for integer display #56463

Merged
merged 6 commits into from
Oct 14, 2024

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Oct 7, 2024

What problem does this PR solve?

Issue Number: close #56462 close #45338 close #41719

Problem Summary:

What changed and how does it work?

Check List

Tests

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

Issues related to casting integers with a non-default display width to strings have been fixed.

Copy link

ti-chi-bot bot commented Oct 7, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 7, 2024
Copy link

tiprow bot commented Oct 7, 2024

Hi @dveeden. 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.

@dveeden
Copy link
Contributor Author

dveeden commented Oct 7, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Oct 7, 2024
@dveeden
Copy link
Contributor Author

dveeden commented Oct 7, 2024

/check-issue-triage-complete

@dveeden
Copy link
Contributor Author

dveeden commented Oct 7, 2024

This looks good:

mysql-8.0.11-TiDB-v8.4.0-alpha-325-g74034d4ac2-dirty> DROP TABLE IF EXISTS test.t;
Query OK, 0 rows affected (0.02 sec)

mysql-8.0.11-TiDB-v8.4.0-alpha-325-g74034d4ac2-dirty> CREATE TABLE test.t (id bigint(11) UNSIGNED PRIMARY KEY);
Query OK, 0 rows affected (0.01 sec)

mysql-8.0.11-TiDB-v8.4.0-alpha-325-g74034d4ac2-dirty> INSERT INTO test.t VALUES (1234567890123456);
Query OK, 1 row affected (0.00 sec)

mysql-8.0.11-TiDB-v8.4.0-alpha-325-g74034d4ac2-dirty> SELECT IFNULL(id, 'abcdef') FROM test.t;
+----------------------+
| IFNULL(id, 'abcdef') |
+----------------------+
| 1234567890123456     |
+----------------------+
1 row in set (0.00 sec)

This should result in a warning and truncation, but no longer does:

mysql-8.0.11-TiDB-v8.4.0-alpha-325-g74034d4ac2-dirty> WITH a AS (SELECT 1234 v) SELECT CAST(v AS CHAR(2)) FROM a;
+--------------------+
| CAST(v AS CHAR(2)) |
+--------------------+
| 1234               |
+--------------------+
1 row in set (0.00 sec)

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. labels Oct 8, 2024
@Defined2014
Copy link
Contributor

Defined2014 commented Oct 9, 2024

Hi @dveeden, is this PR ready for review? And I think this PR also could fix #45338

Maybe we should modified setFlenFromArgs function to fix it.

@dveeden
Copy link
Contributor Author

dveeden commented Oct 9, 2024

Hi @dveeden, is this PR ready for review?

Not yet, the problem. There is a regression that needs to be fixed. See #56463 (comment) for details.

And I think this PR also could fix #45338

Yes, correct.

Maybe we should modified setFlenFromArgs function to fix it.

@dveeden dveeden marked this pull request as ready for review October 11, 2024 12:42
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 11, 2024
@dveeden
Copy link
Contributor Author

dveeden commented Oct 11, 2024

Maybe we should modified setFlenFromArgs function to fix it.

Yes. Thanks!

Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 4 lines in your changes missing coverage. Please review.

Project coverage is 56.9180%. Comparing base (0f6bddd) to head (b6acaa3).
Report is 24 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #56463         +/-   ##
=================================================
- Coverage   73.3958%   56.9180%   -16.4779%     
=================================================
  Files          1628       1753        +125     
  Lines        449554     634330     +184776     
=================================================
+ Hits         329954     361048      +31094     
- Misses        99344     249394     +150050     
- Partials      20256      23888       +3632     
Flag Coverage Δ
integration 37.3189% <77.7777%> (?)
unit 73.2594% <66.6666%> (+0.7411%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9478% <ø> (ø)
parser ∅ <ø> (∅)
br 52.5008% <ø> (+6.9060%) ⬆️

@dveeden
Copy link
Contributor Author

dveeden commented Oct 11, 2024

/retest

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Oct 11, 2024
@dveeden
Copy link
Contributor Author

dveeden commented Oct 11, 2024

/retest

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 12, 2024
Copy link

ti-chi-bot bot commented Oct 12, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-10-11 13:20:24.773985278 +0000 UTC m=+18021.922895111: ☑️ agreed by Defined2014.
  • 2024-10-12 08:58:20.354477799 +0000 UTC m=+88697.503387630: ☑️ agreed by lance6716.

@lance6716
Copy link
Contributor

/assign @windtalker

Copy link

ti-chi-bot bot commented Oct 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, lance6716, XuHuaiyu

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Oct 14, 2024
@dveeden
Copy link
Contributor Author

dveeden commented Oct 14, 2024

/retest

2 similar comments
@dveeden
Copy link
Contributor Author

dveeden commented Oct 14, 2024

/retest

@dveeden
Copy link
Contributor Author

dveeden commented Oct 14, 2024

/retest

@ti-chi-bot ti-chi-bot bot merged commit e017e1b into pingcap:master Oct 14, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved found/gs found by gs lgtm ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
5 participants