From 04e58bc531bd401b0000463b2e930b7f1a37b7d1 Mon Sep 17 00:00:00 2001 From: TsukiokaKogane Date: Wed, 4 Dec 2024 15:00:24 +0800 Subject: [PATCH] [fix](ctas) fix wrong resultType of column typeDef (#43828) wrong resultType could lead to definition change of `Type.VARCHAR` --- .../main/java/org/apache/doris/datasource/InternalCatalog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java index 64a759b9747044..65f77fd039137d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java @@ -1416,7 +1416,7 @@ public void createTableAsSelect(CreateTableAsSelectStmt stmt) throws DdlExceptio // we change it to tinyint nullable. typeDef = TypeDef.create(PrimitiveType.TINYINT); } else { - typeDef = new TypeDef(resultExpr.getType()); + typeDef = new TypeDef(resultType); } if (i == 0) { // If this is the first column, because olap table does not support the first column to be