Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
知世而放
oceanbase
提交
55d9a874
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,发现更多精彩内容 >>
提交
55d9a874
编写于
11月 10, 2021
作者:
H
Hongqin-Li
提交者:
LINGuanRen
11月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix redundant tailing spaces in prefix index table
上级
8546de77
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
6 deletion
+36
-6
src/storage/ob_partition_storage.cpp
src/storage/ob_partition_storage.cpp
+36
-6
未找到文件。
src/storage/ob_partition_storage.cpp
浏览文件 @
55d9a874
...
@@ -988,7 +988,7 @@ int ObPartitionStorage::need_reshape_table_row(const ObNewRow& row, RowReshape*
...
@@ -988,7 +988,7 @@ int ObPartitionStorage::need_reshape_table_row(const ObNewRow& row, RowReshape*
if
(
cell
.
is_fixed_len_char_type
())
{
if
(
cell
.
is_fixed_len_char_type
())
{
space_pattern
=
ObCharsetUtils
::
get_const_str
(
cell
.
get_collation_type
(),
' '
);
space_pattern
=
ObCharsetUtils
::
get_const_str
(
cell
.
get_collation_type
(),
' '
);
}
}
if
(
cell
.
is_fixed_len_char_type
()
&&
cell
.
get_string_len
()
>
0
&&
if
(
cell
.
is_fixed_len_char_type
()
&&
cell
.
get_string_len
()
>
=
space_pattern
.
length
()
&&
0
==
MEMCMP
(
cell
.
get_string_ptr
()
+
cell
.
get_string_len
()
-
space_pattern
.
length
(),
0
==
MEMCMP
(
cell
.
get_string_ptr
()
+
cell
.
get_string_len
()
-
space_pattern
.
length
(),
space_pattern
.
ptr
(),
space_pattern
.
ptr
(),
space_pattern
.
length
()))
{
space_pattern
.
length
()))
{
...
@@ -1021,7 +1021,7 @@ int ObPartitionStorage::need_reshape_table_row(
...
@@ -1021,7 +1021,7 @@ int ObPartitionStorage::need_reshape_table_row(
if
(
cell
.
is_fixed_len_char_type
())
{
if
(
cell
.
is_fixed_len_char_type
())
{
space_pattern
=
ObCharsetUtils
::
get_const_str
(
cell
.
get_collation_type
(),
' '
);
space_pattern
=
ObCharsetUtils
::
get_const_str
(
cell
.
get_collation_type
(),
' '
);
}
}
if
(
cell
.
is_fixed_len_char_type
()
&&
cell
.
get_string_len
()
>
0
&&
if
(
cell
.
is_fixed_len_char_type
()
&&
cell
.
get_string_len
()
>
=
space_pattern
.
length
()
&&
0
==
MEMCMP
(
cell
.
get_string_ptr
()
+
cell
.
get_string_len
()
-
space_pattern
.
length
(),
0
==
MEMCMP
(
cell
.
get_string_ptr
()
+
cell
.
get_string_len
()
-
space_pattern
.
length
(),
space_pattern
.
ptr
(),
space_pattern
.
ptr
(),
space_pattern
.
length
()))
{
space_pattern
.
length
()))
{
...
@@ -1094,7 +1094,7 @@ int ObPartitionStorage::reshape_row(const ObNewRow& row, const int64_t column_cn
...
@@ -1094,7 +1094,7 @@ int ObPartitionStorage::reshape_row(const ObNewRow& row, const int64_t column_cn
const
char
*
str
=
cell
.
get_string_ptr
();
const
char
*
str
=
cell
.
get_string_ptr
();
int32_t
len
=
cell
.
get_string_len
();
int32_t
len
=
cell
.
get_string_len
();
ObString
space_pattern
=
ObCharsetUtils
::
get_const_str
(
cell
.
get_collation_type
(),
' '
);
ObString
space_pattern
=
ObCharsetUtils
::
get_const_str
(
cell
.
get_collation_type
(),
' '
);
for
(;
len
>
0
;
len
-=
space_pattern
.
length
())
{
for
(;
len
>
=
space_pattern
.
length
()
;
len
-=
space_pattern
.
length
())
{
if
(
0
!=
MEMCMP
(
str
+
len
-
space_pattern
.
length
(),
space_pattern
.
ptr
(),
space_pattern
.
length
()))
{
if
(
0
!=
MEMCMP
(
str
+
len
-
space_pattern
.
length
(),
space_pattern
.
ptr
(),
space_pattern
.
length
()))
{
break
;
break
;
}
}
...
@@ -5518,6 +5518,7 @@ int ObPartitionStorage::local_sort_index_by_range(
...
@@ -5518,6 +5518,7 @@ int ObPartitionStorage::local_sort_index_by_range(
ObObj
*
cells_buf
=
NULL
;
ObObj
*
cells_buf
=
NULL
;
ObStoreRow
default_row
;
ObStoreRow
default_row
;
ObStoreRow
tmp_row
;
ObStoreRow
tmp_row
;
ObStoreRow
new_row
;
if
(
NULL
==
(
cells_buf
=
reinterpret_cast
<
ObObj
*>
(
allocator
.
alloc
(
sizeof
(
ObObj
)
*
org_col_ids
.
count
()
*
2
))))
{
if
(
NULL
==
(
cells_buf
=
reinterpret_cast
<
ObObj
*>
(
allocator
.
alloc
(
sizeof
(
ObObj
)
*
org_col_ids
.
count
()
*
2
))))
{
ret
=
OB_ALLOCATE_MEMORY_FAILED
;
ret
=
OB_ALLOCATE_MEMORY_FAILED
;
...
@@ -5530,6 +5531,7 @@ int ObPartitionStorage::local_sort_index_by_range(
...
@@ -5530,6 +5531,7 @@ int ObPartitionStorage::local_sort_index_by_range(
tmp_row
.
flag_
=
ObActionFlag
::
OP_ROW_EXIST
;
tmp_row
.
flag_
=
ObActionFlag
::
OP_ROW_EXIST
;
tmp_row
.
row_val_
.
cells_
=
cells_buf
+
org_col_ids
.
count
();
tmp_row
.
row_val_
.
cells_
=
cells_buf
+
org_col_ids
.
count
();
tmp_row
.
row_val_
.
count_
=
org_col_ids
.
count
();
tmp_row
.
row_val_
.
count_
=
org_col_ids
.
count
();
new_row
.
flag_
=
ObActionFlag
::
OP_ROW_EXIST
;
}
}
// extend col_ids for generated column
// extend col_ids for generated column
...
@@ -5789,6 +5791,29 @@ int ObPartitionStorage::local_sort_index_by_range(
...
@@ -5789,6 +5791,29 @@ int ObPartitionStorage::local_sort_index_by_range(
if
(
OB_SUCC
(
ret
))
{
if
(
OB_SUCC
(
ret
))
{
sql_mode
=
THIS_WORKER
.
get_compatibility_mode
();
sql_mode
=
THIS_WORKER
.
get_compatibility_mode
();
}
}
ObTableSchemaParam
schema_param
(
allocator
);
ObRelativeTable
relative_table
;
ObSQLMode
ob_sql_mode
=
common
::
ob_compatibility_mode_to_sql_mode
(
static_cast
<
ObCompatibilityMode
>
(
sql_mode
));
ObFixedArray
<
uint64_t
,
ObIAllocator
>
column_ids
(
allocator
,
org_col_ids
.
count
());
RowReshape
*
row_reshape_ins
=
nullptr
;
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
org_col_ids
.
count
();
i
++
)
{
const
ObColDesc
&
col_desc
=
org_col_ids
.
at
(
i
);
if
(
OB_FAIL
(
column_ids
.
push_back
(
col_desc
.
col_id_
)))
{
LOG_WARN
(
"failed to push back column id"
,
K
(
ret
));
}
}
if
(
OB_FAIL
(
ret
))
{
}
else
if
(
OB_FAIL
(
schema_param
.
convert
(
table_schema
,
column_ids
)))
{
LOG_WARN
(
"failed to convert schema param"
,
K
(
ret
));
}
else
if
(
OB_UNLIKELY
(
false
==
relative_table
.
set_schema_param
(
&
schema_param
)))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"failed to set schema param"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
malloc_rows_reshape_if_need
(
allocator
,
org_col_ids
,
1
,
relative_table
,
ob_sql_mode
,
row_reshape_ins
)))
{
STORAGE_LOG
(
WARN
,
"failed to malloc for row reshape"
,
K
(
ret
));
}
else
{
// do nothing
}
while
(
OB_SUCC
(
ret
))
{
while
(
OB_SUCC
(
ret
))
{
t1
=
ObTimeUtility
::
current_time
();
t1
=
ObTimeUtility
::
current_time
();
calc_buf
.
reuse
();
calc_buf
.
reuse
();
...
@@ -5881,11 +5906,11 @@ int ObPartitionStorage::local_sort_index_by_range(
...
@@ -5881,11 +5906,11 @@ int ObPartitionStorage::local_sort_index_by_range(
}
}
if
(
OB_SUCC
(
ret
))
{
if
(
OB_SUCC
(
ret
))
{
ObSEArray
<
ObString
,
8
>
words
;
ObSEArray
<
ObString
,
8
>
words
;
ObObj
orig_obj
=
tmp_row
.
row_val_
.
cells_
[
pos
];
ObString
orig_string
;
ObString
orig_string
=
orig_obj
.
get_string
();
if
(
OB_UNLIKELY
(
pos
<
0
||
tmp_row
.
row_val_
.
count_
<=
pos
))
{
if
(
-
1
==
pos
)
{
ret
=
OB_ERR_UNEXPECTED
;
ret
=
OB_ERR_UNEXPECTED
;
STORAGE_LOG
(
WARN
,
"domain index has no domain column"
,
K
(
domain_column_id
),
K
(
org_col_ids
),
K
(
ret
));
STORAGE_LOG
(
WARN
,
"domain index has no domain column"
,
K
(
domain_column_id
),
K
(
org_col_ids
),
K
(
ret
));
}
else
if
(
OB_FALSE_IT
(
orig_string
=
tmp_row
.
row_val_
.
cells_
[
pos
].
get_string
()))
{
}
else
if
(
OB_FAIL
(
split_on
(
orig_string
,
','
,
words
)))
{
}
else
if
(
OB_FAIL
(
split_on
(
orig_string
,
','
,
words
)))
{
STORAGE_LOG
(
WARN
,
"failed to split string"
,
K
(
orig_string
),
K
(
ret
));
STORAGE_LOG
(
WARN
,
"failed to split string"
,
K
(
orig_string
),
K
(
ret
));
}
else
{
}
else
{
...
@@ -5909,7 +5934,11 @@ int ObPartitionStorage::local_sort_index_by_range(
...
@@ -5909,7 +5934,11 @@ int ObPartitionStorage::local_sort_index_by_range(
}
}
}
}
}
}
}
else
if
(
OB_FAIL
(
reshape_table_rows
(
&
tmp_row
.
row_val_
,
row_reshape_ins
,
org_col_ids
.
count
(),
&
new_row
,
1
,
ob_sql_mode
)))
{
STORAGE_LOG
(
WARN
,
"failed to reshape rows"
,
K
(
ret
));
}
else
{
}
else
{
tmp_row
=
new_row
;
t3
=
ObTimeUtility
::
current_time
();
t3
=
ObTimeUtility
::
current_time
();
if
(
OB_FAIL
(
local_sort
->
add_item
(
tmp_row
)))
{
if
(
OB_FAIL
(
local_sort
->
add_item
(
tmp_row
)))
{
STORAGE_LOG
(
WARN
,
"Fail to add item to sort, "
,
K
(
ret
));
STORAGE_LOG
(
WARN
,
"Fail to add item to sort, "
,
K
(
ret
));
...
@@ -5933,6 +5962,7 @@ int ObPartitionStorage::local_sort_index_by_range(
...
@@ -5933,6 +5962,7 @@ int ObPartitionStorage::local_sort_index_by_range(
if
(
OB_ITER_END
==
ret
)
{
if
(
OB_ITER_END
==
ret
)
{
ret
=
OB_SUCCESS
;
ret
=
OB_SUCCESS
;
}
}
free_row_reshape
(
allocator
,
row_reshape_ins
,
1
);
STORAGE_LOG
(
INFO
,
STORAGE_LOG
(
INFO
,
"print prepare build index cost time"
,
"print prepare build index cost time"
,
K
(
get_next_row_time
),
K
(
get_next_row_time
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录