-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ddl: support column type change between decimal && SQL mode warnings #20012
Conversation
b857538
to
596b35e
Compare
Warnings: make(map[errors.ErrorID]*terror.Error), | ||
WarningsCount: make(map[errors.ErrorID]int64), |
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.
How about merge those 2 maps into 1 map?
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.
good idea, how about refine this point in the next PR? (it needs an update in the parser and covers many code)
job.SetWarnings(mergeWarningsAndWarningsCount(partWarnings, job.ReorgMeta.Warnings, partWarningsCount, job.ReorgMeta.WarningsCount)) | ||
w.reorgCtx.mu.Unlock() | ||
|
||
w.reorgCtx.resetWarnings() |
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.
Why we need to reset warnings here?
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.
It's a partial result. After it was merged into the job, the next round DDL will collect new ones.
Signed-off-by: AilinKid <[email protected]>
Signed-off-by: AilinKid <[email protected]>
Signed-off-by: AilinKid <[email protected]>
/run-all-tests |
Signed-off-by: AilinKid <[email protected]>
/run-all-tests |
Signed-off-by: AilinKid <[email protected]>
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.
REST LGTM
Co-authored-by: crazycs <[email protected]>
/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.
LGTM
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.
lgtm
/merge |
/run-all-tests |
@AilinKid merge failed. |
/build |
Signed-off-by: AilinKid [email protected]
What problem does this PR solve?
Issue Number: close #19121
Since #19059 has supported the column type change between integers.
Linked Parser PR pingcap/parser#1031
This PR is to support the column type change between decimal, for example, changing
decimal(5,2)
todecimal(3,1)
.This PR also tries to supply a kind of way to support the normal DDL warnings and strict DDL warnings which will be identified as warnings under non-strict SQL mode, otherwise, will be identified as errors.
What is changed and how it works?
What's Changed:
1: We have added the SQL Mode and warnings field in the parser. For why we don't put this into the job args directly, because the job args sometime will be cleaned at the end of
finishDDLJob
, and be substituted with delete range ids.2: This PR only handled the SQL Mode and limited warning for column type change of decimal. There will be PRs later to complement the next works. For example, pass the SQL mode parameter to all DDL jobs and handle its warnings.
3: This PR only handled the column type between decimal, for more numeric types, such as float and double, more PRs is necessary.
Check List
Tests
Release note