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)

@dveeden dveeden requested review from xhebox and YangKeao October 7, 2024 20:27
@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!

@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
ti-chi-bot bot pushed a commit to PingCAP-QE/ci that referenced this pull request Oct 28, 2024
Temporary disable failed job merged_integration_common_test due to
pingcap/tidb#56463, enable status reporting
after fixing the test failure issue.
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. labels Oct 29, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #56926.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Oct 29, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #56927.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Oct 29, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #56929.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Oct 29, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot bot pushed a commit that referenced this pull request Nov 11, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Dec 3, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Dec 26, 2024
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 needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. 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
6 participants