tidb icon indicating copy to clipboard operation
tidb copied to clipboard

executor,infoschema: Change column type on information_schema.CLUSTER_INFO

Open dveeden opened this issue 3 years ago • 9 comments

What problem does this PR solve?

The START_TIME column of information_schema.CLUSTER_INFO was a VARCHAR with values like 2021-11-15T07:32:19+01:00. This changes the column to be a MySQL datetime format.

What is changed and how it works?

Check List

Tests

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

Side effects

  • [ ] Performance regression: Consumes more CPU
  • [ ] Performance regression: Consumes more Memory
  • [x] Breaking backward compatibility

Documentation

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

Release note

The type of the `START_TIME` column of the `CLUSTER_INFO` table in the `information_schema` was changed from a `VARCHAR` to `DATETIME`.

dveeden avatar Nov 15 '21 06:11 dveeden

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • morgo

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 avatar Nov 15 '21 06:11 ti-chi-bot

/cc @yzwqf @crazycs520

dveeden avatar Dec 10 '21 14:12 dveeden

@dveeden: GitHub didn't allow me to request PR reviews from the following users: yzwqf.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @yzwqf @crazycs520

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 avatar Dec 10 '21 14:12 ti-chi-bot

/cc @morgo

dveeden avatar Dec 10 '21 14:12 dveeden

Is it ok to remove the suffix +08:00?

I think it is. Do you see any problem with that?

dveeden avatar Dec 17 '21 06:12 dveeden

Is it ok to remove the suffix +08:00?

I think it is. Do you see any problem with that?

I'm not sure, maybe we should request other people to review it.

wjhuang2016 avatar Dec 18 '21 08:12 wjhuang2016

@wjhuang2016 Any suggestions for additional reviewers?

dveeden avatar Dec 20 '21 07:12 dveeden

[FORMAT CHECKER NOTIFICATION]

Notice: To remove the do-not-merge/needs-linked-issue label, please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456.

:open_book: For more info, you can check the "Contribute Code" section in the development guide.

ti-chi-bot avatar Aug 08 '22 10:08 ti-chi-bot

Is it possible to create a test case for this PR?

done

dveeden avatar Aug 08 '22 10:08 dveeden

Without this PR:

mysql> SELECT START_TIME+1 FROM information_schema.CLUSTER_INFO;
+--------------+
| START_TIME+1 |
+--------------+
|         2024 |
|            1 |
+--------------+
2 rows in set, 1 warning (0.00 sec)

mysql> SHOW WARNINGS;
+---------+------+---------------------------------------------------------------+
| Level   | Code | Message                                                       |
+---------+------+---------------------------------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: '2023-07-06T13:52:40+02:00' |
+---------+------+---------------------------------------------------------------+
1 row in set (0.00 sec)

dveeden avatar Jul 06 '23 11:07 dveeden

$ mysql --comments --host 127.0.0.1 --port 4000 -u root --column-type-info 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.25-TiDB-v7.3.0-alpha-137-g8c71149116 TiDB Server (Apache License 2.0) Community Edition, MySQL 8.0 compatible

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT START_TIME FROM information_schema.CLUSTER_INFO;
Field   1:  `START_TIME`
Catalog:    `def`
Database:   `information_schema`
Table:      `CLUSTER_INFO`
Org_table:  `CLUSTER_INFO`
Type:       DATETIME
Collation:  binary (63)
Length:     19
Max_length: 19
Decimals:   0
Flags:      


+---------------------+
| START_TIME          |
+---------------------+
| 2023-07-06 14:58:14 |
| 0000-00-00 00:00:00 |
+---------------------+
2 rows in set (0.00 sec)

dveeden avatar Jul 06 '23 13:07 dveeden

With TiKV:

mysql> SELECT TIMESTAMPDIFF(SECOND, START_TIME, CURRENT_TIMESTAMP) FROM information_schema.CLUSTER_INFO;
+------------------------------------------------------+
| TIMESTAMPDIFF(SECOND, START_TIME, CURRENT_TIMESTAMP) |
+------------------------------------------------------+
|                                                   14 |
|                                                   25 |
|                                                   24 |
+------------------------------------------------------+
3 rows in set (0.00 sec)

With unistore there is a zero datetime in there, which causes some problems.

Update: This is fixed

dveeden avatar Jul 06 '23 13:07 dveeden

/retest

dveeden avatar Jul 06 '23 13:07 dveeden

@dveeden: 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/test-infra repository.

tiprow[bot] avatar Jul 06 '23 13:07 tiprow[bot]

/ok-to-test

dveeden avatar Jul 06 '23 13:07 dveeden

And pls fixed TestTiDBClusterInfo test case

Defined2014 avatar Jul 07 '23 03:07 Defined2014

And pls fixed TestTiDBClusterInfo test case

Done

dveeden avatar Jul 07 '23 06:07 dveeden

/test mysql-test

dveeden avatar Jul 07 '23 06:07 dveeden

@dveeden: The specified target(s) for /test were not found. The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test mysql-test

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.

tiprow[bot] avatar Jul 07 '23 06:07 tiprow[bot]

/retest

dveeden avatar Jul 07 '23 07:07 dveeden

Codecov Report

Merging #29771 (ddbe621) into master (3d176fc) will increase coverage by 1.5331%. Report is 11 commits behind head on master. The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #29771        +/-   ##
================================================
+ Coverage   71.1018%   72.6349%   +1.5330%     
================================================
  Files          1365       1389        +24     
  Lines        404348     414551     +10203     
================================================
+ Hits         287499     301109     +13610     
+ Misses        96883      94539      -2344     
+ Partials      19966      18903      -1063     
Flag Coverage Δ
integration 43.9944% <0.0000%> (?)
unit 71.1115% <100.0000%> (+0.0096%) :arrow_up:

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

Components Coverage Δ
dumpling 53.9874% <ø> (ø)
parser ∅ <ø> (∅)
br 48.3831% <ø> (-4.7056%) :arrow_down:

codecov[bot] avatar Nov 17 '23 10:11 codecov[bot]

/retest

dveeden avatar Nov 17 '23 13:11 dveeden

/test unit-test

dveeden avatar Nov 17 '23 13:11 dveeden

@dveeden: The specified target(s) for /test were not found. The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test unit-test

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.

tiprow[bot] avatar Nov 17 '23 13:11 tiprow[bot]

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: crazycs520, morgo, wjhuang2016

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[bot] avatar Nov 22 '23 07:11 ti-chi-bot[bot]

[LGTM Timeline notifier]

Timeline:

  • 2023-11-17 12:44:38.981266244 +0000 UTC m=+4425876.568376391: :ballot_box_with_check: agreed by wjhuang2016.
  • 2023-11-22 07:48:01.896411016 +0000 UTC m=+390510.561637208: :ballot_box_with_check: agreed by crazycs520.

ti-chi-bot[bot] avatar Nov 22 '23 07:11 ti-chi-bot[bot]

@dveeden: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-br-integration-test 54d5206f6c5b94d1b109f24d9c1bc6b45f1bc4ef link true /test pull-br-integration-test
idc-jenkins-ci-tidb/unit-test ddbe621fc3c5f4117ac367bdb832657ddafc5743 link unknown /test unit-test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

ti-chi-bot[bot] avatar Nov 22 '23 08:11 ti-chi-bot[bot]

/retest

dveeden avatar Nov 22 '23 09:11 dveeden