-
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
ddl: check allocator's existence before allocate/rebase #18932
Conversation
Codecov Report
@@ Coverage Diff @@
## master #18932 +/- ##
===========================================
Coverage 79.4424% 79.4424%
===========================================
Files 547 547
Lines 149551 149551
===========================================
Hits 118807 118807
Misses 21252 21252
Partials 9492 9492 |
} | ||
} else { | ||
if err = tb.RebaseAutoID(nil, tbInfo.AutoRandID-1, false, tp); err != nil { | ||
if alloc := allocs.Get(tp); alloc != nil { |
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.
So the manual rebase will be just ignored when alloc==nil
?
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.
Yes. This is consistent with MySQL.
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.
REST 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 |
What problem does this PR solve?
Issue Number: close #18931
Problem Summary:
After #18326,
rowid
allocator is not necessarily existed in every table. Before allocate/rebase values, a nil check for allocators is missed.What is changed and how it works?
What's Changed and how it works: add a nil check for allocators before using them.
Related changes
Check List
Tests
Side effects: N/A
Release note