diff --git a/deps/oblib/src/common/ob_smart_call.h b/deps/oblib/src/common/ob_smart_call.h index fe2c3adaa2594b547bc13c6b0d76787c34668476..e873244426dc0c59ab295870edabac779052c8f3 100644 --- a/deps/oblib/src/common/ob_smart_call.h +++ b/deps/oblib/src/common/ob_smart_call.h @@ -102,11 +102,17 @@ inline int call_with_new_stack(SContext& sctx) ret; \ }) #else -#define SMART_CALL(func) \ - ({ \ - int ret = OB_SUCCESS; \ - ret = func; \ - ret; \ +#define SMART_CALL(func) \ + ({ \ + int ret = OB_SUCCESS; \ + bool is_overflow = false; \ + if (OB_FAIL(check_stack_overflow(is_overflow, STACK_RESERVED_SIZE))) { \ + } else if (!is_overflow) { \ + ret = func; \ + } else { \ + ret = OB_STACK_OVERFLOW; \ + } \ + ret; \ }) #endif } // end of namespace common diff --git a/src/share/ob_errno.cpp b/src/share/ob_errno.cpp index 44a2ba108187f54d505b6e3f6f40437de86c54ae..778efa392ab7a1b9cbcca524d0319166f660893f 100644 --- a/src/share/ob_errno.cpp +++ b/src/share/ob_errno.cpp @@ -3318,6 +3318,16 @@ static struct ObStrErrorInit ORACLE_ERRNO[-OB_CLUSTER_NAME_HASH_CONFLICT] = 600; ORACLE_STR_ERROR[-OB_CLUSTER_NAME_HASH_CONFLICT] = "ORA-00600: internal error code, arguments: -4378, cluster name conflict"; ORACLE_STR_USER_ERROR[-OB_CLUSTER_NAME_HASH_CONFLICT] = "ORA-00600: internal error code, arguments: -4378, cluster name conflict"; + ERROR_NAME[-OB_STACK_OVERFLOW] = "OB_STACK_OVERFLOW"; + ERROR_CAUSE[-OB_STACK_OVERFLOW] = "Internal Error"; + ERROR_SOLUTION[-OB_STACK_OVERFLOW] = "Contact OceanBase Support"; + MYSQL_ERRNO[-OB_STACK_OVERFLOW] = -1; + SQLSTATE[-OB_STACK_OVERFLOW] = "HY000"; + STR_ERROR[-OB_STACK_OVERFLOW] = "stack overflow"; + STR_USER_ERROR[-OB_STACK_OVERFLOW] = "stack overflow"; + ORACLE_ERRNO[-OB_STACK_OVERFLOW] = 600; + ORACLE_STR_ERROR[-OB_STACK_OVERFLOW] = "ORA-00600: internal error code, arguments: -4385, stack overflow"; + ORACLE_STR_USER_ERROR[-OB_STACK_OVERFLOW] = "ORA-00600: internal error code, arguments: -4385, stack overflow"; ERROR_NAME[-OB_IMPORT_NOT_IN_SERVER] = "OB_IMPORT_NOT_IN_SERVER"; ERROR_CAUSE[-OB_IMPORT_NOT_IN_SERVER] = "Internal Error"; ERROR_SOLUTION[-OB_IMPORT_NOT_IN_SERVER] = "Contact OceanBase Support"; diff --git a/src/share/ob_errno.def b/src/share/ob_errno.def index 0f8e6decc219a518361506db95724861aef3c41d..e56d96e9034dc5911f31237d2d63a5a022ccf23a 100644 --- a/src/share/ob_errno.def +++ b/src/share/ob_errno.def @@ -423,6 +423,7 @@ DEFINE_ERROR(OB_DISK_ERROR, -4375, -1, "HY000", "observer has disk error"); DEFINE_ORACLE_ERROR(OB_UNIMPLEMENTED_FEATURE, -4376, -1, "HY000", "unimplemented feature", 3001, "unimplemented feature"); DEFINE_ERROR_EXT(OB_ERR_DEFENSIVE_CHECK, -4377, -1, "HY000", "fatal internal error", "fatal internal error in [%.*s]"); DEFINE_ERROR(OB_CLUSTER_NAME_HASH_CONFLICT, -4378, -1, "HY000", "cluster name conflict"); +DEFINE_ERROR(OB_STACK_OVERFLOW, -4385, -1, "HY000", "stack overflow"); //////////////////////////////////////////////////////////////// //error code for root server & server management -4500 ---- -5000 diff --git a/src/share/ob_errno.h b/src/share/ob_errno.h index 1af34bb32cfe8b4697f2e1276c7e3ff2247496a2..15c2b21c4077f147a37fd68ec483c92b0b81b88d 100644 --- a/src/share/ob_errno.h +++ b/src/share/ob_errno.h @@ -238,6 +238,7 @@ constexpr int OB_DISK_ERROR = -4375; constexpr int OB_UNIMPLEMENTED_FEATURE = -4376; constexpr int OB_ERR_DEFENSIVE_CHECK = -4377; constexpr int OB_CLUSTER_NAME_HASH_CONFLICT = -4378; +constexpr int OB_STACK_OVERFLOW = -4385; constexpr int OB_IMPORT_NOT_IN_SERVER = -4505; constexpr int OB_CONVERT_ERROR = -4507; constexpr int OB_BYPASS_TIMEOUT = -4510; @@ -1572,6 +1573,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_UNIMPLEMENTED_FEATURE__USER_ERROR_MSG "unimplemented feature" #define OB_ERR_DEFENSIVE_CHECK__USER_ERROR_MSG "fatal internal error in [%.*s]" #define OB_CLUSTER_NAME_HASH_CONFLICT__USER_ERROR_MSG "cluster name conflict" +#define OB_STACK_OVERFLOW__USER_ERROR_MSG "stack overflow" #define OB_IMPORT_NOT_IN_SERVER__USER_ERROR_MSG "Import not in service" #define OB_CONVERT_ERROR__USER_ERROR_MSG "Convert error" #define OB_BYPASS_TIMEOUT__USER_ERROR_MSG "Bypass timeout" @@ -3029,6 +3031,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_UNIMPLEMENTED_FEATURE__ORA_USER_ERROR_MSG "ORA-03001: unimplemented feature" #define OB_ERR_DEFENSIVE_CHECK__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -4377, fatal internal error in [%.*s]" #define OB_CLUSTER_NAME_HASH_CONFLICT__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -4378, cluster name conflict" +#define OB_STACK_OVERFLOW__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -4385, stack overflow" #define OB_IMPORT_NOT_IN_SERVER__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -4505, Import not in service" #define OB_CONVERT_ERROR__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -4507, Convert error" #define OB_BYPASS_TIMEOUT__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -4510, Bypass timeout"