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: change date add function return type #28133

Merged

Conversation

mengxin9014
Copy link
Contributor

@mengxin9014 mengxin9014 commented Sep 17, 2021

What problem does this PR solve?

Issue Number: close #27573, close #36394

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?

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

  • Unit test

Release note

change date_add and date_sub string_(int/string/real/decimal) function return type to string.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 17, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • windtalker
  • wjhuang2016

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 ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 17, 2021
@mengxin9014
Copy link
Contributor Author

/run-check_dev_2

@ti-chi-bot ti-chi-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 17, 2021
@mengxin9014 mengxin9014 marked this pull request as draft September 17, 2021 07:03
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 17, 2021
@mengxin9014 mengxin9014 marked this pull request as ready for review September 17, 2021 07:08
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 17, 2021
@mengxin9014
Copy link
Contributor Author

/cc wjhuang2016

@mengxin9014
Copy link
Contributor Author

I change branch name to mx/changeDateAddFunctionReturnType, the original pr has closed(#27575)

@mengxin9014
Copy link
Contributor Author

/cc windtalker

Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a compatibility-breaker, I'm talking with PMs to decide what we should do.

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 30, 2021
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 16, 2021
@mengxin9014
Copy link
Contributor Author

/run-unit-test

@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2021

@mengxin9014 mengxin9014 marked this pull request as draft December 17, 2021 06:23
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 17, 2021
@mengxin9014 mengxin9014 marked this pull request as ready for review December 20, 2021 06:47
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 20, 2021
@mengxin9014
Copy link
Contributor Author

/run-check_dev_2

5 similar comments
@mengxin9014
Copy link
Contributor Author

/run-check_dev_2

@mengxin9014
Copy link
Contributor Author

/run-check_dev_2

@mengxin9014
Copy link
Contributor Author

/run-check_dev_2

@mengxin9014
Copy link
Contributor Author

/run-check_dev_2

@mengxin9014
Copy link
Contributor Author

/run-check_dev_2

@mengxin9014
Copy link
Contributor Author

/run-check_dev_2

@mengxin9014
Copy link
Contributor Author

/run-unit-test

@mengxin9014
Copy link
Contributor Author

/run-mysql-test

@mengxin9014
Copy link
Contributor Author

/run-unit-test

@mengxin9014
Copy link
Contributor Author

/run-unit-test

@mengxin9014
Copy link
Contributor Author

/run-check_dev_2

@mengxin9014
Copy link
Contributor Author

/run-unit-test

@wjhuang2016 wjhuang2016 added the needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. label Dec 31, 2021
@mengxin9014
Copy link
Contributor Author

/run-unit-test

1 similar comment
@mengxin9014
Copy link
Contributor Author

/run-unit-test

@mengxin9014
Copy link
Contributor Author

/run-unit-test

@ti-chi-bot ti-chi-bot merged commit 5ea64e6 into pingcap:master Dec 31, 2021
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Dec 31, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-5.4 in PR #31239

rebelice pushed a commit to TiInterstellar/tidb that referenced this pull request Jan 5, 2022
* topsql: make topsql enable only be controlled by pub/sub sink (pingcap#31209)

* ddl: support batch create table  (pingcap#28763)

* executor: fix data race in IndexMergeReaderExec (pingcap#31230)

close pingcap#31229

* server: filter the EOF error for normal closed at handshake  (pingcap#31081)

close pingcap#31063

* expression: change date add function return type (pingcap#28133)

close pingcap#27573

* support create interval partition

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* support create interval partition (support int/timestamp partition key)

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* parser: support alter table partitions move engine statement

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* support ddl operation

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* support interval partition manager

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* support interval partition manager handle job framwork

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* support auto create interval partition when insert meet no partition suitable error

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* fix bug

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* fix cancel job and load old job then continue to do

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* make partition readonly work(not allow to insert/update/delete)

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* add begin,end time in tables

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* tiny fix for auto create interval partition in concurrent case

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* init

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* init

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* todo: remove flag

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* fix dumpling

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* remove data in aws s3 when drop/truncate table/partition

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* make hello world work

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* remove debug info

Signed-off-by: crazycs520 <crazycs520@gmail.com>

Co-authored-by: xhe <xw897002528@gmail.com>
Co-authored-by: guo-shaoge <shaoge1994@163.com>
Co-authored-by: knull-cn <hu__haifeng@163.com>
Co-authored-by: Meng Xin <tregoldmeng@gmail.com>
@Defined2014 Defined2014 added the needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 label Nov 4, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #38889.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Nov 4, 2022
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function adddate() returns unexpected when connect with jdbc driver dateAdd function bug
8 participants