Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
caoersss
oceanbase
提交
c9bd25e7
O
oceanbase
项目概览
caoersss
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
c9bd25e7
编写于
7月 28, 2021
作者:
X
xf0
提交者:
wangzelin.wzl
7月 28, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix an index name bug in phy restore
上级
b307e664
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
207 addition
and
127 deletion
+207
-127
src/share/schema/ob_schema_mgr.cpp
src/share/schema/ob_schema_mgr.cpp
+184
-115
src/share/schema/ob_schema_mgr.h
src/share/schema/ob_schema_mgr.h
+11
-8
src/share/schema/ob_schema_struct.h
src/share/schema/ob_schema_struct.h
+12
-4
未找到文件。
src/share/schema/ob_schema_mgr.cpp
浏览文件 @
c9bd25e7
此差异已折叠。
点击以展开。
src/share/schema/ob_schema_mgr.h
浏览文件 @
c9bd25e7
...
...
@@ -608,14 +608,17 @@ struct GetTableKeyV2<ObIndexSchemaHashWrapper, ObSimpleTableSchemaV2*> {
if
(
OB_UNLIKELY
(
OB_SUCCESS
!=
index_schema
->
check_if_oracle_compat_mode
(
is_oracle_mode
)))
{
ObIndexSchemaHashWrapper
null_wrap
;
return
null_wrap
;
}
else
if
(
is_oracle_mode
&&
!
index_schema
->
is_in_recyclebin
())
{
// oracle mode and index is not in recyclebin
ObIndexSchemaHashWrapper
index_schema_hash_wrapper
(
index_schema
->
get_tenant_id
(),
index_schema
->
get_database_id
(),
index_schema
->
get_origin_index_name_str
());
}
else
if
(
index_schema
->
is_in_recyclebin
())
{
// index is in recyclebin
ObIndexSchemaHashWrapper
index_schema_hash_wrapper
(
index_schema
->
get_tenant_id
(),
index_schema
->
get_database_id
(),
common
::
OB_INVALID_ID
,
index_schema
->
get_table_name_str
());
return
index_schema_hash_wrapper
;
}
else
{
// mysql mode or index is in recyclebin
ObIndexSchemaHashWrapper
index_schema_hash_wrapper
(
index_schema
->
get_tenant_id
(),
index_schema
->
get_database_id
(),
index_schema
->
get_table_name_str
());
}
else
{
ObIndexSchemaHashWrapper
index_schema_hash_wrapper
(
index_schema
->
get_tenant_id
(),
index_schema
->
get_database_id
(),
is_oracle_mode
?
common
::
OB_INVALID_ID
:
index_schema
->
get_data_table_id
(),
index_schema
->
get_origin_index_name_str
());
return
index_schema_hash_wrapper
;
}
}
else
{
...
...
@@ -887,7 +890,7 @@ private:
int
rebuild_schema_meta_if_not_consistent
();
int
rebuild_table_hashmap
(
uint64_t
&
fk_cnt
,
uint64_t
&
cst_cnt
);
int
rebuild_db_hashmap
();
uint64_t
extract_data_table_id_from_index_name
(
const
common
::
ObString
&
index_name
)
const
;
int
get_table_schema
(
const
uint64_t
tenant_id
,
const
uint64_t
database_id
,
const
uint64_t
session_id
,
const
common
::
ObString
&
table_name
,
const
ObSimpleTableSchemaV2
*&
table_schema
)
const
;
int
get_index_schema
(
const
uint64_t
tenant_id
,
const
uint64_t
database_id
,
const
common
::
ObString
&
table_name
,
...
...
src/share/schema/ob_schema_struct.h
浏览文件 @
c9bd25e7
...
...
@@ -3707,10 +3707,12 @@ inline uint64_t ObColumnSchemaHashWrapper::hash() const
}
class
ObIndexSchemaHashWrapper
{
public:
ObIndexSchemaHashWrapper
()
:
tenant_id_
(
common
::
OB_INVALID_ID
),
database_id_
(
common
::
OB_INVALID_ID
)
ObIndexSchemaHashWrapper
()
:
tenant_id_
(
common
::
OB_INVALID_ID
),
database_id_
(
common
::
OB_INVALID_ID
),
data_table_id_
(
common
::
OB_INVALID_ID
)
{}
ObIndexSchemaHashWrapper
(
uint64_t
tenant_id
,
const
uint64_t
database_id
,
const
common
::
ObString
&
index_name
)
:
tenant_id_
(
tenant_id
),
database_id_
(
database_id
),
index_name_
(
index_name
)
ObIndexSchemaHashWrapper
(
uint64_t
tenant_id
,
const
uint64_t
database_id
,
const
uint64_t
data_table_id
,
const
common
::
ObString
&
index_name
)
:
tenant_id_
(
tenant_id
),
database_id_
(
database_id
),
data_table_id_
(
data_table_id
),
index_name_
(
index_name
)
{}
~
ObIndexSchemaHashWrapper
()
{}
...
...
@@ -3725,6 +3727,10 @@ public:
{
return
database_id_
;
}
inline
uint64_t
get_data_table_id
()
const
{
return
data_table_id_
;
}
inline
const
common
::
ObString
&
get_index_name
()
const
{
return
index_name_
;
...
...
@@ -3733,6 +3739,7 @@ public:
private:
uint64_t
tenant_id_
;
uint64_t
database_id_
;
uint64_t
data_table_id_
;
// only for mysql mode
common
::
ObString
index_name_
;
};
...
...
@@ -3741,6 +3748,7 @@ inline uint64_t ObIndexSchemaHashWrapper::hash() const
uint64_t
hash_ret
=
0
;
hash_ret
=
common
::
murmurhash
(
&
tenant_id_
,
sizeof
(
uint64_t
),
0
);
hash_ret
=
common
::
murmurhash
(
&
database_id_
,
sizeof
(
uint64_t
),
hash_ret
);
hash_ret
=
common
::
murmurhash
(
&
data_table_id_
,
sizeof
(
uint64_t
),
hash_ret
);
// case insensitive
hash_ret
=
common
::
ObCharset
::
hash
(
common
::
CS_TYPE_UTF8MB4_GENERAL_CI
,
index_name_
,
hash_ret
);
return
hash_ret
;
...
...
@@ -3751,7 +3759,7 @@ inline bool ObIndexSchemaHashWrapper::operator==(const ObIndexSchemaHashWrapper&
// mysql case insensitive
// oracle case sensitive
ObCompareNameWithTenantID
name_cmp
(
tenant_id_
);
return
(
tenant_id_
==
rv
.
tenant_id_
)
&&
(
database_id_
==
rv
.
database_id_
)
&&
return
(
tenant_id_
==
rv
.
tenant_id_
)
&&
(
database_id_
==
rv
.
database_id_
)
&&
(
data_table_id_
==
rv
.
data_table_id_
)
&&
(
0
==
name_cmp
.
compare
(
index_name_
,
rv
.
index_name_
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录