diff --git a/src/share/ob_errno.h b/src/share/ob_errno.h index 15c2b21c4077f147a37fd68ec483c92b0b81b88d..12bb64665ad8c17d8759b415e14209af01b6265f 100644 --- a/src/share/ob_errno.h +++ b/src/share/ob_errno.h @@ -2700,7 +2700,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_ERR_FLASHBACK_QUERY_WITH_UPDATE__USER_ERROR_MSG "snapshot expression not allowed here" #define OB_ERR_UPDATE_ON_EXPR__USER_ERROR_MSG "Columns referenced in the ON Clause cannot be updated:'%.*s'.'%.*s'" #define OB_ERR_SPECIFIED_ROW_NO_LONGER_EXISTS__USER_ERROR_MSG "specified row no longer exists" -#define OB_ERR_DATA_TOO_LONG_MSG_FMT_V2__USER_ERROR_MSG "Data too long for column '%.*s' at row %ld" +#define OB_ERR_DATA_TOO_LONG_MSG_FMT_V2__USER_ERROR_MSG "value too large for column %.*s (actual: %ld, maximum: %ld)" #define OB_ERR_INVALID_DATE_MSG_FMT_V2__USER_ERROR_MSG "Incorrect datetime value for column '%.*s' at row %ld" diff --git a/src/sql/engine/expr/ob_expr_column_conv.cpp b/src/sql/engine/expr/ob_expr_column_conv.cpp index 5fa4ec34fe4af03ad45b17f70c7a300e7c6f08c6..f347e827324752a3c4805b277303d3bd1165f964 100644 --- a/src/sql/engine/expr/ob_expr_column_conv.cpp +++ b/src/sql/engine/expr/ob_expr_column_conv.cpp @@ -352,15 +352,14 @@ int ObExprColumnConv::column_convert(const ObExpr& expr, ObEvalCtx& ctx, ObDatum const int64_t str_len_byte = static_cast(val->len_); if (OB_FAIL(datum_accuracy_check(expr, cast_mode, ctx, *val, datum, warning))) { LOG_WARN("fail to check accuracy", K(ret), K(datum), K(expr), K(warning)); - // compatible with old code - if (OB_ERR_DATA_TOO_LONG == ret && lib::is_oracle_mode() && PARAMS_COUNT_WITH_COLUMN_INFO == expr.arg_cnt_) { + if (OB_ERR_DATA_TOO_LONG == ret && PARAMS_COUNT_WITH_COLUMN_INFO == expr.arg_cnt_) { ObString column_info_str; ObDatum* column_info = NULL; if (OB_FAIL(expr.args_[5]->eval(ctx, column_info))) { LOG_WARN("evaluate parameter failed", K(ret)); } else { column_info_str = column_info->get_string(); - LOG_ORACLE_USER_ERROR(OB_ERR_DATA_TOO_LONG_MSG_FMT_V2, + LOG_USER_ERROR(OB_ERR_DATA_TOO_LONG_MSG_FMT_V2, column_info_str.length(), column_info_str.ptr(), str_len_byte,