-
Notifications
You must be signed in to change notification settings - Fork 1.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
[BugFix] check time type in DDL (#23473) #23474
Conversation
You need to check the time type when creating tables not in syntax file. |
@@ -2365,7 +2365,6 @@ baseType | |||
| DOUBLE | |||
| DATE | |||
| DATETIME | |||
| TIME | |||
| CHAR typeParameter? |
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.
Now, cast(value as time) is supported. Maybe add check in DDL is better?
mysql> select cast(100 as time);
+-------------------+
| CAST(100 AS TIME) |
+-------------------+
| 00:01:00 |
+-------------------+
1 row in set (0.01 sec)
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.
ok
Problem: Time data type is not support in storage layer, it just a data type of parameter or return value for some function. It can not be specified by user in DDL Solution: check time type in DDL Signed-off-by: srlch <[email protected]>
512c85a
to
0fc7fac
Compare
have fix it |
Kudos, SonarCloud Quality Gate passed! |
fe/fe-core/src/main/java/com/starrocks/sql/analyzer/AlterTableStatementAnalyzer.java
Show resolved
Hide resolved
[FE PR Coverage Check]😍 pass : 4 / 4 (100.00%) file detail
|
@Test | ||
public void testAlterWithTimeType() { | ||
analyzeFail("alter table t0 add column testcol TIME"); | ||
analyzeFail("alter table t0 modify column v0 TIME"); |
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.
Why not add a create table
test case to cover creating table with TIME type.
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.
create table test case have existed in the code. We just miss for DDL
@Mergifyio backport branch-3.0 |
@Mergifyio backport branch-2.5 |
✅ Backports have been created
|
✅ Backports have been created
|
Problem: The time data type is not supported in the storage layer, it is just a data type of parameter or return value for some function. It can not be specified by the user in DDL Solution: check time type in DDL (cherry picked from commit e5b8a48) # Conflicts: # fe/fe-core/src/main/java/com/starrocks/sql/analyzer/AlterTableStatementAnalyzer.java # fe/fe-core/src/test/java/com/starrocks/sql/analyzer/AnalyzeAlterTableStatementTest.java
Problem: The time data type is not supported in the storage layer, it is just a data type of parameter or return value for some function. It can not be specified by the user in DDL Solution: check time type in DDL (cherry picked from commit e5b8a48) # Conflicts: # fe/fe-core/src/main/java/com/starrocks/sql/analyzer/AlterTableStatementAnalyzer.java # fe/fe-core/src/test/java/com/starrocks/sql/analyzer/AnalyzeAlterTableStatementTest.java
Problem: The time data type is not supported in the storage layer, it is just a data type of parameter or return value for some function. It can not be specified by the user in DDL Solution: check time type in DDL Signed-off-by: Moonm3n <[email protected]>
Problem: The time data type is not supported in the storage layer, it is just a data type of parameter or return value for some function. It can not be specified by the user in DDL Solution: check time type in DDL
Problem: The time data type is not supported in the storage layer, it is just a data type of parameter or return value for some function. It can not be specified by the user in DDL Solution: check time type in DDL
Problem: The time data type is not supported in the storage layer, it is just a data type of parameter or return value for some function. It can not be specified by the user in DDL Solution: check time type in DDL
What type of PR is this:
Which issues of this PR fixes:
Fixes #23473
Problem Summary(Required):
Problem:
Time data type is not support in storage layer, it just a data type of parameter or return value for some function.
It can not be specified by user in DDL
Solution:
check time type in DDL
Checklist:
Bugfix cherry-pick branch check: