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

fix cases 3.1_opensource_release

上级 78f8c06a
......@@ -4387,12 +4387,21 @@ int_type_i opt_int_length_i opt_unsigned_i opt_zerofill_i
| blob_type_i opt_string_length_i_v2
{
malloc_terminal_node($$, result->malloc_pool_, $1[0]);
if (0 == $2[1]) {
$2[0] = 0; /* change default string len from -1 to 0 for compat mysql */
}
$$->int32_values_[0] = $2[0];
$$->int32_values_[1] = 1; /* is binary */
}
| text_type_i opt_string_length_i_v2 opt_binary opt_charset opt_collation
{
malloc_non_terminal_node($$, result->malloc_pool_, $1[0], 3, $4, $5, $3);
if ($1[0] != T_TEXT && $2[0] != -1) {
yyerror(&@2, result, "not support to specify the length in parentheses\n");
YYERROR;
} else if (0 == $2[1]) {
$2[0] = 0; /* change default string len from -1 to 0 for compat mysql */
}
$$->int32_values_[0] = $2[0];
$$->int32_values_[1] = 0; /* is text */
}
......
......@@ -2960,8 +2960,14 @@ int ObDDLResolver::check_text_length(ObCharsetType cs_type, ObCollationType co_t
} else if (0 == mbmaxlen) {
ret = OB_ERR_UNEXPECTED;
SQL_RESV_LOG(ERROR, "mbmaxlen can not be 0", K(ret), K(co_type), K(mbmaxlen));
} else if (length < 0) {
} else if (0 == length) {
length = default_length;
} else if (0 > length) {
ret = OB_ERR_TOO_LONG_COLUMN_LENGTH;
LOG_USER_ERROR(OB_ERR_TOO_LONG_COLUMN_LENGTH, name,
static_cast<int>(ObAccuracy::DDL_DEFAULT_ACCURACY[ObLongTextType].get_length() / mbmaxlen));
SQL_RESV_LOG(WARN, "fail to check column data length",
K(ret), K(length), K(ObAccuracy::DDL_DEFAULT_ACCURACY[ObLongTextType].get_length()), K(mbmaxlen));
} else {
// eg. text(128) will be tinytext in mysql, and text(65537) will be mediumtext
if (ObTextType == type) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册