diff --git a/src/objit/include/objit/common/ob_item_type.h b/src/objit/include/objit/common/ob_item_type.h index c232d546d1..0effadb399 100755 --- a/src/objit/include/objit/common/ob_item_type.h +++ b/src/objit/include/objit/common/ob_item_type.h @@ -819,7 +819,7 @@ typedef enum ObItemType T_FUN_SYS_RANDOM = 1806, T_FUN_SYS_RANDSTR = 1807, T_FUN_SYS_END = 2000, - T_ALIGN_DATE4CMP = 2010, + T_FUN_SYS_ALIGN_DATE4CMP = 2010, T_MAX_OP = 3000, diff --git a/src/sql/engine/expr/ob_expr_align_date4cmp.cpp b/src/sql/engine/expr/ob_expr_align_date4cmp.cpp index 7e81c7923c..20a1a61f46 100644 --- a/src/sql/engine/expr/ob_expr_align_date4cmp.cpp +++ b/src/sql/engine/expr/ob_expr_align_date4cmp.cpp @@ -32,7 +32,7 @@ static const int8_t DAYS_OF_MON[2][12 + 1] = { #define IS_LEAP_YEAR(y) ((((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) ? 1 : 0) ObExprAlignDate4Cmp::ObExprAlignDate4Cmp(common::ObIAllocator &alloc) - : ObFuncExprOperator(alloc, T_ALIGN_DATE4CMP, N_ALIGN_DATE4CMP, 3, VALID_FOR_GENERATED_COL, NOT_ROW_DIMENSION) + : ObFuncExprOperator(alloc, T_FUN_SYS_ALIGN_DATE4CMP, N_ALIGN_DATE4CMP, 3, VALID_FOR_GENERATED_COL, NOT_ROW_DIMENSION) { } diff --git a/src/sql/resolver/expr/ob_raw_expr_printer.cpp b/src/sql/resolver/expr/ob_raw_expr_printer.cpp index 124b6dca5f..0b20fd0e02 100644 --- a/src/sql/resolver/expr/ob_raw_expr_printer.cpp +++ b/src/sql/resolver/expr/ob_raw_expr_printer.cpp @@ -2545,6 +2545,11 @@ int ObRawExprPrinter::print(ObSysFunRawExpr *expr) ObString func_name = expr->get_func_name(); ObExprOperatorType expr_type = expr->get_expr_type(); switch (expr_type) { + case T_FUN_SYS_ALIGN_DATE4CMP: { + CK(3 == expr->get_param_count()); + PRINT_EXPR(expr->get_param_expr(0)); + break; + } case T_FUN_SYS_UTC_TIMESTAMP: case T_FUN_SYS_UTC_TIME: { const int16_t scale = static_cast(expr->get_result_type().get_scale()); diff --git a/src/sql/rewrite/ob_transform_pre_process.cpp b/src/sql/rewrite/ob_transform_pre_process.cpp index 7f5bd09c97..bfd183a72a 100644 --- a/src/sql/rewrite/ob_transform_pre_process.cpp +++ b/src/sql/rewrite/ob_transform_pre_process.cpp @@ -5850,7 +5850,7 @@ int ObTransformPreProcess::replace_cast_expr_align_date4cmp(ObRawExprFactory &ex } else if (ObExprAlignDate4Cmp::is_align_date4cmp_support_obj_type(cast_child->get_data_type())) { // create a new align_date4cmp_expr to replace const_expr ObSysFunRawExpr *align_date4cmp_expr = NULL; - if (OB_FAIL(expr_factory.create_raw_expr(T_ALIGN_DATE4CMP, align_date4cmp_expr))) { + if (OB_FAIL(expr_factory.create_raw_expr(T_FUN_SYS_ALIGN_DATE4CMP, align_date4cmp_expr))) { LOG_WARN("create align_date4cmp_expr fail.", K(ret), K(align_date4cmp_expr)); } else if (OB_ISNULL(align_date4cmp_expr)) { ret = OB_ERR_UNEXPECTED;