-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
WIP:types: fix isDateFormat function bugs #27575
Conversation
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The returning type is wrong.
TiDB:
mysql> select DATE_ADD(a, INTERVAL 1 day ) from t ;
Field 1: `DATE_ADD(a, INTERVAL 1 day )`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DATETIME
Collation: binary (63)
Length: 29
Max_length: 19
Decimals: 31
Flags: NOT_NULL BINARY
+------------------------------+
| DATE_ADD(a, INTERVAL 1 day ) |
+------------------------------+
| 2020-12-10 00:00:00 |
+------------------------------+
1 row in set (0.00 sec)
MySQL:
mysql> select DATE_ADD(a, INTERVAL 1 day ) from t ;
Field 1: `DATE_ADD(a, INTERVAL 1 day )`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: STRING
Collation: utf8mb4_0900_ai_ci (255)
Length: 116
Max_length: 10
Decimals: 31
Flags:
+------------------------------+
| DATE_ADD(a, INTERVAL 1 day ) |
+------------------------------+
| 2020-12-10 |
+------------------------------+
1 row in set (0.01 sec)
…nto dev/fixIsDateFormatBug
…into dev/fixIsDateFormatBug
/run-check_dev_2 |
/run-check_dev_2 |
3 similar comments
/run-check_dev_2 |
/run-check_dev_2 |
/run-check_dev_2 |
What problem does this PR solve?
Issue Number: close #27573
Problem Summary:
fix the bug that a string like "20129" will not be judged as date type
change date_add and date_sub string_(int/string/real/decimal) function return type to string
What is changed and how it works?
Proposal: xxx
What's Changed:
time.go
expression/builtin_time.go
expression/builtin_time_test.go
expression/builtin_time_vec_generated.go
types/time_test.go
cmd/explaintest/r/tpch.result
How it Works:
if the length of a string with no separator is 5, it will be date type
if use date_add or date_sub string_(int/string/real/decimal) function will return string type
Check List
Tests
Release note