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

UTC_TIMESTAMP(7) gives different error code and message from MySQL #56451

Closed
mjonss opened this issue Oct 4, 2024 · 3 comments · Fixed by #56453
Closed

UTC_TIMESTAMP(7) gives different error code and message from MySQL #56451

mjonss opened this issue Oct 4, 2024 · 3 comments · Fixed by #56453
Assignees
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. severity/minor sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@mjonss
Copy link
Contributor

mjonss commented Oct 4, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

SELECT UTC_TIMESTAMP(7);

2. What did you expect to see? (Required)

MySQL 8.0.32:

mysql> SELECT UTC_TIMESTAMP(7);
ERROR 1426 (42000): Too-big precision 7 specified for 'utc_timestamp'. Maximum is 6.

3. What did you see instead (Required)

TiDB:

tidb> SELECT UTC_TIMESTAMP(7);
ERROR 1105 (HY000): Too-big precision 7 specified for 'curtime'. Maximum is 6

Which means that:

  • error code is different
  • sqlstate is different
  • function name is not correct.

4. What is your TiDB version? (Required)

tidb_version(): Release Version: v8.3.0
Edition: Community
Git Commit Hash: 1a0c3ac3292fff7742faa0c00a662ccb66ba40db
Git Branch: HEAD
UTC Build Time: 2024-08-20 10:23:00
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv
@mjonss mjonss added type/bug The issue is confirmed as a bug. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Oct 4, 2024
@chagelo
Copy link
Contributor

chagelo commented Oct 5, 2024

/assign

@chagelo
Copy link
Contributor

chagelo commented Oct 5, 2024

Hello, I made some fix, there are some my questions.

  1. Are there any formats for naming a PR?
  2. What should I do before push the change to the repo? (like run make ut to test, but it seems to hanging in my laptop)

@mjonss
Copy link
Contributor Author

mjonss commented Oct 5, 2024

Hello, I made some fix, there are some my questions.

  1. Are there any formats for naming a PR?
  2. What should I do before push the change to the repo? (like run make ut to test, but it seems to hanging)

Hi @chagelo and thank you for contributing!

The format should be "<subsystem or *>: What changed", where subsystem is normally what comes after the pkg directory, see more in:
https://github.com/pingcap/community/blob/master/contributors/commit-message-pr-style.md
or just see other PRs or git log for inspiration.

make ut will run all unit tests as well as make ; cd tests/integrationtest ; ./run-tests.sh -s ../../bin/tidb-server which will run the integration tests.
If you added a unit test or changed any import, then make bazel_prepare which will update the BUILD.bazel files if needed.
But the CI will run all of them after you create the PR.

There might be some good tips in the following links as well:
https://pingcap.github.io/tidb-dev-guide/index.html
https://github.com/pingcap/community/blob/master/contributors/README.md

chagelo added a commit to chagelo/tidb that referenced this issue Oct 5, 2024
chagelo added a commit to chagelo/tidb that referenced this issue Oct 5, 2024
@mjonss mjonss added severity/minor sig/sql-infra SIG: SQL Infra affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. labels Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. severity/minor sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants