Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
4862a8e3
O
oceanbase
项目概览
oceanbase
/
oceanbase
8 个月 前同步成功
通知
260
Star
6084
Fork
1301
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4862a8e3
编写于
4月 23, 2024
作者:
T
Tyshawn
提交者:
ob-robot
4月 23, 2024
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FTS][BUG.FIX] fix print log coredump
上级
ec55cd9b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
29 deletion
+36
-29
src/share/ob_fts_index_builder_util.cpp
src/share/ob_fts_index_builder_util.cpp
+36
-29
未找到文件。
src/share/ob_fts_index_builder_util.cpp
浏览文件 @
4862a8e3
...
...
@@ -744,12 +744,12 @@ int ObFtsIndexBuilderUtil::adjust_fts_arg(
}
// 2. add doc id column to arg->store_columns
const
ObColumnSchemaV2
*
doc_id_col
=
fts_cols
.
at
(
0
);
if
(
OB_FAIL
(
ret
))
{
}
else
if
(
OB_FAIL
(
index_arg
->
store_columns_
.
push_back
(
doc_id_col
->
get_column_name_str
())))
{
ObString
doc_id_col_name
;
if
(
FAILEDx
(
ob_write_string
(
*
allocator
,
doc_id_col
->
get_column_name_str
(),
doc_id_col_name
)))
{
LOG_WARN
(
"fail to deep copy doc id column name"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
index_arg
->
store_columns_
.
push_back
(
doc_id_col_name
)))
{
LOG_WARN
(
"failed to push back doc id column"
,
K
(
ret
));
}
}
else
if
(
is_doc_rowkey
)
{
// add doc id column to arg->index_columns
ObColumnSortItem
doc_id_column
;
...
...
@@ -796,7 +796,6 @@ int ObFtsIndexBuilderUtil::inner_adjust_fts_arg(
ObIAllocator
*
allocator
)
{
int
ret
=
OB_SUCCESS
;
// 1. add doc id column, word column to arg->index_columns
if
(
OB_ISNULL
(
fts_arg
)
||
(
!
share
::
schema
::
is_fts_index_aux
(
fts_arg
->
index_type_
)
&&
!
share
::
schema
::
is_fts_doc_word_aux
(
fts_arg
->
index_type_
))
||
...
...
@@ -805,31 +804,39 @@ int ObFtsIndexBuilderUtil::inner_adjust_fts_arg(
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
KPC
(
fts_arg
),
KP
(
allocator
),
K
(
fts_cols
.
count
()),
K
(
index_column_cnt
));
}
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
index_column_cnt
;
++
i
)
{
ObColumnSortItem
fts_column
;
const
ObColumnSchemaV2
*
fts_col
=
fts_cols
.
at
(
i
);
if
(
OB_ISNULL
(
fts_col
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"fts_col is null"
,
K
(
ret
),
K
(
i
));
}
else
if
(
OB_FAIL
(
ob_write_string
(
*
allocator
,
fts_col
->
get_column_name_str
(),
fts_column
.
column_name_
)))
{
//to keep the memory lifetime of column_name consistent with index_arg
LOG_WARN
(
"deep copy column name failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
fts_arg
->
index_columns_
.
push_back
(
fts_column
)))
{
LOG_WARN
(
"failed to push back index column"
,
K
(
ret
));
}
else
{
// 1. add doc id column, word column to arg->index_columns
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
index_column_cnt
;
++
i
)
{
ObColumnSortItem
fts_column
;
const
ObColumnSchemaV2
*
fts_col
=
fts_cols
.
at
(
i
);
if
(
OB_ISNULL
(
fts_col
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"fts_col is null"
,
K
(
ret
),
K
(
i
));
}
else
if
(
OB_FAIL
(
ob_write_string
(
*
allocator
,
fts_col
->
get_column_name_str
(),
fts_column
.
column_name_
)))
{
//to keep the memory lifetime of column_name consistent with index_arg
LOG_WARN
(
"deep copy column name failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
fts_arg
->
index_columns_
.
push_back
(
fts_column
)))
{
LOG_WARN
(
"failed to push back index column"
,
K
(
ret
));
}
}
// 2. add word count column to arg->store_columns
const
ObColumnSchemaV2
*
word_count_col
=
fts_cols
.
at
(
index_column_cnt
);
ObString
word_count_col_name
;
if
(
FAILEDx
(
ob_write_string
(
*
allocator
,
word_count_col
->
get_column_name_str
(),
word_count_col_name
)))
{
LOG_WARN
(
"fail to deep copy word count column name"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
fts_arg
->
store_columns_
.
push_back
(
word_count_col_name
)))
{
LOG_WARN
(
"failed to push back word count column"
,
K
(
ret
));
}
// 3. add document length column to arg->store_columns
const
ObColumnSchemaV2
*
doc_length_col
=
fts_cols
.
at
(
index_column_cnt
+
1
);
ObString
doc_length_col_name
;
if
(
FAILEDx
(
ob_write_string
(
*
allocator
,
doc_length_col
->
get_column_name_str
(),
doc_length_col_name
)))
{
LOG_WARN
(
"fail to deep copy doc length column"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
fts_arg
->
store_columns_
.
push_back
(
doc_length_col_name
)))
{
LOG_WARN
(
"fail to push document length column"
,
K
(
ret
));
}
}
// 2. add word count column to arg->store_columns
const
ObColumnSchemaV2
*
word_count_col
=
fts_cols
.
at
(
index_column_cnt
);
if
(
FAILEDx
(
fts_arg
->
store_columns_
.
push_back
(
word_count_col
->
get_column_name_str
())))
{
LOG_WARN
(
"failed to push back word count column"
,
K
(
ret
));
}
// 3. add document length column to arg->store_columns
const
ObColumnSchemaV2
*
doc_length_col
=
fts_cols
.
at
(
index_column_cnt
+
1
);
if
(
FAILEDx
(
fts_arg
->
store_columns_
.
push_back
(
doc_length_col
->
get_column_name_str
())))
{
LOG_WARN
(
"fail to push document length column"
,
K
(
ret
));
}
return
ret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录