Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Messij2001
oceanbase
提交
5baefa81
O
oceanbase
项目概览
Messij2001
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
2
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,发现更多精彩内容 >>
提交
5baefa81
编写于
10月 18, 2021
作者:
N
nroskill
提交者:
wangzelin.wzl
10月 18, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support _enable_fatal_error_hang
上级
9c8cca0f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
58 addition
and
38 deletion
+58
-38
CMakeLists.txt
CMakeLists.txt
+6
-0
deps/oblib/src/common/object/ob_obj_type.h
deps/oblib/src/common/object/ob_obj_type.h
+3
-1
deps/oblib/src/lib/charset/ob_ctype.h
deps/oblib/src/lib/charset/ob_ctype.h
+2
-0
deps/oblib/src/lib/timezone/ob_time_convert.cpp
deps/oblib/src/lib/timezone/ob_time_convert.cpp
+18
-0
deps/oblib/src/lib/timezone/ob_time_convert.h
deps/oblib/src/lib/timezone/ob_time_convert.h
+3
-6
deps/oblib/src/lib/utility/ob_hang_fatal_error.cpp
deps/oblib/src/lib/utility/ob_hang_fatal_error.cpp
+14
-6
deps/oblib/src/lib/utility/ob_hang_fatal_error.h
deps/oblib/src/lib/utility/ob_hang_fatal_error.h
+12
-25
未找到文件。
CMakeLists.txt
浏览文件 @
5baefa81
...
...
@@ -10,6 +10,7 @@ project("OceanBase CE"
LANGUAGES CXX C ASM
)
ob_define
(
WITH_OSS OFF
)
ob_define
(
ENABLE_FATAL_ERROR_HANG OFF
)
if
(
ENABLE_DEBUG_LOG
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-DENABLE_DEBUG_LOG"
)
...
...
@@ -26,6 +27,11 @@ if(OB_USE_ASAN)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DOB_USE_ASAN"
)
endif
()
if
(
ENABLE_FATAL_ERROR_HANG
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-DFATAL_ERROR_HANG"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DFATAL_ERROR_HANG"
)
endif
()
message
(
STATUS
"This is BINARY dir "
${
PROJECT_BINARY_DIR
}
)
message
(
STATUS
"This is SOURCE dir "
${
PROJECT_SOURCE_DIR
}
)
...
...
deps/oblib/src/common/object/ob_obj_type.h
浏览文件 @
5baefa81
...
...
@@ -14,11 +14,13 @@
#define OCEANBASE_COMMON_OB_OBJECT_TYPE_H_
#include "lib/utility/ob_print_utils.h"
#include "lib/charset/ob_charset.h"
#include "lib/container/ob_iarray.h"
namespace
oceanbase
{
namespace
common
{
class
ObObjMeta
;
class
ObAccuracy
;
template
<
class
T
>
class
ObIArray
;
// we can append new type only, do NOT delete nor change order,
// modify ObObjTypeClass and ob_obj_type_class when append new object type.
...
...
deps/oblib/src/lib/charset/ob_ctype.h
浏览文件 @
5baefa81
...
...
@@ -100,6 +100,8 @@ extern "C" {
#define ob_isgraph(s, c) ((s)->ctype != NULL ? ((s)->ctype + 1)[(uchar)(c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR) : 0)
#define ob_iscntrl(s, c) ((s)->ctype != NULL ? ((s)->ctype + 1)[(uchar)(c)] & _MY_CTR : 0)
extern
void
right_to_die_or_duty_to_live_c
();
#define ob_charset_assert(condition) \
if (!(condition)) { \
right_to_die_or_duty_to_live_c(); \
...
...
deps/oblib/src/lib/timezone/ob_time_convert.cpp
浏览文件 @
5baefa81
...
...
@@ -411,6 +411,24 @@ int ObTime::set_tzd_abbr(const ObString& tzd_abbr)
return
ret
;
}
DEF_TO_STRING
(
ObTime
)
{
int64_t
pos
=
0
;
J_OBJ_START
();
J_KV
(
K
(
mode_
),
"parts"
,
ObArrayWrap
<
int32_t
>
(
parts_
,
TOTAL_PART_CNT
),
"tz_name"
,
ObString
(
OB_MAX_TZ_NAME_LEN
,
tz_name_
),
"tzd_abbr"
,
ObString
(
OB_MAX_TZ_ABBR_LEN
,
tzd_abbr_
),
K_
(
time_zone_id
),
K_
(
transition_type_id
),
K_
(
is_tz_name_valid
));
J_OBJ_END
();
return
pos
;
}
////////////////////////////////
// int / double / string -> datetime / date / time / year.
int
ObTimeConverter
::
int_to_datetime
(
...
...
deps/oblib/src/lib/timezone/ob_time_convert.h
浏览文件 @
5baefa81
...
...
@@ -17,7 +17,6 @@
//#include "lib/timezone/ob_timezone_info.h"
#include "lib/string/ob_string.h"
#include "lib/ob_date_unit_type.h"
#include "lib/container/ob_array_wrap.h"
#include "common/object/ob_obj_type.h"
#include "common/ob_accuracy.h"
...
...
@@ -223,11 +222,9 @@ public:
{
return
ObString
(
strlen
(
tzd_abbr_
),
tzd_abbr_
);
}
int
set_tz_name
(
const
ObString
&
tz_name
);
int
set_tzd_abbr
(
const
ObString
&
tz_abbr
);
TO_STRING_KV
(
K
(
mode_
),
"parts"
,
ObArrayWrap
<
int32_t
>
(
parts_
,
TOTAL_PART_CNT
),
"tz_name"
,
ObString
(
OB_MAX_TZ_NAME_LEN
,
tz_name_
),
"tzd_abbr"
,
ObString
(
OB_MAX_TZ_ABBR_LEN
,
tzd_abbr_
),
K_
(
time_zone_id
),
K_
(
transition_type_id
),
K_
(
is_tz_name_valid
));
int
set_tz_name
(
const
ObString
&
tz_name
);
int
set_tzd_abbr
(
const
ObString
&
tz_abbr
);
DECLARE_TO_STRING
;
ObDTMode
mode_
;
int32_t
parts_
[
TOTAL_PART_CNT
];
// year: [1000, 9999].
...
...
deps/oblib/src/lib/utility/ob_hang_fatal_error.cpp
浏览文件 @
5baefa81
...
...
@@ -14,21 +14,29 @@
#include "lib/utility/ob_print_utils.h"
#include "common/ob_common_utility.h"
namespace
oceanbase
{
namespace
common
{
extern
"C"
{
void
right_to_die_or_duty_to_live_c
()
{
right_to_die_or_duty_to_live
();
::
oceanbase
::
common
::
right_to_die_or_duty_to_live
();
}
}
namespace
oceanbase
{
namespace
common
{
// To die or to live, it's a problem.
void
right_to_die_or_duty_to_live
()
{
const
ObFatalErrExtraInfoGuard
*
extra_info
=
ObFatalErrExtraInfoGuard
::
get_thd_local_val_ptr
();
const
ObFatalErrExtraInfoGuard
*
extra_info
=
ObFatalErrExtraInfoGuard
::
get_thd_local_val_ptr
();
BACKTRACE
(
ERROR
,
true
,
"Trying so hard to die, extra_info=(%s)"
,
(
NULL
==
extra_info
)
?
NULL
:
to_cstring
(
*
extra_info
));
#ifdef FATAL_ERROR_HANG
while
(
true
)
{
sleep
(
120
);
}
#else
throw
OB_EXCEPTION
<
OB_ERR_UNEXPECTED
>
();
_OB_LOG
(
ERROR
,
"Trying very hard to live"
);
#endif
}
}
// namespace common
...
...
deps/oblib/src/lib/utility/ob_hang_fatal_error.h
浏览文件 @
5baefa81
...
...
@@ -14,37 +14,24 @@
#define SRC_LIB_UTILITY_OB_HANG_FATAL_ERROR_H_
#include <exception>
namespace
oceanbase
{
namespace
common
{
extern
void
right_to_die_or_duty_to_live
();
namespace
oceanbase
{
namespace
common
{
extern
"C"
{
extern
void
right_to_die_or_duty_to_live_c
();
}
struct
OB_BASE_EXCEPTION
:
public
std
::
exception
{
virtual
const
char
*
what
()
const
throw
()
override
{
return
nullptr
;
}
virtual
int
get_errno
()
{
return
0
;
}
struct
OB_BASE_EXCEPTION
:
public
std
::
exception
{
virtual
const
char
*
what
()
const
throw
()
override
{
return
nullptr
;
}
virtual
int
get_errno
()
{
return
0
;
}
};
template
<
int
ERRNO
>
struct
OB_EXCEPTION
:
public
OB_BASE_EXCEPTION
{
virtual
int
get_errno
()
{
return
ERRNO
;
}
struct
OB_EXCEPTION
:
public
OB_BASE_EXCEPTION
{
virtual
int
get_errno
()
{
return
ERRNO
;
}
};
// Hang th thread.
// To die or to live, it's a problem.
extern
void
right_to_die_or_duty_to_live
();
}
// namespace common
}
// namespace oceanbase
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录