-
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
Hit ERROR 1467 when insert into the max unsigned bigint values(18446744073709551615) with tidb_enable_clustered_index=off #58631
Comments
Even insert 1 result in the same error, there must be something wrong |
/assign @tiancaiamao |
No, this is not the same issue @bb7133 tidb/pkg/meta/autoid/autoid.go Lines 978 to 980 in b71ad38
It says when the alloc.base is 18446744073709551615 already, alloc.base + 1 > math.MaxUint64 , this would cause overflow, so the error is thrown There must be something wrong, the maxinum value we can insert successfully is 18446744073709551613, this behavior is not expected. |
This is not the default setting, and it's unlikely for 18446744073709551615 to appear in a real use case, so I set the severity to minor. |
I found it's difficult to support 18446744073709551615 using current representation. How to represent the next allocation? let 18446744073709551615 overflow is risky, that's the biggest value for the range already. |
OK, after taking a second look, @bb7133 is correct. When we don't seperate auto id and row id, each time allocating a new record consumes two ids.
When we insert 123, the id is 123 and row id is 124 ...
Here the -1 is indeed 18446744073709551615 If we want to insert into t values(18446744073709551614 );
And as you can see, _tidb_rowid = 18446744073709551616 overflows, so it should fail. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
v8.5.0
The text was updated successfully, but these errors were encountered: