-
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
CREATE TABLE with TTL does not check the TTL 'expression' for composite time units #51789
Comments
Seems MySQL allows arbitrary string without reporting any error or warning:
I will update the severity of this issue to |
This seems to be a regression. |
The behavior in tidb v5.4.0 seems to be as expected. Here is the result from mysql v8.3.0. mysql> create table t (a int, b timestamp) ttl = b + interval "one + two" minute_second; |
/type regression |
Regression Analysis |
/label affects-8.1 |
It's not a regression because the first version that support TTL is |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
So I think both the issue needs to be fixed, i.e. check TTL 'expression' when create/alter table,
and changing the manual, from 'Expression' to 'Time string' or similar.
2. What did you expect to see? (Required)
Failure, saying that "one + two" is not a minute_second expression.
The parser says it only accepts a literal,
while the documentation says Expression: TTL EqOpt TimeColumnName + INTERVAL Expression TimeUnit
3. What did you see instead (Required)
Table created without even a warning:
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: