-
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
executor, session: refine insert unsigned bigint autoIncreID #8181
Merged
Merged
Changes from 14 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
a7df24d
executor, session: refine insert unsigned bigint autoIncreID
XuHuaiyu 9d21807
address comment
XuHuaiyu 2db694e
update parser
XuHuaiyu 1eb9325
Merge branch 'master' of https://github.com/pingcap/tidb into unsigne…
XuHuaiyu 53fd0a6
address comment
XuHuaiyu 758fd31
address comment
XuHuaiyu a68a08d
make golint happy
XuHuaiyu c1e1ff6
address commen
XuHuaiyu 9104f74
Merge branch 'master' of https://github.com/pingcap/tidb into unsigne…
XuHuaiyu fc03231
Merge branch 'master' of https://github.com/pingcap/tidb into unsigne…
XuHuaiyu 82b12d5
address comment
XuHuaiyu 2e8b425
remove go.sum
XuHuaiyu ce0e447
merge master
XuHuaiyu 874ff0b
address comment
XuHuaiyu d0616ac
Merge branch 'master' into unsigned_autoid
jackysp 6792306
add unit tests for Allocator
XuHuaiyu 46d20a4
Merge branch 'master' of https://github.com/pingcap/tidb into unsigne…
XuHuaiyu 548ea41
Merge branch 'unsigned_autoid' of https://github.com/XuHuaiyu/tidb in…
XuHuaiyu 61bfec6
update go.mod
XuHuaiyu 6c4419c
address comment
XuHuaiyu 3f1fcb4
make tidy
XuHuaiyu 71ea318
go mod tidy
XuHuaiyu 18c62fe
Merge branch 'master' into unsigned_autoid
XuHuaiyu d688346
Merge branch 'master' into unsigned_autoid
XuHuaiyu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ func (*testSuite) TestT(c *C) { | |
}) | ||
c.Assert(err, IsNil) | ||
|
||
alloc := autoid.NewAllocator(store, 1) | ||
alloc := autoid.NewAllocator(store, 1, false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add some tests for |
||
c.Assert(alloc, NotNil) | ||
|
||
globalAutoId, err := alloc.NextGlobalAutoID(1) | ||
|
@@ -97,25 +97,25 @@ func (*testSuite) TestT(c *C) { | |
c.Assert(err, IsNil) | ||
c.Assert(id, Equals, int64(3011)) | ||
|
||
alloc = autoid.NewAllocator(store, 1) | ||
alloc = autoid.NewAllocator(store, 1, false) | ||
c.Assert(alloc, NotNil) | ||
id, err = alloc.Alloc(1) | ||
c.Assert(err, IsNil) | ||
c.Assert(id, Equals, int64(autoid.GetStep()+1)) | ||
|
||
alloc = autoid.NewAllocator(store, 1) | ||
alloc = autoid.NewAllocator(store, 1, false) | ||
c.Assert(alloc, NotNil) | ||
err = alloc.Rebase(2, int64(1), false) | ||
c.Assert(err, IsNil) | ||
id, err = alloc.Alloc(2) | ||
c.Assert(err, IsNil) | ||
c.Assert(id, Equals, int64(2)) | ||
|
||
alloc = autoid.NewAllocator(store, 1) | ||
alloc = autoid.NewAllocator(store, 1, false) | ||
c.Assert(alloc, NotNil) | ||
err = alloc.Rebase(3, int64(3210), false) | ||
c.Assert(err, IsNil) | ||
alloc = autoid.NewAllocator(store, 1) | ||
alloc = autoid.NewAllocator(store, 1, false) | ||
c.Assert(alloc, NotNil) | ||
err = alloc.Rebase(3, int64(3000), false) | ||
c.Assert(err, IsNil) | ||
|
@@ -159,7 +159,7 @@ func (*testSuite) TestConcurrentAlloc(c *C) { | |
errCh := make(chan error, count) | ||
|
||
allocIDs := func() { | ||
alloc := autoid.NewAllocator(store, dbID) | ||
alloc := autoid.NewAllocator(store, dbID, false) | ||
for j := 0; j < int(autoid.GetStep())+5; j++ { | ||
id, err1 := alloc.Alloc(tblID) | ||
if err1 != nil { | ||
|
@@ -213,7 +213,7 @@ func (*testSuite) TestRollbackAlloc(c *C) { | |
injectConf := new(kv.InjectionConfig) | ||
injectConf.SetCommitError(errors.New("injected")) | ||
injectedStore := kv.NewInjectedStore(store, injectConf) | ||
alloc := autoid.NewAllocator(injectedStore, 1) | ||
alloc := autoid.NewAllocator(injectedStore, 1, false) | ||
_, err = alloc.Alloc(2) | ||
c.Assert(err, NotNil) | ||
c.Assert(alloc.Base(), Equals, int64(0)) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could we remove "uint64"?