Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
知世而放
oceanbase
提交
ea5bd71d
O
oceanbase
项目概览
知世而放
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ea5bd71d
编写于
12月 20, 2021
作者:
Y
yb0
提交者:
LINGuanRen
12月 20, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix check text column bug during ctas
上级
9802ffae
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
14 deletion
+13
-14
src/sql/resolver/ddl/ob_create_table_resolver.cpp
src/sql/resolver/ddl/ob_create_table_resolver.cpp
+2
-2
src/sql/resolver/ddl/ob_ddl_resolver.cpp
src/sql/resolver/ddl/ob_ddl_resolver.cpp
+7
-4
src/sql/resolver/ddl/ob_ddl_resolver.h
src/sql/resolver/ddl/ob_ddl_resolver.h
+4
-8
未找到文件。
src/sql/resolver/ddl/ob_create_table_resolver.cpp
浏览文件 @
ea5bd71d
...
@@ -1583,7 +1583,7 @@ int ObCreateTableResolver::resolve_table_elements_from_select(const ParseNode& p
...
@@ -1583,7 +1583,7 @@ int ObCreateTableResolver::resolve_table_elements_from_select(const ParseNode& p
}
else
if
(
is_oracle_mode
()
&&
create_table_column_count
>
0
)
{
}
else
if
(
is_oracle_mode
()
&&
create_table_column_count
>
0
)
{
if
(
column
.
is_string_type
())
{
if
(
column
.
is_string_type
())
{
if
(
column
.
get_meta_type
().
is_lob
())
{
if
(
column
.
get_meta_type
().
is_lob
())
{
if
(
OB_FAIL
(
check_text_column_length_and_promote
(
column
,
table_id_
)))
{
if
(
OB_FAIL
(
check_text_column_length_and_promote
(
column
,
table_id_
,
true
)))
{
LOG_WARN
(
"fail to check text or blob column length"
,
K
(
ret
),
K
(
column
));
LOG_WARN
(
"fail to check text or blob column length"
,
K
(
ret
),
K
(
column
));
}
}
}
else
if
(
OB_FAIL
(
check_string_column_length
(
column
,
share
::
is_oracle_mode
())))
{
}
else
if
(
OB_FAIL
(
check_string_column_length
(
column
,
share
::
is_oracle_mode
())))
{
...
@@ -1626,7 +1626,7 @@ int ObCreateTableResolver::resolve_table_elements_from_select(const ParseNode& p
...
@@ -1626,7 +1626,7 @@ int ObCreateTableResolver::resolve_table_elements_from_select(const ParseNode& p
}
else
{
}
else
{
if
(
column
.
is_string_type
())
{
if
(
column
.
is_string_type
())
{
if
(
column
.
get_meta_type
().
is_lob
())
{
if
(
column
.
get_meta_type
().
is_lob
())
{
if
(
OB_FAIL
(
check_text_column_length_and_promote
(
column
,
table_id_
)))
{
if
(
OB_FAIL
(
check_text_column_length_and_promote
(
column
,
table_id_
,
true
)))
{
LOG_WARN
(
"fail to check text or blob column length"
,
K
(
ret
),
K
(
column
));
LOG_WARN
(
"fail to check text or blob column length"
,
K
(
ret
),
K
(
column
));
}
}
}
else
if
(
OB_FAIL
(
check_string_column_length
(
column
,
share
::
is_oracle_mode
())))
{
}
else
if
(
OB_FAIL
(
check_string_column_length
(
column
,
share
::
is_oracle_mode
())))
{
...
...
src/sql/resolver/ddl/ob_ddl_resolver.cpp
浏览文件 @
ea5bd71d
...
@@ -2946,7 +2946,7 @@ int ObDDLResolver::check_urowid_column_length(const share::schema::ObColumnSchem
...
@@ -2946,7 +2946,7 @@ int ObDDLResolver::check_urowid_column_length(const share::schema::ObColumnSchem
}
}
int
ObDDLResolver
::
check_text_length
(
ObCharsetType
cs_type
,
ObCollationType
co_type
,
const
char
*
name
,
ObObjType
&
type
,
int
ObDDLResolver
::
check_text_length
(
ObCharsetType
cs_type
,
ObCollationType
co_type
,
const
char
*
name
,
ObObjType
&
type
,
int32_t
&
length
,
bool
need_rewrite_length
)
int32_t
&
length
,
bool
need_rewrite_length
,
const
bool
is_byte_length
/* = false */
)
{
{
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
int64_t
mbmaxlen
=
0
;
int64_t
mbmaxlen
=
0
;
...
@@ -2954,9 +2954,10 @@ int ObDDLResolver::check_text_length(ObCharsetType cs_type, ObCollationType co_t
...
@@ -2954,9 +2954,10 @@ int ObDDLResolver::check_text_length(ObCharsetType cs_type, ObCollationType co_t
if
(
!
ob_is_text_tc
(
type
)
||
CHARSET_INVALID
==
cs_type
||
CS_TYPE_INVALID
==
co_type
)
{
if
(
!
ob_is_text_tc
(
type
)
||
CHARSET_INVALID
==
cs_type
||
CS_TYPE_INVALID
==
co_type
)
{
ret
=
OB_ERR_UNEXPECTED
;
ret
=
OB_ERR_UNEXPECTED
;
SQL_RESV_LOG
(
ERROR
,
"column infomation is error"
,
K
(
cs_type
),
K
(
co_type
),
K
(
ret
));
SQL_RESV_LOG
(
ERROR
,
"column infomation is error"
,
K
(
cs_type
),
K
(
co_type
),
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObCharset
::
get_mbmaxlen_by_coll
(
co_type
,
mbmaxlen
)))
{
}
else
if
(
!
is_byte_length
&&
OB_FAIL
(
ObCharset
::
get_mbmaxlen_by_coll
(
co_type
,
mbmaxlen
)))
{
ret
=
OB_ERR_UNEXPECTED
;
ret
=
OB_ERR_UNEXPECTED
;
SQL_RESV_LOG
(
WARN
,
"fail to get mbmaxlen"
,
K
(
ret
),
K
(
co_type
));
SQL_RESV_LOG
(
WARN
,
"fail to get mbmaxlen"
,
K
(
ret
),
K
(
co_type
));
}
else
if
(
is_byte_length
&&
OB_FALSE_IT
(
mbmaxlen
=
1
))
{
}
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
));
...
@@ -3025,7 +3026,8 @@ int ObDDLResolver::rewrite_text_length_mysql(ObObjType& type, int32_t& length)
...
@@ -3025,7 +3026,8 @@ int ObDDLResolver::rewrite_text_length_mysql(ObObjType& type, int32_t& length)
}
}
// TODO texttc should care about the the defined length not the actual length
// TODO texttc should care about the the defined length not the actual length
int
ObDDLResolver
::
check_text_column_length_and_promote
(
ObColumnSchemaV2
&
column
,
int64_t
table_id
)
int
ObDDLResolver
::
check_text_column_length_and_promote
(
ObColumnSchemaV2
&
column
,
int64_t
table_id
,
const
bool
is_byte_length
/* = false */
)
{
{
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
bool
need_check_length
=
true
;
bool
need_check_length
=
true
;
...
@@ -3041,7 +3043,8 @@ int ObDDLResolver::check_text_column_length_and_promote(ObColumnSchemaV2& column
...
@@ -3041,7 +3043,8 @@ int ObDDLResolver::check_text_column_length_and_promote(ObColumnSchemaV2& column
column
.
get_column_name
(),
column
.
get_column_name
(),
type
,
type
,
length
,
length
,
need_check_length
)))
{
need_check_length
,
is_byte_length
)))
{
LOG_WARN
(
"failed to check text length"
,
K
(
ret
),
K
(
column
));
LOG_WARN
(
"failed to check text length"
,
K
(
ret
),
K
(
column
));
}
else
{
}
else
{
column
.
set_data_type
(
type
);
column
.
set_data_type
(
type
);
...
...
src/sql/resolver/ddl/ob_ddl_resolver.h
浏览文件 @
ea5bd71d
...
@@ -142,13 +142,8 @@ public:
...
@@ -142,13 +142,8 @@ public:
static
const
int64_t
DEFAULT_TABLE_DOP
=
1
;
static
const
int64_t
DEFAULT_TABLE_DOP
=
1
;
explicit
ObDDLResolver
(
ObResolverParams
&
params
);
explicit
ObDDLResolver
(
ObResolverParams
&
params
);
virtual
~
ObDDLResolver
();
virtual
~
ObDDLResolver
();
static
int
check_text_length
(
ObCharsetType
cs_type
,
static
int
check_text_length
(
ObCharsetType
cs_type
,
ObCollationType
co_type
,
const
char
*
name
,
ObObjType
&
type
,
ObCollationType
co_type
,
int32_t
&
length
,
bool
need_rewrite_length
,
const
bool
is_byte_length
=
false
);
const
char
*
name
,
ObObjType
&
type
,
int32_t
&
length
,
bool
need_rewrite_length
);
static
int
rewrite_text_length_mysql
(
ObObjType
&
type
,
int32_t
&
length
);
static
int
rewrite_text_length_mysql
(
ObObjType
&
type
,
int32_t
&
length
);
static
int
check_uniq_allow
(
static
int
check_uniq_allow
(
share
::
schema
::
ObTableSchema
&
table_schema
,
obrpc
::
ObCreateIndexArg
&
index_arg
,
bool
&
allow
);
share
::
schema
::
ObTableSchema
&
table_schema
,
obrpc
::
ObCreateIndexArg
&
index_arg
,
bool
&
allow
);
...
@@ -187,7 +182,8 @@ public:
...
@@ -187,7 +182,8 @@ public:
static
int
cast_enum_or_set_default_value
(
static
int
cast_enum_or_set_default_value
(
const
share
::
schema
::
ObColumnSchemaV2
&
column
,
common
::
ObObjCastParams
&
params
,
common
::
ObObj
&
def_val
);
const
share
::
schema
::
ObColumnSchemaV2
&
column
,
common
::
ObObjCastParams
&
params
,
common
::
ObObj
&
def_val
);
int
check_partition_name_duplicate
(
ParseNode
*
node
,
bool
is_oracle_modle
=
false
);
int
check_partition_name_duplicate
(
ParseNode
*
node
,
bool
is_oracle_modle
=
false
);
static
int
check_text_column_length_and_promote
(
share
::
schema
::
ObColumnSchemaV2
&
column
,
int64_t
table_id
);
static
int
check_text_column_length_and_promote
(
share
::
schema
::
ObColumnSchemaV2
&
column
,
int64_t
table_id
,
const
bool
is_byte_length
=
false
);
static
int
get_enable_split_partition
(
const
int64_t
tenant_id
,
bool
&
enable_split_partition
);
static
int
get_enable_split_partition
(
const
int64_t
tenant_id
,
bool
&
enable_split_partition
);
typedef
common
::
hash
::
ObPlacementHashSet
<
share
::
schema
::
ObIndexNameHashWrapper
,
common
::
OB_MAX_COLUMN_NUMBER
>
typedef
common
::
hash
::
ObPlacementHashSet
<
share
::
schema
::
ObIndexNameHashWrapper
,
common
::
OB_MAX_COLUMN_NUMBER
>
IndexNameSet
;
IndexNameSet
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录