-
Notifications
You must be signed in to change notification settings - Fork 409
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
Bootstrap failed because of an invalid default value to the corresponding type #3157
Comments
@JaySon-Huang PTAL |
https://asktug.com/t/topic/182849/11 tiflash log files |
Minimal reproduce steps:
And tidb store "0.00" as the default value of "origin_default" in column "i"
TiFlash store "0.00" as a |
Modifying the default value of the column "i" from "0.00" to "0" does not help recover from this error. It only changes the "default_value" in ColumnInfo, but does not change the "origin_default_value". In order to workaround this error, user can
|
BTW, If we do the same add column in MySQL 5.7, it will store "0" as the default value for int column instead of "0.00"
|
It can be solved by delete and re-create table with correct default value. |
QA and PR think it's a bug. TiF;ash should support such case. @JaySon-Huang Do you have any idea ? |
It is necessary to further investigate how the DDL behaves in the case of some illegal inputs. |
Agree. There is no need for TiDB to support all ridiculous behaviours. |
@JaySon-Huang maybe we should resolve "0.0" as "0" in tidb just like mysql rather than pass "0.0" to tiflash and handle it in tiflash? |
This is one of the solutions. But it does not resolve the problem totally. Consider that the user created a table with that invalid default value in the old version(5.4 for example), and we fix that in a newer version (TiDB 6.2 for example). After user upgraded from 5.4 to 6.2 and deploy TiFlash node, they still meet this error. |
case TypeInt24:
{
try {
return value.convert<Int64>();
} catch (...) {
return static_cast<Int64>(std::stoull(value.convert<String>()));
}
}
@JaySon-Huang Do you think it is acceptable? or any suggestions? |
@Lloyd-Pottiger LGTM |
TiFlash build info: TiFlash\nRelease Version: v5.1.1\nEdition: Community\nGit Commit Hash: c8fabfb\nGit Branch: heads/refs/tags/v5.1.1\nUTC Build Time: 2021-07-28 11:18:00\nProfile: RELWITHDEBINFO
The text was updated successfully, but these errors were encountered: