fix cases 3.1_opensource_release
This commit is contained in:
parent
78f8c06a35
commit
358b847936
@ -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 */
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user