提交 f9f6066b 编写于 作者: X xf0 提交者: wangzelin.wzl

fix cases master

上级 a8f36227
...@@ -3096,6 +3096,12 @@ void ObStringExprOperator::calc_temporal_format_result_length( ...@@ -3096,6 +3096,12 @@ void ObStringExprOperator::calc_temporal_format_result_length(
type.set_varchar(); type.set_varchar();
type.set_length(MAX_VARCHAR_BUFFER_SIZE); type.set_length(MAX_VARCHAR_BUFFER_SIZE);
} }
if (is_mysql_mode() && ob_is_text_tc(type.get_type())) {
const int32_t mbmaxlen = 4;
const int32_t default_text_length = ObAccuracy::DDL_DEFAULT_ACCURACY[type.get_type()].get_length() / mbmaxlen;
// need to set a correct length for text tc in mysql mode
type.set_length(default_text_length);
}
} }
ObObjType ObStringExprOperator::get_result_type_mysql(int64_t char_length) const ObObjType ObStringExprOperator::get_result_type_mysql(int64_t char_length) const
......
...@@ -2960,7 +2960,7 @@ int ObDDLResolver::check_text_length(ObCharsetType cs_type, ObCollationType co_t ...@@ -2960,7 +2960,7 @@ int ObDDLResolver::check_text_length(ObCharsetType cs_type, ObCollationType co_t
} else if (0 == mbmaxlen) { } else if (0 == mbmaxlen) {
ret = OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
SQL_RESV_LOG(ERROR, "mbmaxlen can not be 0", K(ret), K(co_type), K(mbmaxlen)); SQL_RESV_LOG(ERROR, "mbmaxlen can not be 0", K(ret), K(co_type), K(mbmaxlen));
} else if (0 == length) { } else if (share::is_oracle_mode() || 0 == length) {
length = default_length; length = default_length;
} else if (0 > length) { } else if (0 > length) {
ret = OB_ERR_TOO_LONG_COLUMN_LENGTH; ret = OB_ERR_TOO_LONG_COLUMN_LENGTH;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册