Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
f27ecbb7
O
oceanbase
项目概览
Metz
/
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,发现更多精彩内容 >>
提交
f27ecbb7
编写于
7月 13, 2021
作者:
O
obdev
提交者:
wangzelin.wzl
7月 13, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
opensource bigfix patch
上级
2c4f8593
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
124 addition
and
52 deletion
+124
-52
deps/oblib/src/common/object/ob_object.cpp
deps/oblib/src/common/object/ob_object.cpp
+24
-1
deps/oblib/src/common/object/ob_object.h
deps/oblib/src/common/object/ob_object.h
+5
-4
deps/oblib/src/lib/ob_define.h
deps/oblib/src/lib/ob_define.h
+3
-0
src/observer/mysql/ob_mysql_request_manager.h
src/observer/mysql/ob_mysql_request_manager.h
+1
-1
src/observer/ob_inner_sql_connection.cpp
src/observer/ob_inner_sql_connection.cpp
+4
-0
src/observer/virtual_table/ob_tenant_virtual_outline.cpp
src/observer/virtual_table/ob_tenant_virtual_outline.cpp
+8
-1
src/rootserver/ob_ddl_service.cpp
src/rootserver/ob_ddl_service.cpp
+9
-7
src/rootserver/ob_root_service.cpp
src/rootserver/ob_root_service.cpp
+3
-0
src/sql/engine/ob_physical_plan.h
src/sql/engine/ob_physical_plan.h
+2
-12
src/sql/ob_result_set.cpp
src/sql/ob_result_set.cpp
+17
-7
src/sql/ob_sql.cpp
src/sql/ob_sql.cpp
+13
-6
src/sql/plan_cache/ob_plan_cache.cpp
src/sql/plan_cache/ob_plan_cache.cpp
+6
-1
src/sql/plan_cache/ob_plan_cache.h
src/sql/plan_cache/ob_plan_cache.h
+2
-2
src/sql/plan_cache/ob_plan_cache_util.h
src/sql/plan_cache/ob_plan_cache_util.h
+4
-4
src/sql/plan_cache/ob_plan_cache_value.cpp
src/sql/plan_cache/ob_plan_cache_value.cpp
+19
-2
src/sql/plan_cache/ob_plan_set.cpp
src/sql/plan_cache/ob_plan_set.cpp
+3
-2
src/sql/resolver/ddl/ob_outline_resolver.cpp
src/sql/resolver/ddl/ob_outline_resolver.cpp
+1
-2
未找到文件。
deps/oblib/src/common/object/ob_object.cpp
浏览文件 @
f27ecbb7
...
@@ -570,7 +570,30 @@ int ObObj::deep_copy(const ObObj& src, char* buf, const int64_t size, int64_t& p
...
@@ -570,7 +570,30 @@ int ObObj::deep_copy(const ObObj& src, char* buf, const int64_t size, int64_t& p
return
ret
;
return
ret
;
}
}
bool
ObObj
::
can_compare
(
const
ObObj
&
other
)
const
void
*
ObObj
::
get_deep_copy_obj_ptr
()
{
void
*
ptr
=
NULL
;
if
(
ob_is_string_type
(
this
->
get_type
()))
{
// val_len_ == 0 is empty string, and it may point to unexpected address
// Therefore, reset it to NULL
if
(
val_len_
!=
0
)
{
ptr
=
(
void
*
)
v_
.
string_
;
}
}
else
if
(
ob_is_raw
(
this
->
get_type
()))
{
ptr
=
(
void
*
)
v_
.
string_
;
}
else
if
(
ob_is_number_tc
(
this
->
get_type
()))
{
ptr
=
(
void
*
)
v_
.
nmb_digits_
;
}
else
if
(
ob_is_rowid_tc
(
this
->
get_type
()))
{
ptr
=
(
void
*
)
v_
.
string_
;
}
else
if
(
ob_is_lob_locator
(
this
->
get_type
()))
{
ptr
=
(
void
*
)
&
v_
.
lob_locator_
;
}
else
{
// do nothing
}
return
ptr
;
}
bool
ObObj
::
can_compare
(
const
ObObj
&
other
)
const
{
{
obj_cmp_func
cmp_func
=
NULL
;
obj_cmp_func
cmp_func
=
NULL
;
return
(
is_min_value
()
||
is_max_value
()
||
other
.
is_min_value
()
||
other
.
is_max_value
()
||
return
(
is_min_value
()
||
is_max_value
()
||
other
.
is_min_value
()
||
other
.
is_max_value
()
||
...
...
deps/oblib/src/common/object/ob_object.h
浏览文件 @
f27ecbb7
...
@@ -2084,10 +2084,11 @@ public:
...
@@ -2084,10 +2084,11 @@ public:
//@{ deep copy
//@{ deep copy
bool
need_deep_copy
()
const
;
bool
need_deep_copy
()
const
;
OB_INLINE
int64_t
get_deep_copy_size
()
const
;
OB_INLINE
int64_t
get_deep_copy_size
()
const
;
int
deep_copy
(
const
ObObj
&
src
,
char
*
buf
,
const
int64_t
size
,
int64_t
&
pos
);
int
deep_copy
(
const
ObObj
&
src
,
char
*
buf
,
const
int64_t
size
,
int64_t
&
pos
);
void
set_data_ptr
(
void
*
data_ptr
);
void
*
get_deep_copy_obj_ptr
();
const
void
*
get_data_ptr
()
const
;
void
set_data_ptr
(
void
*
data_ptr
);
// return byte length
const
void
*
get_data_ptr
()
const
;
//return byte length
int64_t
get_data_length
()
const
;
int64_t
get_data_length
()
const
;
template
<
typename
Allocator
>
template
<
typename
Allocator
>
...
...
deps/oblib/src/lib/ob_define.h
浏览文件 @
f27ecbb7
...
@@ -818,6 +818,9 @@ const uint64_t OB_ORA_SYS_DATABASE_ID = 6;
...
@@ -818,6 +818,9 @@ const uint64_t OB_ORA_SYS_DATABASE_ID = 6;
const
uint64_t
OB_ORA_LBACSYS_DATABASE_ID
=
7
;
const
uint64_t
OB_ORA_LBACSYS_DATABASE_ID
=
7
;
const
uint64_t
OB_ORA_AUDITOR_DATABASE_ID
=
8
;
const
uint64_t
OB_ORA_AUDITOR_DATABASE_ID
=
8
;
const
char
*
const
OB_ORA_PUBLIC_SCHEMA_NAME
=
"PUBLIC"
;
const
char
*
const
OB_ORA_PUBLIC_SCHEMA_NAME
=
"PUBLIC"
;
// not actual database, only for using and creating outlines without specified database
const
uint64_t
OB_OUTLINE_DEFAULT_DATABASE_ID
=
9
;
const
char
*
const
OB_OUTLINE_DEFAULT_DATABASE_NAME
=
"__outline_default_db"
;
// sys unit associated const
// sys unit associated const
const
uint64_t
OB_SYS_UNIT_CONFIG_ID
=
1
;
const
uint64_t
OB_SYS_UNIT_CONFIG_ID
=
1
;
...
...
src/observer/mysql/ob_mysql_request_manager.h
浏览文件 @
f27ecbb7
...
@@ -71,7 +71,7 @@ public:
...
@@ -71,7 +71,7 @@ public:
static
const
int32_t
BATCH_RELEASE_COUNT
=
50000
;
static
const
int32_t
BATCH_RELEASE_COUNT
=
50000
;
static
const
int32_t
MAX_RELEASE_TIME
=
5
*
1000
;
// 5ms
static
const
int32_t
MAX_RELEASE_TIME
=
5
*
1000
;
// 5ms
static
const
int64_t
US_PER_HOUR
=
3600000000
;
static
const
int64_t
US_PER_HOUR
=
3600000000
;
static
const
int64_t
MAX_QUEUE_SIZE
=
1000000
;
// 100w
static
const
int64_t
MAX_QUEUE_SIZE
=
1000000
0
;
// 10m
static
const
int64_t
MINI_MODE_MAX_QUEUE_SIZE
=
100000
;
// 10w
static
const
int64_t
MINI_MODE_MAX_QUEUE_SIZE
=
100000
;
// 10w
// start to eliminate when sql_audit more than 9 millions records
// start to eliminate when sql_audit more than 9 millions records
static
const
int64_t
HIGH_LEVEL_EVICT_SIZE
=
9000000
;
// 900w
static
const
int64_t
HIGH_LEVEL_EVICT_SIZE
=
9000000
;
// 900w
...
...
src/observer/ob_inner_sql_connection.cpp
浏览文件 @
f27ecbb7
...
@@ -473,6 +473,10 @@ int ObInnerSQLConnection::process_retry(
...
@@ -473,6 +473,10 @@ int ObInnerSQLConnection::process_retry(
if
(
need_retry
)
{
if
(
need_retry
)
{
LOG_WARN
(
"need retry, set ret to OB_SUCCESS"
,
K
(
ret
),
K
(
last_ret
),
K
(
retry_cnt
));
LOG_WARN
(
"need retry, set ret to OB_SUCCESS"
,
K
(
ret
),
K
(
last_ret
),
K
(
retry_cnt
));
retry_info
.
set_last_query_retry_err
(
last_ret
);
retry_info
.
set_last_query_retry_err
(
last_ret
);
if
(
OB_ISNULL
(
extern_session_
))
{
}
else
{
extern_session_
->
get_retry_info_for_update
().
set_last_query_retry_err
(
last_ret
);
}
ret
=
OB_SUCCESS
;
ret
=
OB_SUCCESS
;
}
}
return
ret
;
return
ret
;
...
...
src/observer/virtual_table/ob_tenant_virtual_outline.cpp
浏览文件 @
f27ecbb7
...
@@ -156,7 +156,10 @@ int ObTenantVirtualOutline::fill_cells(const ObOutlineInfo* outline_info)
...
@@ -156,7 +156,10 @@ int ObTenantVirtualOutline::fill_cells(const ObOutlineInfo* outline_info)
}
}
case
DATABASE_NAME
:
{
case
DATABASE_NAME
:
{
DBInfo
db_info
;
DBInfo
db_info
;
if
(
OB_FAIL
(
database_infos_
.
get_refactored
(
outline_info
->
get_database_id
(),
db_info
)))
{
if
(
outline_info
->
get_database_id
()
==
OB_OUTLINE_DEFAULT_DATABASE_ID
)
{
cells
[
cell_idx
].
set_varchar
(
OB_OUTLINE_DEFAULT_DATABASE_NAME
);
cells
[
cell_idx
].
set_collation_type
(
ObCharset
::
get_default_collation
(
ObCharset
::
get_default_charset
()));
}
else
if
(
OB_FAIL
(
database_infos_
.
get_refactored
(
outline_info
->
get_database_id
(),
db_info
)))
{
LOG_WARN
(
"fail to ge value from database_infos"
,
K
(
ret
),
K
(
outline_info
->
get_database_id
()));
LOG_WARN
(
"fail to ge value from database_infos"
,
K
(
ret
),
K
(
outline_info
->
get_database_id
()));
}
else
{
}
else
{
cells
[
cell_idx
].
set_varchar
(
db_info
.
db_name_
);
cells
[
cell_idx
].
set_varchar
(
db_info
.
db_name_
);
...
@@ -224,6 +227,10 @@ int ObTenantVirtualOutline::is_output_outline(const ObOutlineInfo* outline_info,
...
@@ -224,6 +227,10 @@ int ObTenantVirtualOutline::is_output_outline(const ObOutlineInfo* outline_info,
LOG_WARN
(
"parameter is NULL"
,
K
(
ret
),
K
(
outline_info
),
K
(
schema_guard_
));
LOG_WARN
(
"parameter is NULL"
,
K
(
ret
),
K
(
outline_info
),
K
(
schema_guard_
));
}
else
if
(
outline_info
->
get_outline_content_str
().
empty
())
{
}
else
if
(
outline_info
->
get_outline_content_str
().
empty
())
{
is_output
=
false
;
is_output
=
false
;
}
else
if
(
outline_info
->
get_database_id
()
==
OB_OUTLINE_DEFAULT_DATABASE_ID
)
{
// __outline_default_db is a logical table and has no physical schema.
// Therefore, always output this.
is_output
=
true
;
}
else
if
(
OB_FAIL
(
is_database_recycle
(
outline_info
->
get_database_id
(),
is_recycle
)))
{
}
else
if
(
OB_FAIL
(
is_database_recycle
(
outline_info
->
get_database_id
(),
is_recycle
)))
{
LOG_WARN
(
"fail to judge database recycle"
,
K
(
ret
),
KPC
(
outline_info
));
LOG_WARN
(
"fail to judge database recycle"
,
K
(
ret
),
KPC
(
outline_info
));
}
else
{
}
else
{
...
...
src/rootserver/ob_ddl_service.cpp
浏览文件 @
f27ecbb7
...
@@ -18807,13 +18807,15 @@ int ObDDLService::drop_outline(const obrpc::ObDropOutlineArg& arg)
...
@@ -18807,13 +18807,15 @@ int ObDDLService::drop_outline(const obrpc::ObDropOutlineArg& arg)
uint64_t database_id = OB_INVALID_ID;
uint64_t database_id = OB_INVALID_ID;
if (OB_SUCC(ret)) {
if (OB_SUCC(ret)) {
bool database_exist = false;
bool database_exist = false;
if (OB_FAIL(schema_service_->check_database_exist(tenant_id, database_name, database_id, database_exist))) {
if (database_name == OB_OUTLINE_DEFAULT_DATABASE_NAME) {
LOG_WARN("failed to check database exist!",
database_id = OB_OUTLINE_DEFAULT_DATABASE_ID;
K(tenant_id),
database_exist = true;
K(database_name),
} else if (OB_FAIL(schema_service_->check_database_exist(tenant_id,
K(database_id),
database_name,
K(database_exist),
database_id,
K(ret));
database_exist))) {
LOG_WARN("failed to check database exist!", K(tenant_id), K(database_name),
K(database_id), K(database_exist), K(ret));
} else if (!database_exist) {
} else if (!database_exist) {
ret = OB_ERR_BAD_DATABASE;
ret = OB_ERR_BAD_DATABASE;
LOG_USER_ERROR(OB_ERR_BAD_DATABASE, database_name.length(), database_name.ptr());
LOG_USER_ERROR(OB_ERR_BAD_DATABASE, database_name.length(), database_name.ptr());
src/rootserver/ob_root_service.cpp
浏览文件 @
f27ecbb7
...
@@ -6357,6 +6357,9 @@ int ObRootService::create_outline(const ObCreateOutlineArg& arg)
...
@@ -6357,6 +6357,9 @@ int ObRootService::create_outline(const ObCreateOutlineArg& arg)
const
ObDatabaseSchema
*
db_schema
=
NULL
;
const
ObDatabaseSchema
*
db_schema
=
NULL
;
if
(
OB_FAIL
(
ddl_service_
.
get_tenant_schema_guard_with_version_in_inner_table
(
tenant_id
,
schema_guard
)))
{
if
(
OB_FAIL
(
ddl_service_
.
get_tenant_schema_guard_with_version_in_inner_table
(
tenant_id
,
schema_guard
)))
{
LOG_WARN
(
"get schema guard in inner table failed"
,
K
(
ret
));
LOG_WARN
(
"get schema guard in inner table failed"
,
K
(
ret
));
}
else
if
(
database_name
==
OB_OUTLINE_DEFAULT_DATABASE_NAME
)
{
// if not specify database, set default database name and database id;
outline_info
.
set_database_id
(
OB_OUTLINE_DEFAULT_DATABASE_ID
);
}
else
if
(
OB_FAIL
(
schema_guard
.
get_database_schema
(
tenant_id
,
database_name
,
db_schema
)))
{
}
else
if
(
OB_FAIL
(
schema_guard
.
get_database_schema
(
tenant_id
,
database_name
,
db_schema
)))
{
LOG_WARN
(
"get database schema failed"
,
K
(
ret
));
LOG_WARN
(
"get database schema failed"
,
K
(
ret
));
}
else
if
(
NULL
==
db_schema
)
{
}
else
if
(
NULL
==
db_schema
)
{
...
...
src/sql/engine/ob_physical_plan.h
浏览文件 @
f27ecbb7
...
@@ -90,18 +90,8 @@ public:
...
@@ -90,18 +90,8 @@ public:
virtual
void
destroy
();
virtual
void
destroy
();
virtual
void
reset
();
virtual
void
reset
();
void
set_is_last_open_succ
(
bool
val
)
void
set_is_last_exec_succ
(
bool
val
)
{
stat_
.
is_last_exec_succ_
=
val
;
}
{
bool
is_last_exec_succ
()
const
{
return
stat_
.
is_last_exec_succ_
;
}
stat_
.
is_last_open_succ_
=
val
;
}
bool
is_last_open_succ
()
const
{
return
stat_
.
is_last_open_succ_
;
}
bool
from_plan_baseline
()
const
{
return
common
::
OB_INVALID_ID
!=
stat_
.
bl_info_
.
plan_baseline_id_
;
}
const
ObString
&
get_constructed_sql
()
const
const
ObString
&
get_constructed_sql
()
const
{
{
return
stat_
.
bl_info_
.
key_
.
constructed_sql_
;
return
stat_
.
bl_info_
.
key_
.
constructed_sql_
;
...
...
src/sql/ob_result_set.cpp
浏览文件 @
f27ecbb7
...
@@ -128,12 +128,6 @@ OB_INLINE int ObResultSet::open_plan()
...
@@ -128,12 +128,6 @@ OB_INLINE int ObResultSet::open_plan()
}
}
}
}
}
}
if
(
OB_FAIL
(
ret
))
{
physical_plan_
->
set_is_last_open_succ
(
false
);
}
else
{
physical_plan_
->
set_is_last_open_succ
(
true
);
}
}
}
return
ret
;
return
ret
;
}
}
...
@@ -143,6 +137,19 @@ int ObResultSet::sync_open()
...
@@ -143,6 +137,19 @@ int ObResultSet::sync_open()
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
OZ
(
execute
());
OZ
(
execute
());
OZ
(
open
());
OZ
(
open
());
if
(
OB_NOT_NULL
(
cmd_
))
{
// cmd not set
}
else
if
(
ret
==
OB_NOT_INIT
)
{
// phy plan not init, do nothing
}
else
if
(
OB_ISNULL
(
physical_plan_
))
{
LOG_WARN
(
"empty physical plan"
);
}
else
if
(
OB_FAIL
(
ret
))
{
physical_plan_
->
set_is_last_exec_succ
(
false
);
}
else
{
physical_plan_
->
set_is_last_exec_succ
(
true
);
}
return
ret
;
return
ret
;
}
}
...
@@ -478,12 +485,15 @@ OB_INLINE int ObResultSet::end_participant(const bool is_rollback)
...
@@ -478,12 +485,15 @@ OB_INLINE int ObResultSet::end_participant(const bool is_rollback)
int
ObResultSet
::
get_next_row
(
const
common
::
ObNewRow
*&
row
)
int
ObResultSet
::
get_next_row
(
const
common
::
ObNewRow
*&
row
)
{
{
int
&
ret
=
errcode_
;
int
&
ret
=
errcode_
;
if
(
OB_LIKELY
(
NULL
!=
physical_plan_
))
{
// take this branch more frequently
// last_exec_succ default values is true
if
(
OB_LIKELY
(
NULL
!=
physical_plan_
))
{
// take this branch more frequently
if
(
OB_ISNULL
(
exec_result_
))
{
if
(
OB_ISNULL
(
exec_result_
))
{
ret
=
OB_ERR_UNEXPECTED
;
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"exec result is null"
,
K
(
ret
));
LOG_WARN
(
"exec result is null"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
exec_result_
->
get_next_row
(
get_exec_context
(),
row
)))
{
}
else
if
(
OB_FAIL
(
exec_result_
->
get_next_row
(
get_exec_context
(),
row
)))
{
if
(
OB_ITER_END
!=
ret
)
{
if
(
OB_ITER_END
!=
ret
)
{
// marked last execute status
physical_plan_
->
set_is_last_exec_succ
(
false
);
LOG_WARN
(
"get next row from exec result failed"
,
K
(
ret
));
LOG_WARN
(
"get next row from exec result failed"
,
K
(
ret
));
}
}
}
else
{
}
else
{
...
...
src/sql/ob_sql.cpp
浏览文件 @
f27ecbb7
...
@@ -1154,13 +1154,20 @@ inline int ObSql::handle_text_query(const ObString& stmt, ObSqlCtx& context, ObR
...
@@ -1154,13 +1154,20 @@ inline int ObSql::handle_text_query(const ObString& stmt, ObSqlCtx& context, ObR
}
else
{
}
else
{
context
.
cur_sql_
=
trimed_stmt
;
context
.
cur_sql_
=
trimed_stmt
;
pc_ctx
=
new
(
pc_ctx
)
ObPlanCacheCtx
(
trimed_stmt
,
pc_ctx
=
new
(
pc_ctx
)
ObPlanCacheCtx
(
trimed_stmt
,
false
,
/*is_ps_mode*/
false
,
/*is_ps_mode*/
allocator
,
allocator
,
context
,
context
,
ectx
,
ectx
,
tenant_id
);
tenant_id
);
if
(
OB_FAIL
(
session
.
get_database_id
(
pc_ctx
->
bl_key_
.
db_id_
)))
{
uint64_t
database_id
=
OB_INVALID_ID
;
if
(
OB_FAIL
(
session
.
get_database_id
(
database_id
)))
{
LOG_WARN
(
"Failed to get database id"
,
K
(
ret
));
LOG_WARN
(
"Failed to get database id"
,
K
(
ret
));
}
else
if
(
FALSE_IT
(
pc_ctx
->
bl_key_
.
db_id_
=
(
database_id
==
OB_INVALID_ID
)
?
OB_OUTLINE_DEFAULT_DATABASE_ID:
database_id
))
{
// do nothing
}
else
if
(
!
use_plan_cache
)
{
}
else
if
(
!
use_plan_cache
)
{
if
(
context
.
multi_stmt_item_
.
is_batched_multi_stmt
())
{
if
(
context
.
multi_stmt_item_
.
is_batched_multi_stmt
())
{
ret
=
OB_BATCHED_MULTI_STMT_ROLLBACK
;
ret
=
OB_BATCHED_MULTI_STMT_ROLLBACK
;
...
...
src/sql/plan_cache/ob_plan_cache.cpp
浏览文件 @
f27ecbb7
...
@@ -1606,8 +1606,13 @@ int ObPlanCache::construct_plan_cache_key(ObPlanCacheCtx& plan_ctx, ObjNameSpace
...
@@ -1606,8 +1606,13 @@ int ObPlanCache::construct_plan_cache_key(ObPlanCacheCtx& plan_ctx, ObjNameSpace
int
ObPlanCache
::
construct_plan_cache_key
(
ObSQLSessionInfo
&
session
,
ObjNameSpace
ns
,
ObPlanCacheKey
&
pc_key
)
int
ObPlanCache
::
construct_plan_cache_key
(
ObSQLSessionInfo
&
session
,
ObjNameSpace
ns
,
ObPlanCacheKey
&
pc_key
)
{
{
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
if
(
OB_FAIL
(
session
.
get_database_id
(
pc_key
.
db_id_
)))
{
uint64_t
database_id
=
OB_INVALID_ID
;
if
(
OB_FAIL
(
session
.
get_database_id
(
database_id
)))
{
LOG_WARN
(
"get database id failed"
,
K
(
ret
));
LOG_WARN
(
"get database id failed"
,
K
(
ret
));
}
else
if
(
FALSE_IT
(
pc_key
.
db_id_
=
(
database_id
==
OB_INVALID_ID
)
?
OB_OUTLINE_DEFAULT_DATABASE_ID
:
database_id
))
{
// do nothing
}
else
{
}
else
{
pc_key
.
namespace_
=
ns
;
pc_key
.
namespace_
=
ns
;
pc_key
.
sys_vars_str_
=
session
.
get_sys_var_in_pc_str
();
pc_key
.
sys_vars_str_
=
session
.
get_sys_var_in_pc_str
();
...
...
src/sql/plan_cache/ob_plan_cache.h
浏览文件 @
f27ecbb7
...
@@ -294,11 +294,11 @@ public:
...
@@ -294,11 +294,11 @@ public:
int
dump_all_objs
()
const
;
int
dump_all_objs
()
const
;
template
<
DumpType
dump_type
>
template
<
DumpType
dump_type
>
int
dump_deleted_objs
(
common
::
ObIArray
<
DeletedCacheObjInfo
>&
deleted_objs
,
const
int64_t
safe_timestamp
)
const
;
int
dump_deleted_objs
(
common
::
ObIArray
<
DeletedCacheObjInfo
>&
deleted_objs
,
const
int64_t
safe_timestamp
)
const
;
static
common
::
ObMemAttr
get_mem_attr
()
common
::
ObMemAttr
get_mem_attr
()
{
{
common
::
ObMemAttr
attr
;
common
::
ObMemAttr
attr
;
attr
.
label_
=
ObNewModIds
::
OB_SQL_PLAN_CACHE
;
attr
.
label_
=
ObNewModIds
::
OB_SQL_PLAN_CACHE
;
attr
.
tenant_id_
=
OB_INVALID_ID
;
attr
.
tenant_id_
=
tenant_id_
;
attr
.
ctx_id_
=
ObCtxIds
::
PLAN_CACHE_CTX_ID
;
attr
.
ctx_id_
=
ObCtxIds
::
PLAN_CACHE_CTX_ID
;
return
attr
;
return
attr
;
}
}
...
...
src/sql/plan_cache/ob_plan_cache_util.h
浏览文件 @
f27ecbb7
...
@@ -698,7 +698,7 @@ struct ObPlanStat {
...
@@ -698,7 +698,7 @@ struct ObPlanStat {
int64_t
expected_worker_count_
;
int64_t
expected_worker_count_
;
int64_t
outline_version_
;
int64_t
outline_version_
;
int64_t
outline_id_
;
int64_t
outline_id_
;
bool
is_last_
open
_succ_
;
bool
is_last_
exec
_succ_
;
common
::
ObString
sp_info_str_
;
common
::
ObString
sp_info_str_
;
common
::
ObString
param_infos_
;
common
::
ObString
param_infos_
;
common
::
ObString
sys_vars_str_
;
common
::
ObString
sys_vars_str_
;
...
@@ -782,7 +782,7 @@ struct ObPlanStat {
...
@@ -782,7 +782,7 @@ struct ObPlanStat {
expected_worker_count_
(
-
1
),
expected_worker_count_
(
-
1
),
outline_version_
(
common
::
OB_INVALID_VERSION
),
outline_version_
(
common
::
OB_INVALID_VERSION
),
outline_id_
(
common
::
OB_INVALID_ID
),
outline_id_
(
common
::
OB_INVALID_ID
),
is_last_
open
_succ_
(
true
),
is_last_
exec
_succ_
(
true
),
is_evolution_
(
false
),
is_evolution_
(
false
),
asyn_baseline_stat_
(
ASYN_NOTHING
),
asyn_baseline_stat_
(
ASYN_NOTHING
),
is_bind_sensitive_
(
false
),
is_bind_sensitive_
(
false
),
...
@@ -847,7 +847,7 @@ struct ObPlanStat {
...
@@ -847,7 +847,7 @@ struct ObPlanStat {
expected_worker_count_
(
rhs
.
expected_worker_count_
),
expected_worker_count_
(
rhs
.
expected_worker_count_
),
outline_version_
(
rhs
.
outline_version_
),
outline_version_
(
rhs
.
outline_version_
),
outline_id_
(
rhs
.
outline_id_
),
outline_id_
(
rhs
.
outline_id_
),
is_last_
open_succ_
(
rhs
.
is_last_open
_succ_
),
is_last_
exec_succ_
(
rhs
.
is_last_exec
_succ_
),
is_evolution_
(
rhs
.
is_evolution_
),
is_evolution_
(
rhs
.
is_evolution_
),
asyn_baseline_stat_
(
rhs
.
asyn_baseline_stat_
),
asyn_baseline_stat_
(
rhs
.
asyn_baseline_stat_
),
bl_info_
(
rhs
.
bl_info_
),
bl_info_
(
rhs
.
bl_info_
),
...
@@ -996,7 +996,7 @@ struct ObPlanStat {
...
@@ -996,7 +996,7 @@ struct ObPlanStat {
K_
(
execute_times
),
K_
(
disk_reads
),
K_
(
direct_writes
),
K_
(
buffer_gets
),
K_
(
application_wait_time
),
K_
(
execute_times
),
K_
(
disk_reads
),
K_
(
direct_writes
),
K_
(
buffer_gets
),
K_
(
application_wait_time
),
K_
(
concurrency_wait_time
),
K_
(
user_io_wait_time
),
K_
(
rows_processed
),
K_
(
elapsed_time
),
K_
(
cpu_time
),
K_
(
concurrency_wait_time
),
K_
(
user_io_wait_time
),
K_
(
rows_processed
),
K_
(
elapsed_time
),
K_
(
cpu_time
),
K_
(
large_querys
),
K_
(
delayed_large_querys
),
K_
(
outline_version
),
K_
(
outline_id
),
K_
(
is_evolution
),
K_
(
large_querys
),
K_
(
delayed_large_querys
),
K_
(
outline_version
),
K_
(
outline_id
),
K_
(
is_evolution
),
K_
(
is_last_
open_succ
),
K_
(
is_bind_sensitive
),
K_
(
is_bind_aware
),
K_
(
is_last_open
_succ
),
K_
(
timeout_count
),
K_
(
is_last_
exec_succ
),
K_
(
is_bind_sensitive
),
K_
(
is_bind_aware
),
K_
(
is_last_exec
_succ
),
K_
(
timeout_count
),
K_
(
bl_info
));
K_
(
bl_info
));
};
};
...
...
src/sql/plan_cache/ob_plan_cache_value.cpp
浏览文件 @
f27ecbb7
...
@@ -151,10 +151,12 @@ ObPlanCacheValue::ObPlanCacheValue()
...
@@ -151,10 +151,12 @@ ObPlanCacheValue::ObPlanCacheValue()
int
ObPlanCacheValue
::
init
(
ObPCVSet
*
pcv_set
,
const
ObCacheObject
*
cache_obj
,
ObPlanCacheCtx
&
pc_ctx
)
int
ObPlanCacheValue
::
init
(
ObPCVSet
*
pcv_set
,
const
ObCacheObject
*
cache_obj
,
ObPlanCacheCtx
&
pc_ctx
)
{
{
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
ObMemAttr
mem_attr
=
ObPlanCache
::
get_mem_attr
()
;
ObMemAttr
mem_attr
;
if
(
OB_ISNULL
(
pcv_set
)
||
OB_ISNULL
(
cache_obj
))
{
if
(
OB_ISNULL
(
pcv_set
)
||
OB_ISNULL
(
cache_obj
)
||
OB_ISNULL
(
pcv_set
->
get_plan_cache
())
)
{
ret
=
OB_INVALID_ARGUMENT
;
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
pcv_set
),
K
(
cache_obj
));
LOG_WARN
(
"invalid argument"
,
K
(
pcv_set
),
K
(
cache_obj
));
}
else
if
(
FALSE_IT
(
mem_attr
=
pcv_set
->
get_plan_cache
()
->
get_mem_attr
()))
{
// do nothing
}
else
if
(
OB_ISNULL
(
pc_alloc_
=
pcv_set
->
get_pc_allocator
()))
{
}
else
if
(
OB_ISNULL
(
pc_alloc_
=
pcv_set
->
get_pc_allocator
()))
{
LOG_WARN
(
"invalid argument"
,
K
(
pcv_set
->
get_pc_allocator
()));
LOG_WARN
(
"invalid argument"
,
K
(
pcv_set
->
get_pc_allocator
()));
}
else
if
(
OB_FAIL
(
outline_params_wrapper_
.
set_allocator
(
pc_alloc_
,
mem_attr
)))
{
}
else
if
(
OB_FAIL
(
outline_params_wrapper_
.
set_allocator
(
pc_alloc_
,
mem_attr
)))
{
...
@@ -840,6 +842,20 @@ void ObPlanCacheValue::reset()
...
@@ -840,6 +842,20 @@ void ObPlanCacheValue::reset()
not_param_info_
.
at
(
i
).
raw_text_
.
reset
();
not_param_info_
.
at
(
i
).
raw_text_
.
reset
();
}
}
}
}
for
(
int64_t
i
=
0
;
i
<
not_param_var_
.
count
();
i
++
)
{
// deep-copy destory
// free v
ObObjParam
param
=
not_param_var_
.
at
(
i
).
ps_param_
;
void
*
ptr
=
param
.
get_deep_copy_obj_ptr
();
if
(
NULL
==
ptr
){
// do nothing
}
else
{
pc_alloc_
->
free
(
ptr
);
not_param_var_
.
at
(
i
).
ps_param_
.
reset
();
}
}
if
(
NULL
!=
outline_signature_
.
ptr
())
{
if
(
NULL
!=
outline_signature_
.
ptr
())
{
pc_alloc_
->
free
(
outline_signature_
.
ptr
());
pc_alloc_
->
free
(
outline_signature_
.
ptr
());
outline_signature_
.
reset
();
outline_signature_
.
reset
();
...
@@ -851,6 +867,7 @@ void ObPlanCacheValue::reset()
...
@@ -851,6 +867,7 @@ void ObPlanCacheValue::reset()
}
}
not_param_info_
.
reset
();
not_param_info_
.
reset
();
not_param_index_
.
reset
();
not_param_index_
.
reset
();
not_param_var_
.
reset
();
neg_param_index_
.
reset
();
neg_param_index_
.
reset
();
param_charset_type_
.
reset
();
param_charset_type_
.
reset
();
sql_traits_
.
reset
();
sql_traits_
.
reset
();
...
...
src/sql/plan_cache/ob_plan_set.cpp
浏览文件 @
f27ecbb7
...
@@ -1195,8 +1195,9 @@ int ObSqlPlanSet::get_local_plan_direct(ObPlanCacheCtx& pc_ctx, bool& is_direct_
...
@@ -1195,8 +1195,9 @@ int ObSqlPlanSet::get_local_plan_direct(ObPlanCacheCtx& pc_ctx, bool& is_direct_
plan
=
local_plan_
;
plan
=
local_plan_
;
}
}
if
(
OB_SUCC
(
ret
)
&&
plan
!=
NULL
)
{
if
(
OB_SUCC
(
ret
)
&&
plan
!=
NULL
)
{
int
last_retry_err
=
pc_ctx
.
sql_ctx_
.
session_info_
->
get_retry_info
().
get_last_query_retry_err
();
int
last_retry_err
=
pc_ctx
.
sql_ctx_
.
session_info_
if
(
plan
->
is_last_open_succ
())
{
->
get_retry_info
().
get_last_query_retry_err
();
if
(
plan
->
is_last_exec_succ
())
{
is_direct_local_plan
=
true
;
is_direct_local_plan
=
true
;
}
else
if
(
pc_ctx
.
sql_ctx_
.
session_info_
->
get_is_in_retry
()
&&
is_local_plan_opt_allowed
(
last_retry_err
))
{
}
else
if
(
pc_ctx
.
sql_ctx_
.
session_info_
->
get_is_in_retry
()
&&
is_local_plan_opt_allowed
(
last_retry_err
))
{
is_direct_local_plan
=
true
;
is_direct_local_plan
=
true
;
...
...
src/sql/resolver/ddl/ob_outline_resolver.cpp
浏览文件 @
f27ecbb7
...
@@ -60,8 +60,7 @@ int ObOutlineResolver::resolve_outline_name(const ParseNode* node, ObString& db_
...
@@ -60,8 +60,7 @@ int ObOutlineResolver::resolve_outline_name(const ParseNode* node, ObString& db_
bool
perserve_lettercase
=
share
::
is_oracle_mode
()
?
true
:
(
mode
!=
OB_LOWERCASE_AND_INSENSITIVE
);
bool
perserve_lettercase
=
share
::
is_oracle_mode
()
?
true
:
(
mode
!=
OB_LOWERCASE_AND_INSENSITIVE
);
if
(
NULL
==
db_name_node
)
{
if
(
NULL
==
db_name_node
)
{
if
(
session_info_
->
get_database_name
().
empty
())
{
if
(
session_info_
->
get_database_name
().
empty
())
{
ret
=
OB_ERR_NO_DB_SELECTED
;
db_name
=
OB_OUTLINE_DEFAULT_DATABASE_NAME
;
LOG_WARN
(
"no database selected"
);
}
else
{
}
else
{
db_name
=
session_info_
->
get_database_name
();
db_name
=
session_info_
->
get_database_name
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录