[SCN] modify missing scenes
This commit is contained in:
@ -250,7 +250,7 @@ int ObDatumHexUtils::hex(const ObExpr &expr, const ObString &in_str, ObEvalCtx &
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
LOG_WARN("alloc memory failed", K(ret), K(alloc_length));
|
||||
} else {
|
||||
static const char *HEXCHARS = upper_case ? "0123456789ABCDEF" : "0123456789abcdef";
|
||||
const char *HEXCHARS = upper_case ? "0123456789ABCDEF" : "0123456789abcdef";
|
||||
int32_t pos = 0;
|
||||
for (int32_t i = 0; i < in_str.length(); ++i) {
|
||||
buf[pos++] = HEXCHARS[in_str[i] >> 4 & 0xF];
|
||||
|
||||
@ -262,7 +262,7 @@ int ObExprJsonSearch::eval_json_search(const ObExpr &expr, ObEvalCtx &ctx, ObDat
|
||||
}
|
||||
|
||||
// check one_or_all flag
|
||||
bool one_flag;
|
||||
bool one_flag = false;
|
||||
if (OB_SUCC(ret) && !is_null) {
|
||||
json_arg = expr.args_[1];
|
||||
val_type = json_arg->datum_meta_.type_;
|
||||
|
||||
@ -1151,7 +1151,7 @@ int ObExprJsonValue::cast_to_res(common::ObIAllocator *allocator,
|
||||
case ObMediumIntType:
|
||||
case ObInt32Type:
|
||||
case ObIntType: {
|
||||
int64_t val;
|
||||
int64_t val = 0;
|
||||
ret = cast_to_int(j_base, dst_type, val);
|
||||
if (!try_set_error_val<ObDatum>(res, ret, error_type, error_val, "SIGNED")) {
|
||||
res.set_int(val);
|
||||
@ -1163,7 +1163,7 @@ int ObExprJsonValue::cast_to_res(common::ObIAllocator *allocator,
|
||||
case ObUMediumIntType:
|
||||
case ObUInt32Type:
|
||||
case ObUInt64Type: {
|
||||
uint64_t val;
|
||||
uint64_t val = 0;
|
||||
ret = cast_to_uint(j_base, dst_type, val);
|
||||
if (!try_set_error_val<ObDatum>(res, ret, error_type, error_val, "UNSIGNED")) {
|
||||
res.set_uint(val);
|
||||
@ -1171,7 +1171,7 @@ int ObExprJsonValue::cast_to_res(common::ObIAllocator *allocator,
|
||||
break;
|
||||
}
|
||||
case ObDateTimeType: {
|
||||
int64_t val;
|
||||
int64_t val = 0;
|
||||
ret = cast_to_datetime(j_base, accuracy, val);
|
||||
if (ret == OB_ERR_NULL_VALUE) {
|
||||
res.set_null();
|
||||
@ -1192,7 +1192,7 @@ int ObExprJsonValue::cast_to_res(common::ObIAllocator *allocator,
|
||||
break;
|
||||
}
|
||||
case ObDateType: {
|
||||
int32_t val;
|
||||
int32_t val = 0;
|
||||
ret = cast_to_date(j_base, val);
|
||||
if (!try_set_error_val<ObDatum>(res, ret, error_type, error_val, "DATE")) {
|
||||
res.set_date(val);
|
||||
@ -1200,7 +1200,7 @@ int ObExprJsonValue::cast_to_res(common::ObIAllocator *allocator,
|
||||
break;
|
||||
}
|
||||
case ObTimeType: {
|
||||
int64_t val;
|
||||
int64_t val = 0;
|
||||
ret = cast_to_time(j_base, accuracy, val);
|
||||
if (!try_set_error_val<ObDatum>(res, ret, error_type, error_val, "TIME")) {
|
||||
res.set_time(val);
|
||||
@ -1208,7 +1208,7 @@ int ObExprJsonValue::cast_to_res(common::ObIAllocator *allocator,
|
||||
break;
|
||||
}
|
||||
case ObYearType: {
|
||||
uint8_t val;
|
||||
uint8_t val = 0;
|
||||
ret = cast_to_year(j_base, val);
|
||||
if (!try_set_error_val<ObDatum>(res, ret, error_type, error_val, "YEAR")) {
|
||||
res.set_year(val);
|
||||
@ -1217,7 +1217,7 @@ int ObExprJsonValue::cast_to_res(common::ObIAllocator *allocator,
|
||||
}
|
||||
case ObFloatType:
|
||||
case ObUFloatType: {
|
||||
float out_val;
|
||||
float out_val = 0;
|
||||
ret = cast_to_float(j_base, dst_type, out_val);
|
||||
if (!try_set_error_val<ObDatum>(res, ret, error_type, error_val, "FLOAT")) {
|
||||
res.set_float(out_val);
|
||||
@ -1226,7 +1226,7 @@ int ObExprJsonValue::cast_to_res(common::ObIAllocator *allocator,
|
||||
}
|
||||
case ObDoubleType:
|
||||
case ObUDoubleType: {
|
||||
double out_val;
|
||||
double out_val = 0;
|
||||
ret = cast_to_double(j_base, dst_type, out_val);
|
||||
if (!try_set_error_val<ObDatum>(res, ret, error_type, error_val, "DOUBLE")) {
|
||||
res.set_double(out_val);
|
||||
@ -1268,7 +1268,7 @@ int ObExprJsonValue::cast_to_res(common::ObIAllocator *allocator,
|
||||
break;
|
||||
}
|
||||
case ObBitType: {
|
||||
uint64_t out_val;
|
||||
uint64_t out_val = 0;
|
||||
ret = cast_to_bit(j_base, out_val);
|
||||
if (!try_set_error_val<ObDatum>(res, ret, error_type, error_val, "BIT")) {
|
||||
res.set_bit(out_val);
|
||||
|
||||
@ -45,12 +45,12 @@ int ObExprLastTraceId::eval_last_trace_id(const ObExpr &expr, ObEvalCtx &ctx,
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
UNUSED(expr);
|
||||
const ObSQLSessionInfo *session_info = NULL;
|
||||
if (OB_ISNULL(session_info = ctx.exec_ctx_.get_my_session())) {
|
||||
const ObPhysicalPlanCtx *phy_plan_ctx = NULL;
|
||||
if (OB_ISNULL(phy_plan_ctx = ctx.exec_ctx_.get_physical_plan_ctx())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
SQL_ENG_LOG(WARN, "session info is null", K(ret));
|
||||
} else {
|
||||
const ObCurTraceId::TraceId &trace_id = session_info->get_last_trace_id();
|
||||
const ObCurTraceId::TraceId &trace_id = phy_plan_ctx->get_last_trace_id();
|
||||
if (trace_id.is_invalid()) {
|
||||
expr_datum.set_null();
|
||||
} else {
|
||||
|
||||
@ -1172,9 +1172,9 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
|
||||
ObVarcharType, /*VarcharType=>HexStringType */
|
||||
ObMaxType, /*VarcharType=>ExtendType */
|
||||
ObVarcharType, /*VarcharType=>UnknownType */
|
||||
ObTinyTextType, /*VarcharType=>ObTinyTextType */
|
||||
ObTextType, /* VarcharType=>ObTextType */
|
||||
ObMediumTextType, /* VarcharType=>ObMediumTextType */
|
||||
ObLongTextType, /*VarcharType=>ObTinyTextType */
|
||||
ObLongTextType, /* VarcharType=>ObTextType */
|
||||
ObLongTextType, /* VarcharType=>ObMediumTextType */
|
||||
ObLongTextType, /* VarcharType=>ObLongTextType */
|
||||
ObVarcharType, /* VarcharType=>ObBitType */
|
||||
ObVarcharType, /* VarcharType=>ObEnumType */
|
||||
@ -1224,9 +1224,9 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
|
||||
ObVarcharType, /*CharType=>HexStringType */
|
||||
ObMaxType, /*CharType=>ExtendType */
|
||||
ObVarcharType, /*CharType=>UnknownType */
|
||||
ObTinyTextType, /*CharType=>ObTinyTextType */
|
||||
ObTextType, /* CharType=>ObTextType */
|
||||
ObMediumTextType, /* CharType=>ObMediumTextType */
|
||||
ObLongTextType, /*CharType=>ObTinyTextType */
|
||||
ObLongTextType, /* CharType=>ObTextType */
|
||||
ObLongTextType, /* CharType=>ObMediumTextType */
|
||||
ObLongTextType, /* CharType=>ObLongTextType */
|
||||
ObCharType, /* CharType=>ObBitType */
|
||||
ObCharType, /* CharType=>ObEnumType */
|
||||
@ -1426,8 +1426,8 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
|
||||
ObTinyTextType, /*ObTinyTextType=>DateType */
|
||||
ObTinyTextType, /*ObTinyTextType=>TimeType */
|
||||
ObTinyTextType, /*ObTinyTextType=>YearType */
|
||||
ObTinyTextType, /*ObTinyTextType=>VarcharType */
|
||||
ObTinyTextType, /*ObTinyTextType=>CharType */
|
||||
ObLongTextType, /*ObTinyTextType=>VarcharType */
|
||||
ObLongTextType, /*ObTinyTextType=>CharType */
|
||||
ObTinyTextType, /*ObTinyTextType=>HexStringType */
|
||||
ObMaxType, /*ObTinyTextType=>ExtendType */
|
||||
ObTinyTextType, /*ObTinyTextType=>UnknownType */
|
||||
@ -1435,9 +1435,9 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
|
||||
ObTextType, /* ObTinyTextType=>ObTextType */
|
||||
ObMediumTextType, /* ObTinyTextType=>ObMediumTextType */
|
||||
ObLongTextType, /* ObTinyTextType=>ObLongTextType */
|
||||
ObTextType, /* ObTinyTextType=>ObBitType */
|
||||
ObTextType, /* ObTinyTextType=>ObEnumType */
|
||||
ObTextType, /* ObTinyTextType=>ObSetType */
|
||||
ObLongTextType, /* ObTinyTextType=>ObBitType */
|
||||
ObLongTextType, /* ObTinyTextType=>ObEnumType */
|
||||
ObLongTextType, /* ObTinyTextType=>ObSetType */
|
||||
ObMaxType, /* ObTinyTextType=>ObEnumInnerType */
|
||||
ObMaxType, /* ObTinyTextType=>ObSetInnerType */
|
||||
ObTinyTextType, /*ObTinyTextType=>ObTimestampTZType */
|
||||
@ -1477,8 +1477,8 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
|
||||
ObTextType, /*ObTextType=>DateType */
|
||||
ObTextType, /*ObTextType=>TimeType */
|
||||
ObTextType, /*ObTextType=>YearType */
|
||||
ObTextType, /*ObTextType=>VarcharType */
|
||||
ObTextType, /*ObTextType=>CharType */
|
||||
ObLongTextType, /*ObTextType=>VarcharType */
|
||||
ObLongTextType, /*ObTextType=>CharType */
|
||||
ObTextType, /*ObTextType=>HexStringType */
|
||||
ObMaxType, /*ObTextType=>ExtendType */
|
||||
ObTextType, /*ObTextType=>UnknownType */
|
||||
@ -1486,9 +1486,9 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
|
||||
ObTextType, /* ObTextType=>ObTextType */
|
||||
ObMediumTextType, /* ObTextType=>ObMediumTextType */
|
||||
ObLongTextType, /* ObTextType=>ObLongTextType */
|
||||
ObMediumTextType, /* ObTextType=>ObBitType */
|
||||
ObMediumTextType, /* ObTextType=>ObEnumType */
|
||||
ObMediumTextType, /* ObTextType=>ObSetType */
|
||||
ObLongTextType, /* ObTextType=>ObBitType */
|
||||
ObLongTextType, /* ObTextType=>ObEnumType */
|
||||
ObLongTextType, /* ObTextType=>ObSetType */
|
||||
ObMaxType, /* ObTextType=>ObEnumInnerType */
|
||||
ObMaxType, /* ObTextType=>ObSetInnerType */
|
||||
ObTextType, /*ObTextType=>ObTimestampTZType */
|
||||
@ -1529,8 +1529,8 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
|
||||
ObMediumTextType, /*ObMediumTextType=>DateType */
|
||||
ObMediumTextType, /*ObMediumTextType=>TimeType */
|
||||
ObMediumTextType, /*ObMediumTextType=>YearType */
|
||||
ObMediumTextType, /*ObMediumTextType=>VarcharType */
|
||||
ObMediumTextType, /*ObMediumTextType=>CharType */
|
||||
ObLongTextType, /*ObMediumTextType=>VarcharType */
|
||||
ObLongTextType, /*ObMediumTextType=>CharType */
|
||||
ObMediumTextType, /*ObMediumTextType=>HexStringType */
|
||||
ObMaxType, /*ObMediumTextType=>ExtendType */
|
||||
ObMediumTextType, /*ObMediumTextType=>UnknownType */
|
||||
@ -1636,8 +1636,8 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
|
||||
ObVarcharType, /*ObBitType=>HexStringType */
|
||||
ObMaxType, /*ObBitType=>ExtendType */
|
||||
ObVarcharType, /*ObBitType=>UnknownType */
|
||||
ObTextType, /*ObBitType=>ObTinyTextType */
|
||||
ObMediumTextType, /* ObBitType=>ObTextType */
|
||||
ObLongTextType, /*ObBitType=>ObTinyTextType */
|
||||
ObLongTextType, /* ObBitType=>ObTextType */
|
||||
ObLongTextType, /* ObBitType=>ObMediumTextType */
|
||||
ObLongTextType, /* ObBitType=>ObLongTextType */
|
||||
ObBitType, /* ObBitType=>ObBitType */
|
||||
@ -1687,8 +1687,8 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
|
||||
ObVarcharType, /*ObEnumType=>HexStringType */
|
||||
ObMaxType, /*ObEnumType=>ExtendType */
|
||||
ObVarcharType, /*ObEnumType=>UnknownType */
|
||||
ObTextType, /*ObEnumType=>ObTinyTextType */
|
||||
ObMediumTextType, /* ObEnumType=>ObTextType */
|
||||
ObLongTextType, /*ObEnumType=>ObTinyTextType */
|
||||
ObLongTextType, /* ObEnumType=>ObTextType */
|
||||
ObLongTextType, /* ObEnumType=>ObMediumTextType */
|
||||
ObLongTextType, /* ObEnumType=>ObLongTextType */
|
||||
ObVarcharType, /* ObEnumType=>ObBitType */
|
||||
@ -1738,8 +1738,8 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
|
||||
ObVarcharType, /*ObSetType=>HexStringType */
|
||||
ObMaxType, /*ObSetType=>ExtendType */
|
||||
ObVarcharType, /*ObSetType=>UnknownType */
|
||||
ObTextType, /*ObSetType=>ObTinyTextType */
|
||||
ObMediumTextType, /* ObSetType=>ObTextType */
|
||||
ObLongTextType, /*ObSetType=>ObTinyTextType */
|
||||
ObLongTextType, /* ObSetType=>ObTextType */
|
||||
ObLongTextType, /* ObSetType=>ObMediumTextType */
|
||||
ObLongTextType, /* ObSetType=>ObLongTextType */
|
||||
ObVarcharType, /* ObSetType=>ObBitType */
|
||||
|
||||
@ -147,8 +147,8 @@ int ObExprRepeat::repeat(ObString &output,
|
||||
if ((length > max_result_size / count) || (length > INT_MAX / count)) {
|
||||
LOG_WARN("Result of repeat was larger than max_allow_packet_size",
|
||||
K(ret), K(length), K(count), K(max_result_size));
|
||||
LOG_USER_WARN(OB_ERR_FUNC_RESULT_TOO_LARGE, "repeat", static_cast<int>(max_result_size));
|
||||
is_null = true;
|
||||
ret = OB_ERR_FUNC_RESULT_TOO_LARGE;
|
||||
LOG_USER_ERROR(OB_ERR_FUNC_RESULT_TOO_LARGE, "repeat", static_cast<int>(max_result_size));
|
||||
} else {
|
||||
//avoid realloc
|
||||
if (1 == count) {
|
||||
|
||||
Reference in New Issue
Block a user