diff --git a/src/observer/mysql/obmp_stmt_execute.cpp b/src/observer/mysql/obmp_stmt_execute.cpp index 46007590b6..71bb10b08e 100644 --- a/src/observer/mysql/obmp_stmt_execute.cpp +++ b/src/observer/mysql/obmp_stmt_execute.cpp @@ -63,6 +63,19 @@ using namespace sql; using namespace pl; namespace observer { +inline int ObPSAnalysisChecker::detection(const int64_t len) +{ + int ret = OB_SUCCESS; + if (!need_check_) { + } else if (*pos_ + len > end_pos_) { + ret = OB_ERR_MALFORMED_PS_PACKET; + LOG_USER_ERROR(OB_ERR_MALFORMED_PS_PACKET); + LOG_ERROR("malformed ps data packet, please check the number and content of data packet parameters", K(ret), KP(pos_), KP(begin_pos_), + K(end_pos_ - begin_pos_), K(len), K(data_len_), K(remain_len())); + } + return ret; +} + ObMPStmtExecute::ObMPStmtExecute(const ObGlobalContext &gctx) : ObMPBase(gctx), retry_ctrl_(/*ctx_.retry_info_*/), @@ -506,28 +519,32 @@ int ObMPStmtExecute::before_process() } const ObMySQLRawPacket &pkt = reinterpret_cast(req_->get_packet()); const char* pos = pkt.get_cdata(); + analysis_checker_.init(pos, pkt.get_clen()); int32_t stmt_id = -1; //INVALID_STMT_ID - ObMySQLUtil::get_int4(pos, stmt_id); - stmt_id_ = stmt_id; - - // pos += 1; //skip flags - int8_t flag = 0; - ObMySQLUtil::get_int1(pos, flag); - const uint8_t ARRAYBINDING_MODE = 8; - const uint8_t SAVE_EXCEPTION_MODE = 16; - is_arraybinding_ = flag & ARRAYBINDING_MODE; - is_save_exception_ = flag & SAVE_EXCEPTION_MODE; - ps_cursor_type_ = 0 != (flag & CURSOR_TYPE_READ_ONLY) - ? ObExecutePsCursorType - : ObNormalType; - - // 4 bytes, iteration-count, used for checksum uint32_t ps_stmt_checksum = 0; - ObMySQLUtil::get_uint4(pos, ps_stmt_checksum); - ObSQLSessionInfo *session = NULL; - if (is_arraybinding_) { - OZ (init_for_arraybinding(alloc)); + PS_DEFENSE_CHECK(9) // stmt_id(4) + flag(1) + checksum(4) + { + ObMySQLUtil::get_int4(pos, stmt_id); + stmt_id_ = stmt_id; + + // pos += 1; //skip flags + int8_t flag = 0; + ObMySQLUtil::get_int1(pos, flag); + const uint8_t ARRAYBINDING_MODE = 8; + const uint8_t SAVE_EXCEPTION_MODE = 16; + is_arraybinding_ = flag & ARRAYBINDING_MODE; + is_save_exception_ = flag & SAVE_EXCEPTION_MODE; + ps_cursor_type_ = 0 != (flag & CURSOR_TYPE_READ_ONLY) + ? ObExecutePsCursorType + : ObNormalType; + + // 4 bytes, iteration-count, used for checksum + ObMySQLUtil::get_uint4(pos, ps_stmt_checksum); + + if (is_arraybinding_) { + OZ (init_for_arraybinding(alloc)); + } } if (OB_FAIL(ret)) { } else if (OB_FAIL(get_session(session))) { @@ -611,10 +628,13 @@ int ObMPStmtExecute::parse_request_type(const char* &pos, uint8_t type = 0; int8_t flag = 0; if (1 == new_param_bound_flag) { - ObMySQLUtil::get_uint1(pos, type); - ObMySQLUtil::get_int1(pos, flag); - if (OB_FAIL(param_types.push_back(static_cast(type)))) { - LOG_WARN("fail to push back", K(type), K(i)); + PS_DEFENSE_CHECK(2) // type(1) + flag(1) + { + ObMySQLUtil::get_uint1(pos, type); + ObMySQLUtil::get_int1(pos, flag); + if (OB_FAIL(param_types.push_back(static_cast(type)))) { + LOG_WARN("fail to push back", K(type), K(i)); + } } } else { if (num_of_params != param_types.count()) { @@ -634,9 +654,12 @@ int ObMPStmtExecute::parse_request_type(const char* &pos, if (OB_FAIL(decode_type_info(pos, type_name_info))) { LOG_WARN("failed to decode type info", K(ret)); } else if (type_name_info.type_name_.empty()) { - type_name_info.is_elem_type_ = true; - ObMySQLUtil::get_uint1(pos, elem_type); ObObjType ob_elem_type; + type_name_info.is_elem_type_ = true; + PS_DEFENSE_CHECK(1) // elem_type(1) + { + ObMySQLUtil::get_uint1(pos, elem_type); + } OZ (ObSMUtils::get_ob_type( ob_elem_type, static_cast(elem_type)), elem_type); OX (type_name_info.elem_type_.set_obj_type(ob_elem_type)); @@ -718,6 +741,19 @@ int ObMPStmtExecute::parse_request_param_value(ObIAllocator &alloc, return ret; } +bool ObMPStmtExecute::is_contain_complex_element(const sql::ParamTypeArray ¶m_types) const +{ + bool b_ret = false; + for (int64_t i = 0; i < param_types.count(); i++) { + const obmysql::EMySQLFieldType field_type = param_types.at(i); + if (MYSQL_TYPE_COMPLEX == field_type) { + b_ret = true; + break; + } + } + return b_ret; +} + int ObMPStmtExecute::request_params(ObSQLSessionInfo *session, const char* &pos, uint32_t ps_stmt_checksum, @@ -793,17 +829,20 @@ int ObMPStmtExecute::request_params(ObSQLSessionInfo *session, int64_t bitmap_types = (params_num_ + 7) / 8; const char *bitmap = pos; pos += bitmap_types; - // Step2: 获取new_param_bound_flag字段 - ObMySQLUtil::get_int1(pos, new_param_bound_flag); ParamTypeArray ¶m_types = ps_session_info->get_param_types(); ParamTypeInfoArray param_type_infos; ParamCastArray param_cast_infos; ParamTypeArray returning_param_types; ParamTypeInfoArray returning_param_type_infos; - - if (new_param_bound_flag == 1) { - param_types.reuse(); + int64_t len = bitmap_types + 1/*new_param_bound_flag*/; + PS_DEFENSE_CHECK(len) // bitmap_types + { + // Step2: 获取new_param_bound_flag字段 + ObMySQLUtil::get_int1(pos, new_param_bound_flag); + if (new_param_bound_flag == 1) { + param_types.reuse(); + } } if (OB_FAIL(ret)) { // do nothing @@ -839,6 +878,8 @@ int ObMPStmtExecute::request_params(ObSQLSessionInfo *session, param_types, param_type_infos))) { LOG_WARN("fail to parse input params type", K(ret)); + } else if (is_contain_complex_element(param_types)) { + analysis_checker_.need_check_ = false; } // Step3-2: 获取returning into params type信息 @@ -920,8 +961,11 @@ int ObMPStmtExecute::decode_type_info(const char*& buf, TypeInfo &type_info) if (OB_FAIL(ObMySQLUtil::get_length(buf, length))) { LOG_WARN("failed to get length", K(ret)); } else { - type_info.relation_name_.assign_ptr(buf, static_cast(length)); - buf += length; + PS_DEFENSE_CHECK(length) + { + type_info.relation_name_.assign_ptr(buf, static_cast(length)); + buf += length; + } } } if (OB_SUCC(ret)) { @@ -929,8 +973,11 @@ int ObMPStmtExecute::decode_type_info(const char*& buf, TypeInfo &type_info) if (OB_FAIL(ObMySQLUtil::get_length(buf, length))) { LOG_WARN("failed to get length", K(ret)); } else { - type_info.type_name_.assign_ptr(buf, static_cast(length)); - buf += length; + PS_DEFENSE_CHECK(length) + { + type_info.type_name_.assign_ptr(buf, static_cast(length)); + buf += length; + } } } if (OB_SUCC(ret)) { @@ -2000,7 +2047,8 @@ int ObMPStmtExecute::parse_basic_param_value(ObIAllocator &allocator, const char *& data, const common::ObTimeZoneInfo *tz_info, ObObj ¶m, - bool is_complex_element) + bool is_complex_element, + ObPSAnalysisChecker *checker) { int ret = OB_SUCCESS; UNUSED(charset); @@ -2009,74 +2057,89 @@ int ObMPStmtExecute::parse_basic_param_value(ObIAllocator &allocator, case MYSQL_TYPE_SHORT: case MYSQL_TYPE_LONG: case MYSQL_TYPE_LONGLONG: { - if (OB_FAIL(parse_integer_value(type, data, param, allocator, is_complex_element))) { + if (OB_FAIL(parse_integer_value(type, data, param, allocator, is_complex_element, checker))) { LOG_WARN("parse integer value from client failed", K(ret)); } break; } case MYSQL_TYPE_FLOAT: { float value = 0; - MEMCPY(&value, data, sizeof(value)); - data += sizeof(value); - param.set_float(value); + PS_STATIC_DEFENSE_CHECK(checker, sizeof(value)) + { + MEMCPY(&value, data, sizeof(value)); + data += sizeof(value); + param.set_float(value); + } break; } case MYSQL_TYPE_ORA_BINARY_FLOAT: { float value = 0; - MEMCPY(&value, data, sizeof(value)); - data += sizeof(value); - param.set_float(value); + PS_STATIC_DEFENSE_CHECK(checker, sizeof(value)) + { + MEMCPY(&value, data, sizeof(value)); + data += sizeof(value); + param.set_float(value); + } break; } case MYSQL_TYPE_DOUBLE: { double value = 0; - MEMCPY(&value, data, sizeof(value)); - data += sizeof(value); - if (lib::is_mysql_mode()) { - param.set_double(value); - } else { - char *buf = NULL; - int64_t buf_len = 0; - number::ObNumber nb; - const int64_t alloc_size = OB_MAX_DOUBLE_FLOAT_DISPLAY_WIDTH; - if (OB_ISNULL(buf = static_cast(allocator.alloc(alloc_size)))) { - ret = OB_ALLOCATE_MEMORY_FAILED; - LOG_WARN("failed to allocate memory", K(ret)); - } else if (FALSE_IT(buf_len = ob_gcvt_strict(value, OB_GCVT_ARG_DOUBLE, alloc_size, - buf, NULL, TRUE/*is_oracle_mode*/, - FALSE/*is_binary_double*/, FALSE))) { - } else if (OB_FAIL(nb.from_sci_opt(buf, buf_len, allocator))) { - LOG_WARN("decode double param to number failed", K(ret)); + PS_STATIC_DEFENSE_CHECK(checker, sizeof(value)) + { + MEMCPY(&value, data, sizeof(value)); + data += sizeof(value); + if (lib::is_mysql_mode()) { + param.set_double(value); } else { - param.set_number(nb); + char *buf = NULL; + int64_t buf_len = 0; + number::ObNumber nb; + const int64_t alloc_size = OB_MAX_DOUBLE_FLOAT_DISPLAY_WIDTH; + if (OB_ISNULL(buf = static_cast(allocator.alloc(alloc_size)))) { + ret = OB_ALLOCATE_MEMORY_FAILED; + LOG_WARN("failed to allocate memory", K(ret)); + } else if (FALSE_IT(buf_len = ob_gcvt_strict(value, OB_GCVT_ARG_DOUBLE, alloc_size, + buf, NULL, TRUE/*is_oracle_mode*/, + FALSE/*is_binary_double*/, FALSE))) { + } else if (OB_FAIL(nb.from_sci_opt(buf, buf_len, allocator))) { + LOG_WARN("decode double param to number failed", K(ret)); + } else { + param.set_number(nb); + } } } break; } case MYSQL_TYPE_ORA_BINARY_DOUBLE: { double value = 0; - MEMCPY(&value, data, sizeof(value)); - data += sizeof(value); - param.set_double(value); + PS_STATIC_DEFENSE_CHECK(checker, sizeof(value)) + { + MEMCPY(&value, data, sizeof(value)); + data += sizeof(value); + param.set_double(value); + } break; } case MYSQL_TYPE_YEAR: { int16_t value = 0; - ObMySQLUtil::get_int2(data, value); - param.set_year(static_cast(value)); + PS_STATIC_DEFENSE_CHECK(checker, 2) + { + ObMySQLUtil::get_int2(data, value); + param.set_year(static_cast(value)); + } break; } case MYSQL_TYPE_DATE: case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_TIMESTAMP: { if (OB_FAIL(parse_mysql_timestamp_value(static_cast(type), data, - param, tz_info))) { + param, tz_info, checker))) { LOG_WARN("parse timestamp value from client failed", K(ret)); } break; } case MYSQL_TYPE_TIME:{ - if (OB_FAIL(parse_mysql_time_value(data, param))) { + if (OB_FAIL(parse_mysql_time_value(data, param, checker))) { LOG_WARN("parse timestamp value from client failed", K(ret)); } break; @@ -2086,7 +2149,7 @@ int ObMPStmtExecute::parse_basic_param_value(ObIAllocator &allocator, case MYSQL_TYPE_OB_TIMESTAMP_NANO: { ObTimeConvertCtx cvrt_ctx(tz_info, true); if (OB_FAIL(parse_oracle_timestamp_value( - static_cast(type), data, cvrt_ctx, param))) { + static_cast(type), data, cvrt_ctx, param, checker))) { LOG_WARN("parse timestamp value from client failed", K(ret)); } break; @@ -2115,7 +2178,10 @@ int ObMPStmtExecute::parse_basic_param_value(ObIAllocator &allocator, if (OB_FAIL(ObMySQLUtil::get_length(data, length))) { LOG_ERROR("decode varchar param value failed", K(ret)); } else { - str.assign_ptr(data, static_cast(length)); + PS_STATIC_DEFENSE_CHECK(checker, length) + { + str.assign_ptr(data, static_cast(length)); + } if (OB_FAIL(ret)) { } else if (MYSQL_TYPE_OB_NVARCHAR2 == type || MYSQL_TYPE_OB_NCHAR == type) { @@ -2291,13 +2357,13 @@ int ObMPStmtExecute::parse_basic_param_value(ObIAllocator &allocator, break; } case MYSQL_TYPE_OB_INTERVAL_YM: { - if (OB_FAIL(parse_oracle_interval_ym_value(data, param))) { + if (OB_FAIL(parse_oracle_interval_ym_value(data, param, checker))) { LOG_WARN("failed to parse oracle interval year to month value", K(ret)); } break; } case MYSQL_TYPE_OB_INTERVAL_DS:{ - if (OB_FAIL(parse_oracle_interval_ds_value(data, param))) { + if (OB_FAIL(parse_oracle_interval_ds_value(data, param, checker))) { LOG_WARN("failed to parse oracle interval year to month value", K(ret)); } break; @@ -2356,7 +2422,7 @@ int ObMPStmtExecute::parse_param_value(ObIAllocator &allocator, } } else { if (OB_FAIL(parse_basic_param_value(allocator, type, charset, cs_type, ncs_type, - data, tz_info, param))) { + data, tz_info, param, false, &analysis_checker_))) { LOG_WARN("failed to parse basic param value", K(ret)); } else { param.set_param_meta(); @@ -2440,7 +2506,7 @@ int ObMPStmtExecute::parse_param_value(ObIAllocator &allocator, } else { const char* src = tmp; if (OB_FAIL(parse_basic_param_value(allocator, type, charset, cs_type, ncs_type, - src, tz_info, param))) { + src, tz_info, param, false))) { LOG_WARN("failed to parse basic param value", K(ret)); } else { param.set_param_meta(); @@ -2515,45 +2581,58 @@ int ObMPStmtExecute::parse_integer_value(const uint32_t type, const char *&data, ObObj ¶m, ObIAllocator &allocator, - bool is_complex_element) + bool is_complex_element, + ObPSAnalysisChecker *checker) { int ret = OB_SUCCESS; bool cast_to_number = !(lib::is_mysql_mode() || is_complex_element || MYSQL_TYPE_TINY == type); int64_t res_val = 0; switch(type) { case MYSQL_TYPE_TINY: { - int8_t value; - ObMySQLUtil::get_int1(data, value); - param.set_tinyint(value); + PS_STATIC_DEFENSE_CHECK(checker, 1) + { + int8_t value; + ObMySQLUtil::get_int1(data, value); + param.set_tinyint(value); + } break; } case MYSQL_TYPE_SHORT: { - int16_t value = 0; - ObMySQLUtil::get_int2(data, value); - if (!cast_to_number) { - param.set_smallint(value); - } else { - res_val = static_cast(value); + PS_STATIC_DEFENSE_CHECK(checker, 2) + { + int16_t value = 0; + ObMySQLUtil::get_int2(data, value); + if (!cast_to_number) { + param.set_smallint(value); + } else { + res_val = static_cast(value); + } } break; } case MYSQL_TYPE_LONG: { - int32_t value = 0; - ObMySQLUtil::get_int4(data, value); - if (!cast_to_number) { - param.set_int32(value); - } else { - res_val = static_cast(value); + PS_STATIC_DEFENSE_CHECK(checker, 4) + { + int32_t value = 0; + ObMySQLUtil::get_int4(data, value); + if (!cast_to_number) { + param.set_int32(value); + } else { + res_val = static_cast(value); + } } break; } case MYSQL_TYPE_LONGLONG: { - int64_t value = 0; - ObMySQLUtil::get_int8(data, value); - if (!cast_to_number) { - param.set_int(value); - } else { - res_val = value; + PS_STATIC_DEFENSE_CHECK(checker, 8) + { + int64_t value = 0; + ObMySQLUtil::get_int8(data, value); + if (!cast_to_number) { + param.set_int(value); + } else { + res_val = value; + } } break; } @@ -2577,7 +2656,8 @@ int ObMPStmtExecute::parse_integer_value(const uint32_t type, int ObMPStmtExecute::parse_mysql_timestamp_value(const EMySQLFieldType field_type, const char *&data, ObObj ¶m, - const common::ObTimeZoneInfo *tz_info) + const common::ObTimeZoneInfo *tz_info, + ObPSAnalysisChecker *checker) { int ret = OB_SUCCESS; int8_t length = 0; @@ -2588,32 +2668,44 @@ int ObMPStmtExecute::parse_mysql_timestamp_value(const EMySQLFieldType field_typ int8_t min = 0; int8_t second = 0; int32_t microsecond = 0; - ObMySQLUtil::get_int1(data, length); ObPreciseDateTime value; - if (0 == length) { - value = 0; - } else if (4 == length) { - ObMySQLUtil::get_int2(data, year); - ObMySQLUtil::get_int1(data, month); - ObMySQLUtil::get_int1(data, day); - } else if (7 == length) { - ObMySQLUtil::get_int2(data, year); - ObMySQLUtil::get_int1(data, month); - ObMySQLUtil::get_int1(data, day); - ObMySQLUtil::get_int1(data, hour); - ObMySQLUtil::get_int1(data, min); - ObMySQLUtil::get_int1(data, second); - } else if (11 == length) { - ObMySQLUtil::get_int2(data, year); - ObMySQLUtil::get_int1(data, month); - ObMySQLUtil::get_int1(data, day); - ObMySQLUtil::get_int1(data, hour); - ObMySQLUtil::get_int1(data, min); - ObMySQLUtil::get_int1(data, second); - ObMySQLUtil::get_int4(data, microsecond); - } else { - ret = OB_ERROR; - LOG_WARN("invalid mysql timestamp value length", K(length)); + PS_STATIC_DEFENSE_CHECK(checker, 1) + { + ObMySQLUtil::get_int1(data, length); + if (0 == length) { + value = 0; + } else if (4 == length) { + PS_STATIC_DEFENSE_CHECK(checker, 4) + { + ObMySQLUtil::get_int2(data, year); + ObMySQLUtil::get_int1(data, month); + ObMySQLUtil::get_int1(data, day); + } + } else if (7 == length) { + PS_STATIC_DEFENSE_CHECK(checker, 7) + { + ObMySQLUtil::get_int2(data, year); + ObMySQLUtil::get_int1(data, month); + ObMySQLUtil::get_int1(data, day); + ObMySQLUtil::get_int1(data, hour); + ObMySQLUtil::get_int1(data, min); + ObMySQLUtil::get_int1(data, second); + } + } else if (11 == length) { + PS_STATIC_DEFENSE_CHECK(checker, 11) + { + ObMySQLUtil::get_int2(data, year); + ObMySQLUtil::get_int1(data, month); + ObMySQLUtil::get_int1(data, day); + ObMySQLUtil::get_int1(data, hour); + ObMySQLUtil::get_int1(data, min); + ObMySQLUtil::get_int1(data, second); + ObMySQLUtil::get_int4(data, microsecond); + } + } else { + ret = OB_ERROR; + LOG_WARN("invalid mysql timestamp value length", K(length)); + } } if (OB_SUCC(ret)) { @@ -2665,27 +2757,34 @@ int ObMPStmtExecute::parse_mysql_timestamp_value(const EMySQLFieldType field_typ } int ObMPStmtExecute::parse_oracle_timestamp_value(const obmysql::EMySQLFieldType field_type, - const char *&data, const ObTimeConvertCtx &cvrt_ctx, ObObj ¶m) + const char *&data, const ObTimeConvertCtx &cvrt_ctx, ObObj ¶m, ObPSAnalysisChecker *checker) { int ret = OB_SUCCESS; int8_t total_len = 0; ObObjType obj_type; ObOTimestampData ot_data; int8_t scale = -1; - ObMySQLUtil::get_int1(data, total_len); - if (OB_FAIL(ObSMUtils::get_ob_type(obj_type, field_type))) { + PS_STATIC_DEFENSE_CHECK(checker, 1) + { + ObMySQLUtil::get_int1(data, total_len); + } + if (OB_FAIL(ret)) { + } else if (OB_FAIL(ObSMUtils::get_ob_type(obj_type, field_type))) { LOG_WARN("failed to get_ob_type", K(ret)); } else if (OB_FAIL(ObTimeConverter::decode_otimestamp(obj_type, data, total_len, cvrt_ctx, ot_data, scale))) { LOG_WARN("failed to decode_otimestamp", K(ret)); } else { - data += total_len; - param.set_otimestamp_value(obj_type, ot_data); - param.set_scale(scale); + PS_STATIC_DEFENSE_CHECK(checker, total_len) + { + data += total_len; + param.set_otimestamp_value(obj_type, ot_data); + param.set_scale(scale); + } } return ret; } -int ObMPStmtExecute::parse_mysql_time_value(const char *&data, ObObj ¶m) +int ObMPStmtExecute::parse_mysql_time_value(const char *&data, ObObj ¶m, ObPSAnalysisChecker *checker) { int ret = OB_SUCCESS; int8_t length = 0; @@ -2699,44 +2798,53 @@ int ObMPStmtExecute::parse_mysql_time_value(const char *&data, ObObj ¶m) int32_t microsecond = 0; struct tm tmval; MEMSET(&tmval, 0, sizeof(tmval)); - ObMySQLUtil::get_int1(data, length); int64_t value; - if (0 == length) { - value = 0; - } else if (8 == length) { - ObMySQLUtil::get_int1(data, is_negative); - ObMySQLUtil::get_int4(data, day); - ObMySQLUtil::get_int1(data, hour); - ObMySQLUtil::get_int1(data, min); - ObMySQLUtil::get_int1(data, second); - } else if (12 == length) { - ObMySQLUtil::get_int1(data, is_negative); - ObMySQLUtil::get_int4(data, day); - ObMySQLUtil::get_int1(data, hour); - ObMySQLUtil::get_int1(data, min); - ObMySQLUtil::get_int1(data, second); - ObMySQLUtil::get_int4(data, microsecond); - } else { - ret = OB_ERR_UNEXPECTED; - LOG_ERROR("unexpected time length", K(length), K(ret)); - } + PS_STATIC_DEFENSE_CHECK(checker, 1) + { + ObMySQLUtil::get_int1(data, length); + if (0 == length) { + value = 0; + } else if (8 == length) { + PS_STATIC_DEFENSE_CHECK(checker, 8) + { + ObMySQLUtil::get_int1(data, is_negative); + ObMySQLUtil::get_int4(data, day); + ObMySQLUtil::get_int1(data, hour); + ObMySQLUtil::get_int1(data, min); + ObMySQLUtil::get_int1(data, second); + } + } else if (12 == length) { + PS_STATIC_DEFENSE_CHECK(checker, 12) + { + ObMySQLUtil::get_int1(data, is_negative); + ObMySQLUtil::get_int4(data, day); + ObMySQLUtil::get_int1(data, hour); + ObMySQLUtil::get_int1(data, min); + ObMySQLUtil::get_int1(data, second); + ObMySQLUtil::get_int4(data, microsecond); + } + } else { + ret = OB_ERR_UNEXPECTED; + LOG_ERROR("unexpected time length", K(length), K(ret)); + } - if (OB_SUCC(ret)) { - ObTime ob_time; - if (0 != length) { - ob_time.parts_[DT_YEAR] = year; - ob_time.parts_[DT_MON] = month; - ob_time.parts_[DT_MDAY] = day; - ob_time.parts_[DT_HOUR] = hour; - ob_time.parts_[DT_MIN] = min; - ob_time.parts_[DT_SEC] = second; - ob_time.parts_[DT_USEC] = microsecond; - if (!ObTimeUtility2::is_valid_time(hour, min, second, microsecond)) { - ret = OB_INVALID_DATE_FORMAT; - LOG_WARN("invalid date format", K(ret)); - } else { - ob_time.parts_[DT_DATE] = ObTimeConverter::ob_time_to_date(ob_time); - value = ObTimeConverter::ob_time_to_time(ob_time); + if (OB_SUCC(ret)) { + ObTime ob_time; + if (0 != length) { + ob_time.parts_[DT_YEAR] = year; + ob_time.parts_[DT_MON] = month; + ob_time.parts_[DT_MDAY] = day; + ob_time.parts_[DT_HOUR] = hour; + ob_time.parts_[DT_MIN] = min; + ob_time.parts_[DT_SEC] = second; + ob_time.parts_[DT_USEC] = microsecond; + if (!ObTimeUtility2::is_valid_time(hour, min, second, microsecond)) { + ret = OB_INVALID_DATE_FORMAT; + LOG_WARN("invalid date format", K(ret)); + } else { + ob_time.parts_[DT_DATE] = ObTimeConverter::ob_time_to_date(ob_time); + value = ObTimeConverter::ob_time_to_time(ob_time); + } } } } @@ -2747,7 +2855,7 @@ int ObMPStmtExecute::parse_mysql_time_value(const char *&data, ObObj ¶m) return ret; } -int ObMPStmtExecute::parse_oracle_interval_ds_value(const char *&data, ObObj ¶m) +int ObMPStmtExecute::parse_oracle_interval_ds_value(const char *&data, ObObj ¶m, ObPSAnalysisChecker *checker) { int ret = OB_SUCCESS; int8_t length = 0; @@ -2755,18 +2863,20 @@ int ObMPStmtExecute::parse_oracle_interval_ds_value(const char *&data, ObObj &pa ObIntervalDSValue value; ObMySQLUtil::get_int1(data, length); - - if (OB_FAIL(ObTimeConverter::decode_interval_ds(data, length, value, scale))) { - LOG_WARN("fail to decode interval day to second", K(ret), K(length)); - } else { - param.set_interval_ds(value); - param.set_scale(scale); + PS_STATIC_DEFENSE_CHECK(checker, length) + { + if (OB_FAIL(ObTimeConverter::decode_interval_ds(data, length, value, scale))) { + LOG_WARN("fail to decode interval day to second", K(ret), K(length)); + } else { + param.set_interval_ds(value); + param.set_scale(scale); + } } return ret; } -int ObMPStmtExecute::parse_oracle_interval_ym_value(const char *&data, ObObj ¶m) +int ObMPStmtExecute::parse_oracle_interval_ym_value(const char *&data, ObObj ¶m, ObPSAnalysisChecker *checker) { int ret = OB_SUCCESS; int8_t length = 0; @@ -2774,11 +2884,14 @@ int ObMPStmtExecute::parse_oracle_interval_ym_value(const char *&data, ObObj &pa ObIntervalYMValue value; ObMySQLUtil::get_int1(data, length); - if (OB_FAIL(ObTimeConverter::decode_interval_ym(data, length, value, scale))) { - LOG_WARN("fail to decode interval year to month", K(ret), K(length)); - } else { - param.set_interval_ym(value); - param.set_scale(scale); + PS_STATIC_DEFENSE_CHECK(checker, length) + { + if (OB_FAIL(ObTimeConverter::decode_interval_ym(data, length, value, scale))) { + LOG_WARN("fail to decode interval year to month", K(ret), K(length)); + } else { + param.set_interval_ym(value); + param.set_scale(scale); + } } return ret; diff --git a/src/observer/mysql/obmp_stmt_execute.h b/src/observer/mysql/obmp_stmt_execute.h index 2135962031..620d53dc05 100644 --- a/src/observer/mysql/obmp_stmt_execute.h +++ b/src/observer/mysql/obmp_stmt_execute.h @@ -43,6 +43,46 @@ enum ObPSCursorType ObPrexecutePsCursorType }; +class ObPSAnalysisChecker +{ +public: + ObPSAnalysisChecker() + : pos_(nullptr), begin_pos_(nullptr), end_pos_(nullptr), + data_len_(0), need_check_(true) + {} + void init(const char*& pos, const int64_t len) + { + pos_ = &pos; + begin_pos_ = pos; + end_pos_ = pos + len; + data_len_ = len; + need_check_ = true; + } + int detection(const int64_t len); + inline int64_t remain_len() + { return end_pos_ - (*pos_); } + +public: + const char** pos_; + const char* begin_pos_; + const char* end_pos_; + int64_t data_len_; + bool need_check_; +}; + +#define PS_DEFENSE_CHECK(len) \ + if (OB_FAIL(ret)) { \ + } else if (OB_FAIL(analysis_checker_.detection(len))) { \ + LOG_WARN("memory access out of bounds", K(ret)); \ + } else + +#define PS_STATIC_DEFENSE_CHECK(checker, len) \ + if (OB_FAIL(ret)) { \ + } else if (nullptr != checker \ + && OB_FAIL(checker->detection(len))) { \ + LOG_WARN("memory access out of bounds", K(ret)); \ + } else + class ObMPStmtExecute : public ObMPBase { public: @@ -62,21 +102,25 @@ public: const char *& data, const common::ObTimeZoneInfo *tz_info, ObObj ¶m, - bool is_complex_element = false); + bool is_complex_element = false, + ObPSAnalysisChecker *checker = nullptr); static int parse_mysql_timestamp_value(const obmysql::EMySQLFieldType field_type, const char *&data, ObObj ¶m, - const common::ObTimeZoneInfo *tz_info); + const common::ObTimeZoneInfo *tz_info, + ObPSAnalysisChecker *checker = nullptr); static int parse_integer_value(const uint32_t type, const char *&data, ObObj ¶m, ObIAllocator &allocator, - bool is_complex_element = false); + bool is_complex_element = false, + ObPSAnalysisChecker *checker = nullptr); static int parse_oracle_timestamp_value(const obmysql::EMySQLFieldType field_type, const char *&data, - const ObTimeConvertCtx &cvrt_ctx, ObObj ¶m); - static int parse_mysql_time_value(const char *&data, ObObj ¶m); - static int parse_oracle_interval_ym_value(const char *&data, ObObj ¶m); - static int parse_oracle_interval_ds_value(const char *&data, ObObj ¶m); + const ObTimeConvertCtx &cvrt_ctx, ObObj ¶m, + ObPSAnalysisChecker *checker = nullptr); + static int parse_mysql_time_value(const char *&data, ObObj ¶m, ObPSAnalysisChecker *checker = nullptr); + static int parse_oracle_interval_ym_value(const char *&data, ObObj ¶m, ObPSAnalysisChecker *checker = nullptr); + static int parse_oracle_interval_ds_value(const char *&data, ObObj ¶m, ObPSAnalysisChecker *checker = nullptr); int64_t get_single_process_timestamp() const { return single_process_timestamp_; } int64_t get_exec_start_timestamp() const { return exec_start_timestamp_; } int64_t get_exec_end_timestamp() const { return exec_end_timestamp_; } @@ -275,6 +319,7 @@ private: int get_pl_type_by_type_info(ObIAllocator &allocator, const sql::TypeInfo *type_info, const pl::ObUserDefinedType *&pl_type); + bool is_contain_complex_element(const sql::ParamTypeArray ¶m_types) const; virtual int before_process(); int response_query_header(sql::ObSQLSessionInfo &session, pl::ObDbmsCursorInfo &cursor); @@ -314,6 +359,7 @@ protected: int64_t params_value_len_; char *params_value_; int64_t curr_sql_idx_; // only for arraybinding + ObPSAnalysisChecker analysis_checker_; private: DISALLOW_COPY_AND_ASSIGN(ObMPStmtExecute); diff --git a/src/observer/mysql/obmp_stmt_prexecute.cpp b/src/observer/mysql/obmp_stmt_prexecute.cpp index 4a5bd4daef..10bea82ceb 100644 --- a/src/observer/mysql/obmp_stmt_prexecute.cpp +++ b/src/observer/mysql/obmp_stmt_prexecute.cpp @@ -102,33 +102,42 @@ int ObMPStmtPrexecute::before_process() } const ObMySQLRawPacket &pkt = reinterpret_cast(req_->get_packet()); const char* pos = pkt.get_cdata(); + analysis_checker_.init(pos, pkt.get_clen()); // stmt_id int32_t stmt_id = -1; - ObMySQLUtil::get_int4(pos, stmt_id); - stmt_id_ = stmt_id; + PS_DEFENSE_CHECK(9) // stmt_id(4) + flag(1) + iteration_count(4) + { + ObMySQLUtil::get_int4(pos, stmt_id); + stmt_id_ = stmt_id; - // flags - int8_t flag = 0; - ObMySQLUtil::get_int1(pos, flag); + // flags + int8_t flag = 0; + ObMySQLUtil::get_int1(pos, flag); - // iteration_count - ObMySQLUtil::get_int4(pos, iteration_count_); + // iteration_count + ObMySQLUtil::get_int4(pos, iteration_count_); + } // sql if (OB_SUCC(ret) && OB_FAIL(ObMySQLUtil::get_length(pos, sql_len_))) { LOG_WARN("failed to get length", K(ret)); } else { - sql_.assign_ptr(pos, static_cast(sql_len_)); - pos += sql_len_; + PS_DEFENSE_CHECK(sql_len_) + { + sql_.assign_ptr(pos, static_cast(sql_len_)); + pos += sql_len_; + } LOG_DEBUG("get sql in prexecute protocol.", K(stmt_id_), K(sql_)); } // params_num int32_t num = 0; - ObMySQLUtil::get_int4(pos, num); - set_param_num(num); - ObSQLSessionInfo *session = NULL; + PS_DEFENSE_CHECK(4) // params_num + { + ObMySQLUtil::get_int4(pos, num); + set_param_num(num); + } if (OB_FAIL(ret)) { // do nothing } else if (OB_FAIL(get_session(session))) { @@ -284,49 +293,61 @@ int ObMPStmtPrexecute::before_process() if (OB_FAIL(request_params(session, pos, ps_stmt_checksum, *allocator_, params_num_))) { LOG_WARN("prepare-execute protocol get params request failed", K(ret)); } else { - ObMySQLUtil::get_uint4(pos, exec_mode_); - // - // is_commit_on_success_ is not use yet - // other exec_mode set use == - is_commit_on_success_ = exec_mode_ & OB_OCI_COMMIT_ON_SUCCESS; - exec_mode_ = exec_mode_ & (0xffffffff - OB_OCI_COMMIT_ON_SUCCESS); - if (OB_OCI_BATCH_ERRORS == exec_mode_ && !is_pl_stmt(stmt_type_)) { - set_save_exception(true); - } - if (OB_SUCC(ret)) { - ObMySQLUtil::get_uint4(pos, close_stmt_count_); - int tmp_ret = OB_SUCCESS; - if (0 != close_stmt_count_) { - LOG_INFO("close stmt count:", K(close_stmt_count_), K(stmt_id_)); - // OCI not support close_stmt_count_ is not 0 yet. - // for (int64_t i = 0; i < close_stmt_count_; i++) { - // int32_t close_stmt_id = -1; - // ObMySQLUtil::get_int4(pos, close_stmt_id); - // if (OB_NOT_NULL(session->get_cursor(close_stmt_id))) { - // if (OB_FAIL(session->close_cursor(close_stmt_id))) { - // tmp_ret = ret; - // LOG_WARN("fail to close cursor", K(ret), K(stmt_id_), K(close_stmt_id), K(session->get_sessid())); - // } - // } - // if (OB_FAIL(session->close_ps_stmt(close_stmt_id))) { - // LOG_WARN("close ps stmt fail in prepare-execute.", K(stmt_id_), K(close_stmt_id)); - // } - // if (OB_SUCCESS != tmp_ret) { - // ret = tmp_ret; - // } - // } + PS_DEFENSE_CHECK(4) // exec_mode + { + ObMySQLUtil::get_uint4(pos, exec_mode_); + // + // is_commit_on_success_ is not use yet + // other exec_mode set use == + is_commit_on_success_ = exec_mode_ & OB_OCI_COMMIT_ON_SUCCESS; + exec_mode_ = exec_mode_ & (0xffffffff - OB_OCI_COMMIT_ON_SUCCESS); + if (OB_OCI_BATCH_ERRORS == exec_mode_ && !is_pl_stmt(stmt_type_)) { + set_save_exception(true); } } if (OB_SUCC(ret)) { - ObMySQLUtil::get_uint4(pos, ps_stmt_checksum); - if (DEFAULT_ITERATION_COUNT == ps_stmt_checksum - || (OB_NOT_NULL(ps_session_info) - && ps_stmt_checksum != ps_session_info->get_ps_stmt_checksum())) { - ret = OB_ERR_PREPARE_STMT_CHECKSUM; - LOG_ERROR("ps stmt checksum fail", K(ret), "session_id", session->get_sessid(), - K(ps_stmt_checksum), K(*ps_session_info)); - } else { - ObMySQLUtil::get_uint4(pos, extend_flag_); + PS_DEFENSE_CHECK(4) // close stmt count + { + ObMySQLUtil::get_uint4(pos, close_stmt_count_); + int tmp_ret = OB_SUCCESS; + if (0 != close_stmt_count_) { + LOG_INFO("close stmt count:", K(close_stmt_count_), K(stmt_id_)); + // OCI not support close_stmt_count_ is not 0 yet. + // for (int64_t i = 0; i < close_stmt_count_; i++) { + // int32_t close_stmt_id = -1; + // ObMySQLUtil::get_int4(pos, close_stmt_id); + // if (OB_NOT_NULL(session->get_cursor(close_stmt_id))) { + // if (OB_FAIL(session->close_cursor(close_stmt_id))) { + // tmp_ret = ret; + // LOG_WARN("fail to close cursor", K(ret), K(stmt_id_), K(close_stmt_id), K(session->get_sessid())); + // } + // } + // if (OB_FAIL(session->close_ps_stmt(close_stmt_id))) { + // LOG_WARN("close ps stmt fail in prepare-execute.", K(stmt_id_), K(close_stmt_id)); + // } + // if (OB_SUCCESS != tmp_ret) { + // ret = tmp_ret; + // } + // } + } + } + } + if (OB_SUCC(ret)) { + PS_DEFENSE_CHECK(4) // checksum + { + ObMySQLUtil::get_uint4(pos, ps_stmt_checksum); + if (DEFAULT_ITERATION_COUNT == ps_stmt_checksum + || (OB_NOT_NULL(ps_session_info) + && ps_stmt_checksum != ps_session_info->get_ps_stmt_checksum())) { + ret = OB_ERR_PREPARE_STMT_CHECKSUM; + LOG_ERROR("ps stmt checksum fail", K(ret), "session_id", session->get_sessid(), + K(ps_stmt_checksum), K(*ps_session_info)); + } else { + PS_DEFENSE_CHECK(4) // extend_flag + { + ObMySQLUtil::get_uint4(pos, extend_flag_); + } + } } } if (OB_FAIL(ret)) { diff --git a/src/share/ob_errno.cpp b/src/share/ob_errno.cpp index 02f37f6550..994b2b3776 100644 --- a/src/share/ob_errno.cpp +++ b/src/share/ob_errno.cpp @@ -24393,6 +24393,18 @@ static const _error _error_OB_ERR_MULTI_RECORD = { .oracle_str_error = "ORA-00494: coercion into multiple record targets not supported", .oracle_str_user_error = "ORA-00494: coercion into multiple record targets not supported" }; +static const _error _error_OB_ERR_MALFORMED_PS_PACKET = { + .error_name = "OB_ERR_MALFORMED_PS_PACKET", + .error_cause = "Internal Error", + .error_solution = "Contact OceanBase Support", + .mysql_errno = -1, + .sqlstate = "HY000", + .str_error = "malformed ps packet", + .str_user_error = "malformed ps packet", + .oracle_errno = 600, + .oracle_str_error = "ORA-00600: internal error code, arguments: -9747, malformed ps packet", + .oracle_str_user_error = "ORA-00600: internal error code, arguments: -9747, malformed ps packet" +}; static const _error _error_OB_SP_RAISE_APPLICATION_ERROR = { .error_name = "OB_SP_RAISE_APPLICATION_ERROR", .error_cause = "Internal Error", @@ -26515,6 +26527,7 @@ struct ObStrErrorInit _errors[-OB_ERR_RECOMPILATION_OBJECT] = &_error_OB_ERR_RECOMPILATION_OBJECT; _errors[-OB_ERR_VARIABLE_NOT_IN_SELECT_LIST] = &_error_OB_ERR_VARIABLE_NOT_IN_SELECT_LIST; _errors[-OB_ERR_MULTI_RECORD] = &_error_OB_ERR_MULTI_RECORD; + _errors[-OB_ERR_MALFORMED_PS_PACKET] = &_error_OB_ERR_MALFORMED_PS_PACKET; _errors[-OB_SP_RAISE_APPLICATION_ERROR] = &_error_OB_SP_RAISE_APPLICATION_ERROR; _errors[-OB_SP_RAISE_APPLICATION_ERROR_NUM] = &_error_OB_SP_RAISE_APPLICATION_ERROR_NUM; _errors[-OB_CLOB_ONLY_SUPPORT_WITH_MULTIBYTE_FUN] = &_error_OB_CLOB_ONLY_SUPPORT_WITH_MULTIBYTE_FUN; @@ -26536,7 +26549,7 @@ namespace oceanbase { namespace common { -int g_all_ob_errnos[2037] = {0, -4000, -4001, -4002, -4003, -4004, -4005, -4006, -4007, -4008, -4009, -4010, -4011, -4012, -4013, -4014, -4015, -4016, -4017, -4018, -4019, -4020, -4021, -4022, -4023, -4024, -4025, -4026, -4027, -4028, -4029, -4030, -4031, -4032, -4033, -4034, -4035, -4036, -4037, -4038, -4039, -4041, -4042, -4043, -4044, -4045, -4046, -4047, -4048, -4049, -4050, -4051, -4052, -4053, -4054, -4055, -4057, -4058, -4060, -4061, -4062, -4063, -4064, -4065, -4066, -4067, -4068, -4070, -4071, -4072, -4073, -4074, -4075, -4076, -4077, -4078, -4080, -4081, -4084, -4085, -4090, -4097, -4098, -4099, -4100, -4101, -4102, -4103, -4104, -4105, -4106, -4107, -4108, -4109, -4110, -4111, -4112, -4113, -4114, -4115, -4116, -4117, -4118, -4119, -4120, -4121, -4122, -4123, -4124, -4125, -4126, -4127, -4128, -4133, -4138, -4139, -4142, -4143, -4144, -4146, -4147, -4149, -4150, -4151, -4152, -4153, -4154, -4155, -4156, -4157, -4158, -4159, -4160, -4161, -4162, -4163, -4164, -4165, -4166, -4167, -4168, -4169, -4170, -4171, -4172, -4173, -4174, -4175, -4176, -4177, -4178, -4179, -4180, -4181, -4182, -4183, -4184, -4185, -4186, -4187, -4188, -4189, -4190, -4191, -4192, -4200, -4201, -4204, -4205, -4206, -4207, -4208, -4209, -4210, -4211, -4212, -4213, -4214, -4215, -4216, -4217, -4218, -4219, -4220, -4221, -4222, -4223, -4224, -4225, -4226, -4227, -4228, -4229, -4230, -4231, -4232, -4233, -4234, -4235, -4236, -4237, -4238, -4239, -4240, -4241, -4242, -4243, -4244, -4245, -4246, -4247, -4248, -4249, -4250, -4251, -4252, -4253, -4254, -4255, -4256, -4257, -4258, -4260, -4261, -4262, -4263, -4264, -4265, -4266, -4267, -4268, -4269, -4270, -4271, -4273, -4274, -4275, -4276, -4277, -4278, -4279, -4280, -4281, -4282, -4283, -4284, -4285, -4286, -4287, -4288, -4289, -4290, -4291, -4292, -4293, -4294, -4295, -4296, -4297, -4298, -4299, -4300, -4301, -4302, -4303, -4304, -4305, -4306, -4307, -4308, -4309, -4310, -4311, -4312, -4313, -4314, -4315, -4316, -4317, -4318, -4319, -4320, -4321, -4322, -4323, -4324, -4325, -4326, -4327, -4328, -4329, -4330, -4331, -4332, -4333, -4334, -4335, -4336, -4337, -4338, -4339, -4340, -4341, -4342, -4343, -4344, -4345, -4346, -4347, -4348, -4349, -4350, -4351, -4352, -4353, -4354, -4355, -4356, -4357, -4358, -4359, -4360, -4361, -4362, -4363, -4364, -4365, -4366, -4367, -4368, -4369, -4370, -4371, -4372, -4373, -4374, -4375, -4376, -4377, -4378, -4379, -4380, -4381, -4382, -4383, -4385, -4386, -4387, -4388, -4389, -4390, -4391, -4392, -4393, -4394, -4395, -4396, -4505, -4507, -4510, -4512, -4515, -4517, -4518, -4519, -4523, -4524, -4525, -4526, -4527, -4528, -4529, -4530, -4531, -4532, -4533, -4537, -4538, -4539, -4540, -4541, -4542, -4543, -4544, -4545, -4546, -4547, -4548, -4549, -4550, -4551, -4552, -4553, -4554, -4600, -4601, -4602, -4603, -4604, -4605, -4606, -4607, -4608, -4609, -4610, -4611, -4613, -4614, -4615, -4620, -4621, -4622, -4623, -4624, -4625, -4626, -4628, -4629, -4630, -4631, -4632, -4633, -4634, -4636, -4637, -4638, -4639, -4640, -4641, -4642, -4643, -4644, -4645, -4646, -4647, -4648, -4649, -4650, -4651, -4652, -4653, -4654, -4655, -4656, -4657, -4658, -4659, -4660, -4661, -4662, -4663, -4664, -4665, -4666, -4667, -4668, -4669, -4670, -4671, -4672, -4673, -4674, -4675, -4676, -4677, -4678, -4679, -4680, -4681, -4682, -4683, -4684, -4685, -4686, -4687, -4688, -4689, -4690, -4691, -4692, -4693, -4694, -4695, -4696, -4697, -4698, -4699, -4700, -4701, -4702, -4703, -4704, -4705, -4706, -4707, -4708, -4709, -4710, -4711, -4712, -4713, -4714, -4715, -4716, -4717, -4718, -4719, -4720, -4721, -4722, -4723, -4724, -4725, -4726, -4727, -4728, -4729, -4730, -4731, -4732, -4733, -4734, -4735, -4736, -4737, -4738, -4739, -4740, -4741, -4742, -4743, -4744, -4745, -4746, -4747, -4748, -4749, -4750, -4751, -4752, -4753, -4754, -4755, -4756, -5000, -5001, -5002, -5003, -5006, -5007, -5008, -5010, -5011, -5012, -5014, -5015, -5016, -5017, -5018, -5019, -5020, -5022, -5023, -5024, -5025, -5026, -5027, -5028, -5029, -5030, -5031, -5032, -5034, -5035, -5036, -5037, -5038, -5039, -5040, -5041, -5042, -5043, -5044, -5046, -5047, -5050, -5051, -5052, -5053, -5054, -5055, -5056, -5057, -5058, -5059, -5061, -5063, -5064, -5065, -5066, -5067, -5068, -5069, -5070, -5071, -5072, -5073, -5074, -5080, -5081, -5083, -5084, -5085, -5086, -5087, -5088, -5089, -5090, -5091, -5092, -5093, -5094, -5095, -5096, -5097, -5098, -5099, -5100, -5101, -5102, -5103, -5104, -5105, -5106, -5107, -5108, -5109, -5110, -5111, -5112, -5113, -5114, -5115, -5116, -5117, -5118, -5119, -5120, -5121, -5122, -5123, -5124, -5125, -5130, -5131, -5133, -5134, -5135, -5136, -5137, -5138, -5139, -5140, -5142, -5143, -5144, -5145, -5146, -5147, -5148, -5149, -5150, -5151, -5153, -5154, -5155, -5156, -5157, -5158, -5159, -5160, -5161, -5162, -5163, -5164, -5165, -5166, -5167, -5168, -5169, -5170, -5171, -5172, -5173, -5174, -5175, -5176, -5177, -5178, -5179, -5180, -5181, -5182, -5183, -5184, -5185, -5187, -5188, -5189, -5190, -5191, -5192, -5193, -5194, -5195, -5196, -5197, -5198, -5199, -5200, -5201, -5202, -5203, -5204, -5205, -5206, -5207, -5208, -5209, -5210, -5211, -5212, -5213, -5214, -5215, -5216, -5217, -5218, -5219, -5220, -5221, -5222, -5223, -5224, -5225, -5226, -5227, -5228, -5229, -5230, -5231, -5233, -5234, -5235, -5236, -5237, -5238, -5239, -5240, -5241, -5242, -5243, -5244, -5245, -5246, -5247, -5248, -5249, -5250, -5251, -5252, -5253, -5254, -5255, -5256, -5257, -5258, -5259, -5260, -5261, -5262, -5263, -5264, -5265, -5266, -5267, -5268, -5269, -5270, -5271, -5272, -5273, -5274, -5275, -5276, -5277, -5278, -5279, -5280, -5281, -5282, -5283, -5284, -5285, -5286, -5287, -5288, -5289, -5290, -5291, -5292, -5293, -5294, -5295, -5296, -5297, -5298, -5299, -5300, -5301, -5302, -5303, -5304, -5305, -5306, -5307, -5308, -5309, -5310, -5311, -5312, -5313, -5314, -5315, -5316, -5317, -5318, -5319, -5320, -5321, -5322, -5323, -5324, -5325, -5326, -5327, -5328, -5329, -5330, -5331, -5332, -5333, -5334, -5335, -5336, -5337, -5338, -5339, -5340, -5341, -5342, -5343, -5344, -5345, -5346, -5347, -5348, -5349, -5350, -5351, -5352, -5353, -5354, -5355, -5356, -5357, -5358, -5359, -5360, -5361, -5362, -5363, -5364, -5365, -5366, -5367, -5368, -5369, -5370, -5371, -5372, -5373, -5374, -5375, -5376, -5377, -5378, -5379, -5380, -5381, -5382, -5383, -5384, -5385, -5400, -5401, -5402, -5403, -5404, -5405, -5406, -5407, -5408, -5409, -5410, -5411, -5412, -5413, -5414, -5415, -5416, -5417, -5418, -5419, -5420, -5421, -5422, -5423, -5424, -5425, -5426, -5427, -5428, -5429, -5430, -5431, -5432, -5433, -5434, -5435, -5436, -5437, -5438, -5439, -5440, -5441, -5442, -5443, -5444, -5445, -5446, -5447, -5448, -5449, -5450, -5451, -5452, -5453, -5454, -5455, -5456, -5457, -5458, -5459, -5460, -5461, -5462, -5463, -5464, -5465, -5466, -5467, -5468, -5469, -5470, -5471, -5472, -5473, -5474, -5475, -5476, -5477, -5478, -5479, -5480, -5481, -5482, -5483, -5484, -5485, -5486, -5487, -5488, -5489, -5490, -5491, -5492, -5541, -5542, -5543, -5544, -5545, -5546, -5547, -5548, -5549, -5550, -5551, -5552, -5553, -5554, -5555, -5556, -5557, -5558, -5559, -5560, -5561, -5562, -5563, -5564, -5565, -5566, -5567, -5568, -5569, -5570, -5571, -5572, -5573, -5574, -5575, -5576, -5577, -5578, -5579, -5580, -5581, -5582, -5583, -5584, -5585, -5586, -5587, -5588, -5589, -5590, -5591, -5592, -5593, -5594, -5595, -5596, -5597, -5598, -5599, -5600, -5601, -5602, -5603, -5604, -5605, -5607, -5608, -5609, -5610, -5611, -5612, -5613, -5614, -5615, -5616, -5617, -5618, -5619, -5620, -5621, -5622, -5623, -5624, -5625, -5626, -5627, -5628, -5629, -5630, -5631, -5632, -5633, -5634, -5635, -5636, -5637, -5638, -5639, -5640, -5641, -5642, -5643, -5644, -5645, -5646, -5647, -5648, -5649, -5650, -5651, -5652, -5653, -5654, -5655, -5656, -5657, -5658, -5659, -5660, -5661, -5662, -5663, -5664, -5665, -5666, -5667, -5668, -5671, -5672, -5673, -5674, -5675, -5676, -5677, -5678, -5679, -5680, -5681, -5682, -5683, -5684, -5685, -5686, -5687, -5688, -5689, -5690, -5691, -5692, -5693, -5694, -5695, -5696, -5697, -5698, -5699, -5700, -5701, -5702, -5703, -5704, -5705, -5706, -5707, -5708, -5709, -5710, -5711, -5712, -5713, -5714, -5715, -5716, -5717, -5718, -5719, -5720, -5721, -5722, -5723, -5724, -5725, -5726, -5727, -5728, -5729, -5730, -5731, -5732, -5733, -5734, -5735, -5736, -5737, -5738, -5739, -5740, -5741, -5742, -5743, -5744, -5745, -5746, -5747, -5748, -5749, -5750, -5751, -5752, -5753, -5754, -5755, -5756, -5757, -5758, -5759, -5760, -5761, -5762, -5763, -5764, -5765, -5766, -5768, -5769, -5770, -5771, -5772, -5773, -5774, -5777, -5778, -5779, -5780, -5781, -5785, -5786, -5787, -5788, -5789, -5790, -5791, -5792, -5793, -5794, -5795, -5796, -5797, -5798, -5799, -5800, -5801, -5802, -5803, -5804, -5805, -5806, -5807, -5808, -5809, -5810, -5811, -5812, -5813, -5814, -5815, -5816, -5817, -5818, -5819, -5820, -5821, -5822, -5823, -5824, -5825, -5826, -5827, -5828, -5829, -5830, -5831, -5832, -5833, -5834, -5835, -5836, -5837, -5838, -5839, -5840, -5841, -5842, -5843, -5844, -5845, -5846, -5847, -5848, -5849, -5850, -5851, -5852, -5853, -5854, -5855, -5856, -5857, -5858, -5859, -5860, -5861, -5862, -5863, -5864, -5865, -5866, -5867, -5868, -5869, -5870, -5871, -5872, -5873, -5874, -5875, -5876, -5877, -5878, -5879, -5880, -5881, -5882, -5883, -5884, -5885, -5886, -5887, -5888, -5889, -5890, -5891, -5892, -5893, -5894, -5895, -5896, -5897, -5898, -5899, -5900, -5901, -5902, -5903, -5904, -5905, -5906, -5907, -5908, -5909, -5910, -5911, -5912, -5913, -5914, -5915, -5916, -5917, -5918, -5919, -5920, -5921, -5922, -5923, -5924, -5925, -5926, -5927, -5928, -5929, -5930, -5931, -5932, -5933, -5934, -5935, -5936, -5937, -5938, -5939, -5940, -5941, -5942, -5943, -5944, -5945, -5946, -5947, -5948, -5949, -5950, -5951, -5952, -5953, -5954, -5955, -5956, -5957, -5958, -5959, -5960, -5961, -5962, -5963, -5964, -5965, -5966, -5967, -5968, -5969, -5970, -5971, -5972, -5973, -5974, -5975, -5976, -5977, -5978, -5979, -5980, -5981, -5982, -5983, -5984, -5985, -5986, -5987, -5988, -5989, -5990, -5991, -5992, -5993, -5994, -5995, -5996, -5997, -5998, -5999, -6000, -6001, -6002, -6003, -6004, -6005, -6006, -6201, -6202, -6203, -6204, -6205, -6206, -6207, -6208, -6209, -6210, -6211, -6212, -6213, -6214, -6215, -6219, -6220, -6221, -6222, -6223, -6224, -6225, -6226, -6227, -6228, -6229, -6230, -6231, -6232, -6233, -6234, -6235, -6236, -6237, -6238, -6239, -6240, -6241, -6242, -6243, -6244, -6245, -6246, -6247, -6248, -6249, -6250, -6251, -6252, -6253, -6254, -6255, -6256, -6257, -6258, -6259, -6260, -6261, -6262, -6263, -6264, -6265, -6266, -6267, -6268, -6269, -6270, -6271, -6272, -6273, -6274, -6275, -6276, -6277, -6278, -6279, -6280, -6281, -6301, -6302, -6303, -6304, -6305, -6306, -6307, -6308, -6309, -6310, -6311, -6312, -6313, -6314, -6315, -6316, -6317, -6318, -6319, -6320, -6321, -6322, -6323, -6324, -7000, -7001, -7002, -7003, -7004, -7005, -7006, -7007, -7010, -7011, -7012, -7013, -7014, -7015, -7021, -7022, -7024, -7025, -7026, -7027, -7029, -7030, -7031, -7032, -7033, -7034, -7035, -7036, -7037, -7038, -7039, -7040, -7041, -7100, -7101, -7102, -7103, -7104, -7105, -7106, -7107, -7108, -7109, -7110, -7111, -7112, -7201, -7202, -7203, -7204, -7205, -7206, -7207, -7208, -7209, -7210, -7211, -7212, -7213, -7214, -7215, -7216, -7217, -7218, -7219, -7220, -7221, -7222, -7223, -7224, -7225, -7226, -7227, -7228, -7229, -7230, -7231, -7232, -7233, -7234, -7235, -7236, -7237, -7238, -7239, -7240, -7241, -7242, -7243, -7244, -7246, -7247, -7248, -7249, -7250, -7251, -7252, -7253, -7254, -7255, -7256, -7257, -7258, -7259, -7260, -7261, -7262, -7263, -7264, -7265, -7266, -7267, -7268, -7269, -7270, -7271, -7272, -7273, -7274, -7275, -7276, -7277, -7278, -7279, -7280, -7281, -7282, -7283, -7284, -7285, -7286, -7287, -7288, -8001, -8002, -8003, -8004, -8005, -9001, -9002, -9003, -9004, -9005, -9006, -9007, -9008, -9009, -9010, -9011, -9012, -9013, -9014, -9015, -9016, -9017, -9018, -9019, -9020, -9022, -9023, -9024, -9025, -9026, -9027, -9028, -9029, -9030, -9031, -9032, -9033, -9034, -9035, -9036, -9037, -9038, -9039, -9040, -9041, -9042, -9043, -9044, -9045, -9046, -9047, -9048, -9049, -9050, -9051, -9052, -9053, -9054, -9057, -9058, -9059, -9060, -9061, -9062, -9063, -9064, -9065, -9069, -9070, -9071, -9072, -9073, -9074, -9075, -9076, -9077, -9078, -9079, -9080, -9081, -9082, -9083, -9084, -9085, -9086, -9087, -9090, -9091, -9092, -9093, -9100, -9101, -9102, -9103, -9200, -9201, -9202, -9501, -9502, -9503, -9504, -9505, -9506, -9507, -9508, -9509, -9510, -9512, -9513, -9514, -9515, -9516, -9518, -9519, -9520, -9521, -9522, -9523, -9524, -9525, -9526, -9527, -9528, -9529, -9530, -9531, -9532, -9533, -9534, -9535, -9536, -9537, -9538, -9539, -9540, -9541, -9542, -9543, -9544, -9545, -9546, -9547, -9548, -9549, -9550, -9551, -9552, -9553, -9554, -9555, -9556, -9557, -9558, -9559, -9560, -9561, -9562, -9563, -9564, -9565, -9566, -9567, -9568, -9569, -9570, -9571, -9572, -9573, -9574, -9575, -9576, -9577, -9578, -9579, -9580, -9581, -9582, -9583, -9584, -9585, -9586, -9587, -9588, -9589, -9590, -9591, -9592, -9593, -9594, -9595, -9596, -9597, -9598, -9599, -9600, -9601, -9602, -9603, -9604, -9605, -9606, -9607, -9608, -9609, -9610, -9611, -9612, -9613, -9614, -9615, -9616, -9617, -9618, -9619, -9620, -9621, -9622, -9623, -9624, -9625, -9626, -9627, -9628, -9629, -9630, -9631, -9632, -9633, -9634, -9635, -9636, -9637, -9638, -9639, -9640, -9641, -9642, -9643, -9644, -9645, -9646, -9647, -9648, -9649, -9650, -9651, -9652, -9653, -9654, -9655, -9656, -9657, -9658, -9659, -9660, -9661, -9662, -9663, -9664, -9665, -9666, -9667, -9668, -9669, -9670, -9671, -9672, -9673, -9674, -9675, -9676, -9677, -9678, -9679, -9680, -9681, -9682, -9683, -9684, -9685, -9686, -9687, -9688, -9689, -9690, -9691, -9692, -9693, -9694, -9695, -9696, -9697, -9698, -9699, -9700, -9701, -9702, -9703, -9704, -9705, -9706, -9707, -9708, -9709, -9710, -9711, -9712, -9713, -9714, -9715, -9716, -9717, -9718, -9719, -9720, -9721, -9722, -9723, -9724, -9725, -9726, -9727, -9728, -9729, -9730, -9731, -9732, -9733, -9734, -9735, -9736, -9737, -9738, -9739, -9740, -9741, -9742, -9743, -9744, -9745, -9746, -20000, -21000, -22998, -30926, -32491, -38104, -38105}; +int g_all_ob_errnos[2038] = {0, -4000, -4001, -4002, -4003, -4004, -4005, -4006, -4007, -4008, -4009, -4010, -4011, -4012, -4013, -4014, -4015, -4016, -4017, -4018, -4019, -4020, -4021, -4022, -4023, -4024, -4025, -4026, -4027, -4028, -4029, -4030, -4031, -4032, -4033, -4034, -4035, -4036, -4037, -4038, -4039, -4041, -4042, -4043, -4044, -4045, -4046, -4047, -4048, -4049, -4050, -4051, -4052, -4053, -4054, -4055, -4057, -4058, -4060, -4061, -4062, -4063, -4064, -4065, -4066, -4067, -4068, -4070, -4071, -4072, -4073, -4074, -4075, -4076, -4077, -4078, -4080, -4081, -4084, -4085, -4090, -4097, -4098, -4099, -4100, -4101, -4102, -4103, -4104, -4105, -4106, -4107, -4108, -4109, -4110, -4111, -4112, -4113, -4114, -4115, -4116, -4117, -4118, -4119, -4120, -4121, -4122, -4123, -4124, -4125, -4126, -4127, -4128, -4133, -4138, -4139, -4142, -4143, -4144, -4146, -4147, -4149, -4150, -4151, -4152, -4153, -4154, -4155, -4156, -4157, -4158, -4159, -4160, -4161, -4162, -4163, -4164, -4165, -4166, -4167, -4168, -4169, -4170, -4171, -4172, -4173, -4174, -4175, -4176, -4177, -4178, -4179, -4180, -4181, -4182, -4183, -4184, -4185, -4186, -4187, -4188, -4189, -4190, -4191, -4192, -4200, -4201, -4204, -4205, -4206, -4207, -4208, -4209, -4210, -4211, -4212, -4213, -4214, -4215, -4216, -4217, -4218, -4219, -4220, -4221, -4222, -4223, -4224, -4225, -4226, -4227, -4228, -4229, -4230, -4231, -4232, -4233, -4234, -4235, -4236, -4237, -4238, -4239, -4240, -4241, -4242, -4243, -4244, -4245, -4246, -4247, -4248, -4249, -4250, -4251, -4252, -4253, -4254, -4255, -4256, -4257, -4258, -4260, -4261, -4262, -4263, -4264, -4265, -4266, -4267, -4268, -4269, -4270, -4271, -4273, -4274, -4275, -4276, -4277, -4278, -4279, -4280, -4281, -4282, -4283, -4284, -4285, -4286, -4287, -4288, -4289, -4290, -4291, -4292, -4293, -4294, -4295, -4296, -4297, -4298, -4299, -4300, -4301, -4302, -4303, -4304, -4305, -4306, -4307, -4308, -4309, -4310, -4311, -4312, -4313, -4314, -4315, -4316, -4317, -4318, -4319, -4320, -4321, -4322, -4323, -4324, -4325, -4326, -4327, -4328, -4329, -4330, -4331, -4332, -4333, -4334, -4335, -4336, -4337, -4338, -4339, -4340, -4341, -4342, -4343, -4344, -4345, -4346, -4347, -4348, -4349, -4350, -4351, -4352, -4353, -4354, -4355, -4356, -4357, -4358, -4359, -4360, -4361, -4362, -4363, -4364, -4365, -4366, -4367, -4368, -4369, -4370, -4371, -4372, -4373, -4374, -4375, -4376, -4377, -4378, -4379, -4380, -4381, -4382, -4383, -4385, -4386, -4387, -4388, -4389, -4390, -4391, -4392, -4393, -4394, -4395, -4396, -4505, -4507, -4510, -4512, -4515, -4517, -4518, -4519, -4523, -4524, -4525, -4526, -4527, -4528, -4529, -4530, -4531, -4532, -4533, -4537, -4538, -4539, -4540, -4541, -4542, -4543, -4544, -4545, -4546, -4547, -4548, -4549, -4550, -4551, -4552, -4553, -4554, -4600, -4601, -4602, -4603, -4604, -4605, -4606, -4607, -4608, -4609, -4610, -4611, -4613, -4614, -4615, -4620, -4621, -4622, -4623, -4624, -4625, -4626, -4628, -4629, -4630, -4631, -4632, -4633, -4634, -4636, -4637, -4638, -4639, -4640, -4641, -4642, -4643, -4644, -4645, -4646, -4647, -4648, -4649, -4650, -4651, -4652, -4653, -4654, -4655, -4656, -4657, -4658, -4659, -4660, -4661, -4662, -4663, -4664, -4665, -4666, -4667, -4668, -4669, -4670, -4671, -4672, -4673, -4674, -4675, -4676, -4677, -4678, -4679, -4680, -4681, -4682, -4683, -4684, -4685, -4686, -4687, -4688, -4689, -4690, -4691, -4692, -4693, -4694, -4695, -4696, -4697, -4698, -4699, -4700, -4701, -4702, -4703, -4704, -4705, -4706, -4707, -4708, -4709, -4710, -4711, -4712, -4713, -4714, -4715, -4716, -4717, -4718, -4719, -4720, -4721, -4722, -4723, -4724, -4725, -4726, -4727, -4728, -4729, -4730, -4731, -4732, -4733, -4734, -4735, -4736, -4737, -4738, -4739, -4740, -4741, -4742, -4743, -4744, -4745, -4746, -4747, -4748, -4749, -4750, -4751, -4752, -4753, -4754, -4755, -4756, -5000, -5001, -5002, -5003, -5006, -5007, -5008, -5010, -5011, -5012, -5014, -5015, -5016, -5017, -5018, -5019, -5020, -5022, -5023, -5024, -5025, -5026, -5027, -5028, -5029, -5030, -5031, -5032, -5034, -5035, -5036, -5037, -5038, -5039, -5040, -5041, -5042, -5043, -5044, -5046, -5047, -5050, -5051, -5052, -5053, -5054, -5055, -5056, -5057, -5058, -5059, -5061, -5063, -5064, -5065, -5066, -5067, -5068, -5069, -5070, -5071, -5072, -5073, -5074, -5080, -5081, -5083, -5084, -5085, -5086, -5087, -5088, -5089, -5090, -5091, -5092, -5093, -5094, -5095, -5096, -5097, -5098, -5099, -5100, -5101, -5102, -5103, -5104, -5105, -5106, -5107, -5108, -5109, -5110, -5111, -5112, -5113, -5114, -5115, -5116, -5117, -5118, -5119, -5120, -5121, -5122, -5123, -5124, -5125, -5130, -5131, -5133, -5134, -5135, -5136, -5137, -5138, -5139, -5140, -5142, -5143, -5144, -5145, -5146, -5147, -5148, -5149, -5150, -5151, -5153, -5154, -5155, -5156, -5157, -5158, -5159, -5160, -5161, -5162, -5163, -5164, -5165, -5166, -5167, -5168, -5169, -5170, -5171, -5172, -5173, -5174, -5175, -5176, -5177, -5178, -5179, -5180, -5181, -5182, -5183, -5184, -5185, -5187, -5188, -5189, -5190, -5191, -5192, -5193, -5194, -5195, -5196, -5197, -5198, -5199, -5200, -5201, -5202, -5203, -5204, -5205, -5206, -5207, -5208, -5209, -5210, -5211, -5212, -5213, -5214, -5215, -5216, -5217, -5218, -5219, -5220, -5221, -5222, -5223, -5224, -5225, -5226, -5227, -5228, -5229, -5230, -5231, -5233, -5234, -5235, -5236, -5237, -5238, -5239, -5240, -5241, -5242, -5243, -5244, -5245, -5246, -5247, -5248, -5249, -5250, -5251, -5252, -5253, -5254, -5255, -5256, -5257, -5258, -5259, -5260, -5261, -5262, -5263, -5264, -5265, -5266, -5267, -5268, -5269, -5270, -5271, -5272, -5273, -5274, -5275, -5276, -5277, -5278, -5279, -5280, -5281, -5282, -5283, -5284, -5285, -5286, -5287, -5288, -5289, -5290, -5291, -5292, -5293, -5294, -5295, -5296, -5297, -5298, -5299, -5300, -5301, -5302, -5303, -5304, -5305, -5306, -5307, -5308, -5309, -5310, -5311, -5312, -5313, -5314, -5315, -5316, -5317, -5318, -5319, -5320, -5321, -5322, -5323, -5324, -5325, -5326, -5327, -5328, -5329, -5330, -5331, -5332, -5333, -5334, -5335, -5336, -5337, -5338, -5339, -5340, -5341, -5342, -5343, -5344, -5345, -5346, -5347, -5348, -5349, -5350, -5351, -5352, -5353, -5354, -5355, -5356, -5357, -5358, -5359, -5360, -5361, -5362, -5363, -5364, -5365, -5366, -5367, -5368, -5369, -5370, -5371, -5372, -5373, -5374, -5375, -5376, -5377, -5378, -5379, -5380, -5381, -5382, -5383, -5384, -5385, -5400, -5401, -5402, -5403, -5404, -5405, -5406, -5407, -5408, -5409, -5410, -5411, -5412, -5413, -5414, -5415, -5416, -5417, -5418, -5419, -5420, -5421, -5422, -5423, -5424, -5425, -5426, -5427, -5428, -5429, -5430, -5431, -5432, -5433, -5434, -5435, -5436, -5437, -5438, -5439, -5440, -5441, -5442, -5443, -5444, -5445, -5446, -5447, -5448, -5449, -5450, -5451, -5452, -5453, -5454, -5455, -5456, -5457, -5458, -5459, -5460, -5461, -5462, -5463, -5464, -5465, -5466, -5467, -5468, -5469, -5470, -5471, -5472, -5473, -5474, -5475, -5476, -5477, -5478, -5479, -5480, -5481, -5482, -5483, -5484, -5485, -5486, -5487, -5488, -5489, -5490, -5491, -5492, -5541, -5542, -5543, -5544, -5545, -5546, -5547, -5548, -5549, -5550, -5551, -5552, -5553, -5554, -5555, -5556, -5557, -5558, -5559, -5560, -5561, -5562, -5563, -5564, -5565, -5566, -5567, -5568, -5569, -5570, -5571, -5572, -5573, -5574, -5575, -5576, -5577, -5578, -5579, -5580, -5581, -5582, -5583, -5584, -5585, -5586, -5587, -5588, -5589, -5590, -5591, -5592, -5593, -5594, -5595, -5596, -5597, -5598, -5599, -5600, -5601, -5602, -5603, -5604, -5605, -5607, -5608, -5609, -5610, -5611, -5612, -5613, -5614, -5615, -5616, -5617, -5618, -5619, -5620, -5621, -5622, -5623, -5624, -5625, -5626, -5627, -5628, -5629, -5630, -5631, -5632, -5633, -5634, -5635, -5636, -5637, -5638, -5639, -5640, -5641, -5642, -5643, -5644, -5645, -5646, -5647, -5648, -5649, -5650, -5651, -5652, -5653, -5654, -5655, -5656, -5657, -5658, -5659, -5660, -5661, -5662, -5663, -5664, -5665, -5666, -5667, -5668, -5671, -5672, -5673, -5674, -5675, -5676, -5677, -5678, -5679, -5680, -5681, -5682, -5683, -5684, -5685, -5686, -5687, -5688, -5689, -5690, -5691, -5692, -5693, -5694, -5695, -5696, -5697, -5698, -5699, -5700, -5701, -5702, -5703, -5704, -5705, -5706, -5707, -5708, -5709, -5710, -5711, -5712, -5713, -5714, -5715, -5716, -5717, -5718, -5719, -5720, -5721, -5722, -5723, -5724, -5725, -5726, -5727, -5728, -5729, -5730, -5731, -5732, -5733, -5734, -5735, -5736, -5737, -5738, -5739, -5740, -5741, -5742, -5743, -5744, -5745, -5746, -5747, -5748, -5749, -5750, -5751, -5752, -5753, -5754, -5755, -5756, -5757, -5758, -5759, -5760, -5761, -5762, -5763, -5764, -5765, -5766, -5768, -5769, -5770, -5771, -5772, -5773, -5774, -5777, -5778, -5779, -5780, -5781, -5785, -5786, -5787, -5788, -5789, -5790, -5791, -5792, -5793, -5794, -5795, -5796, -5797, -5798, -5799, -5800, -5801, -5802, -5803, -5804, -5805, -5806, -5807, -5808, -5809, -5810, -5811, -5812, -5813, -5814, -5815, -5816, -5817, -5818, -5819, -5820, -5821, -5822, -5823, -5824, -5825, -5826, -5827, -5828, -5829, -5830, -5831, -5832, -5833, -5834, -5835, -5836, -5837, -5838, -5839, -5840, -5841, -5842, -5843, -5844, -5845, -5846, -5847, -5848, -5849, -5850, -5851, -5852, -5853, -5854, -5855, -5856, -5857, -5858, -5859, -5860, -5861, -5862, -5863, -5864, -5865, -5866, -5867, -5868, -5869, -5870, -5871, -5872, -5873, -5874, -5875, -5876, -5877, -5878, -5879, -5880, -5881, -5882, -5883, -5884, -5885, -5886, -5887, -5888, -5889, -5890, -5891, -5892, -5893, -5894, -5895, -5896, -5897, -5898, -5899, -5900, -5901, -5902, -5903, -5904, -5905, -5906, -5907, -5908, -5909, -5910, -5911, -5912, -5913, -5914, -5915, -5916, -5917, -5918, -5919, -5920, -5921, -5922, -5923, -5924, -5925, -5926, -5927, -5928, -5929, -5930, -5931, -5932, -5933, -5934, -5935, -5936, -5937, -5938, -5939, -5940, -5941, -5942, -5943, -5944, -5945, -5946, -5947, -5948, -5949, -5950, -5951, -5952, -5953, -5954, -5955, -5956, -5957, -5958, -5959, -5960, -5961, -5962, -5963, -5964, -5965, -5966, -5967, -5968, -5969, -5970, -5971, -5972, -5973, -5974, -5975, -5976, -5977, -5978, -5979, -5980, -5981, -5982, -5983, -5984, -5985, -5986, -5987, -5988, -5989, -5990, -5991, -5992, -5993, -5994, -5995, -5996, -5997, -5998, -5999, -6000, -6001, -6002, -6003, -6004, -6005, -6006, -6201, -6202, -6203, -6204, -6205, -6206, -6207, -6208, -6209, -6210, -6211, -6212, -6213, -6214, -6215, -6219, -6220, -6221, -6222, -6223, -6224, -6225, -6226, -6227, -6228, -6229, -6230, -6231, -6232, -6233, -6234, -6235, -6236, -6237, -6238, -6239, -6240, -6241, -6242, -6243, -6244, -6245, -6246, -6247, -6248, -6249, -6250, -6251, -6252, -6253, -6254, -6255, -6256, -6257, -6258, -6259, -6260, -6261, -6262, -6263, -6264, -6265, -6266, -6267, -6268, -6269, -6270, -6271, -6272, -6273, -6274, -6275, -6276, -6277, -6278, -6279, -6280, -6281, -6301, -6302, -6303, -6304, -6305, -6306, -6307, -6308, -6309, -6310, -6311, -6312, -6313, -6314, -6315, -6316, -6317, -6318, -6319, -6320, -6321, -6322, -6323, -6324, -7000, -7001, -7002, -7003, -7004, -7005, -7006, -7007, -7010, -7011, -7012, -7013, -7014, -7015, -7021, -7022, -7024, -7025, -7026, -7027, -7029, -7030, -7031, -7032, -7033, -7034, -7035, -7036, -7037, -7038, -7039, -7040, -7041, -7100, -7101, -7102, -7103, -7104, -7105, -7106, -7107, -7108, -7109, -7110, -7111, -7112, -7201, -7202, -7203, -7204, -7205, -7206, -7207, -7208, -7209, -7210, -7211, -7212, -7213, -7214, -7215, -7216, -7217, -7218, -7219, -7220, -7221, -7222, -7223, -7224, -7225, -7226, -7227, -7228, -7229, -7230, -7231, -7232, -7233, -7234, -7235, -7236, -7237, -7238, -7239, -7240, -7241, -7242, -7243, -7244, -7246, -7247, -7248, -7249, -7250, -7251, -7252, -7253, -7254, -7255, -7256, -7257, -7258, -7259, -7260, -7261, -7262, -7263, -7264, -7265, -7266, -7267, -7268, -7269, -7270, -7271, -7272, -7273, -7274, -7275, -7276, -7277, -7278, -7279, -7280, -7281, -7282, -7283, -7284, -7285, -7286, -7287, -7288, -8001, -8002, -8003, -8004, -8005, -9001, -9002, -9003, -9004, -9005, -9006, -9007, -9008, -9009, -9010, -9011, -9012, -9013, -9014, -9015, -9016, -9017, -9018, -9019, -9020, -9022, -9023, -9024, -9025, -9026, -9027, -9028, -9029, -9030, -9031, -9032, -9033, -9034, -9035, -9036, -9037, -9038, -9039, -9040, -9041, -9042, -9043, -9044, -9045, -9046, -9047, -9048, -9049, -9050, -9051, -9052, -9053, -9054, -9057, -9058, -9059, -9060, -9061, -9062, -9063, -9064, -9065, -9069, -9070, -9071, -9072, -9073, -9074, -9075, -9076, -9077, -9078, -9079, -9080, -9081, -9082, -9083, -9084, -9085, -9086, -9087, -9090, -9091, -9092, -9093, -9100, -9101, -9102, -9103, -9200, -9201, -9202, -9501, -9502, -9503, -9504, -9505, -9506, -9507, -9508, -9509, -9510, -9512, -9513, -9514, -9515, -9516, -9518, -9519, -9520, -9521, -9522, -9523, -9524, -9525, -9526, -9527, -9528, -9529, -9530, -9531, -9532, -9533, -9534, -9535, -9536, -9537, -9538, -9539, -9540, -9541, -9542, -9543, -9544, -9545, -9546, -9547, -9548, -9549, -9550, -9551, -9552, -9553, -9554, -9555, -9556, -9557, -9558, -9559, -9560, -9561, -9562, -9563, -9564, -9565, -9566, -9567, -9568, -9569, -9570, -9571, -9572, -9573, -9574, -9575, -9576, -9577, -9578, -9579, -9580, -9581, -9582, -9583, -9584, -9585, -9586, -9587, -9588, -9589, -9590, -9591, -9592, -9593, -9594, -9595, -9596, -9597, -9598, -9599, -9600, -9601, -9602, -9603, -9604, -9605, -9606, -9607, -9608, -9609, -9610, -9611, -9612, -9613, -9614, -9615, -9616, -9617, -9618, -9619, -9620, -9621, -9622, -9623, -9624, -9625, -9626, -9627, -9628, -9629, -9630, -9631, -9632, -9633, -9634, -9635, -9636, -9637, -9638, -9639, -9640, -9641, -9642, -9643, -9644, -9645, -9646, -9647, -9648, -9649, -9650, -9651, -9652, -9653, -9654, -9655, -9656, -9657, -9658, -9659, -9660, -9661, -9662, -9663, -9664, -9665, -9666, -9667, -9668, -9669, -9670, -9671, -9672, -9673, -9674, -9675, -9676, -9677, -9678, -9679, -9680, -9681, -9682, -9683, -9684, -9685, -9686, -9687, -9688, -9689, -9690, -9691, -9692, -9693, -9694, -9695, -9696, -9697, -9698, -9699, -9700, -9701, -9702, -9703, -9704, -9705, -9706, -9707, -9708, -9709, -9710, -9711, -9712, -9713, -9714, -9715, -9716, -9717, -9718, -9719, -9720, -9721, -9722, -9723, -9724, -9725, -9726, -9727, -9728, -9729, -9730, -9731, -9732, -9733, -9734, -9735, -9736, -9737, -9738, -9739, -9740, -9741, -9742, -9743, -9744, -9745, -9746, -9747, -20000, -21000, -22998, -30926, -32491, -38104, -38105}; const char *ob_error_name(const int err) { const char *ret = "Unknown error"; diff --git a/src/share/ob_errno.def b/src/share/ob_errno.def index d063abc4d7..203e1ecf96 100644 --- a/src/share/ob_errno.def +++ b/src/share/ob_errno.def @@ -2238,6 +2238,7 @@ DEFINE_ERROR_EXT(OB_ERR_SP_NO_DROP_SP, -9743, ER_SP_NO_DROP_SP, "HY000", "Can't DEFINE_ORACLE_ERROR(OB_ERR_RECOMPILATION_OBJECT, -9744, -1, "HY000", "errors during recompilation/revalidation of object", 4045, "errors during recompilation/revalidation of %.*s.%.*s"); DEFINE_ORACLE_ERROR(OB_ERR_VARIABLE_NOT_IN_SELECT_LIST, -9745, -1, "HY000", "variable not in select list", 1007, "variable not in select list"); DEFINE_ORACLE_ERROR(OB_ERR_MULTI_RECORD, -9746, -1, "HY000", "coercion into multiple record targets not supported", 494, "coercion into multiple record targets not supported"); +DEFINE_ERROR(OB_ERR_MALFORMED_PS_PACKET, -9747, -1, "HY000", "malformed ps packet"); //////////////////////////////////////////////////////////////// // !!! text/blob || clob/blob erro code // for compat we cant not remove this errno!!!! diff --git a/src/share/ob_errno.h b/src/share/ob_errno.h index cec324c29a..0d873e703d 100644 --- a/src/share/ob_errno.h +++ b/src/share/ob_errno.h @@ -1698,6 +1698,7 @@ constexpr int OB_ERR_SP_NO_DROP_SP = -9743; constexpr int OB_ERR_RECOMPILATION_OBJECT = -9744; constexpr int OB_ERR_VARIABLE_NOT_IN_SELECT_LIST = -9745; constexpr int OB_ERR_MULTI_RECORD = -9746; +constexpr int OB_ERR_MALFORMED_PS_PACKET = -9747; constexpr int OB_SP_RAISE_APPLICATION_ERROR = -20000; constexpr int OB_SP_RAISE_APPLICATION_ERROR_NUM = -21000; constexpr int OB_CLOB_ONLY_SUPPORT_WITH_MULTIBYTE_FUN = -22998; @@ -3739,6 +3740,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_ERR_RECOMPILATION_OBJECT__USER_ERROR_MSG "errors during recompilation/revalidation of object" #define OB_ERR_VARIABLE_NOT_IN_SELECT_LIST__USER_ERROR_MSG "variable not in select list" #define OB_ERR_MULTI_RECORD__USER_ERROR_MSG "coercion into multiple record targets not supported" +#define OB_ERR_MALFORMED_PS_PACKET__USER_ERROR_MSG "malformed ps packet" #define OB_SP_RAISE_APPLICATION_ERROR__USER_ERROR_MSG "%.*s" #define OB_SP_RAISE_APPLICATION_ERROR_NUM__USER_ERROR_MSG "error number argument to raise_application_error of '%d' is out of range" #define OB_CLOB_ONLY_SUPPORT_WITH_MULTIBYTE_FUN__USER_ERROR_MSG "CLOB or NCLOB in multibyte character set not supported" @@ -5780,6 +5782,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_ERR_RECOMPILATION_OBJECT__ORA_USER_ERROR_MSG "ORA-04045: errors during recompilation/revalidation of %.*s.%.*s" #define OB_ERR_VARIABLE_NOT_IN_SELECT_LIST__ORA_USER_ERROR_MSG "ORA-01007: variable not in select list" #define OB_ERR_MULTI_RECORD__ORA_USER_ERROR_MSG "ORA-00494: coercion into multiple record targets not supported" +#define OB_ERR_MALFORMED_PS_PACKET__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9747, malformed ps packet" #define OB_SP_RAISE_APPLICATION_ERROR__ORA_USER_ERROR_MSG "ORA%06ld: %.*s" #define OB_SP_RAISE_APPLICATION_ERROR_NUM__ORA_USER_ERROR_MSG "ORA-21000: error number argument to raise_application_error of '%d' is out of range" #define OB_CLOB_ONLY_SUPPORT_WITH_MULTIBYTE_FUN__ORA_USER_ERROR_MSG "ORA-22998: CLOB or NCLOB in multibyte character set not supported" @@ -5790,7 +5793,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_ERR_DATA_TOO_LONG_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-12899: value too large for column %.*s (actual: %ld, maximum: %ld)" #define OB_ERR_INVALID_DATE_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-01861: Incorrect datetime value for column '%.*s' at row %ld" -extern int g_all_ob_errnos[2037]; +extern int g_all_ob_errnos[2038]; const char *ob_error_name(const int oberr); const char* ob_error_cause(const int oberr);