[scn] fix 4377 caused by miss one line code when refresh
This commit is contained in:
@ -72,9 +72,14 @@ int ObSelectIntoOp::inner_open()
|
||||
ObString path = file_name_.get_varchar().trim();
|
||||
if (path.prefix_match_ci(OB_OSS_PREFIX)) {
|
||||
file_location_ = IntoFileLocation::REMOTE_OSS;
|
||||
url_ = path.split_on('?');
|
||||
url_.trim();
|
||||
if (OB_FAIL(access_info_.set(url_.ptr(), path.ptr()))) {
|
||||
ObString temp_url = path.split_on('?');
|
||||
temp_url.trim();
|
||||
ObString storage_info;
|
||||
if (OB_FAIL(ob_write_string(ctx_.get_allocator(), temp_url, url_, true))) {
|
||||
LOG_WARN("fail to append string", K(ret));
|
||||
} else if (OB_FAIL(ob_write_string(ctx_.get_allocator(), path, storage_info, true))) {
|
||||
LOG_WARN("fail to append string", K(ret));
|
||||
} else if (OB_FAIL(access_info_.set(url_.ptr(), storage_info.ptr()))) {
|
||||
LOG_WARN("fail to set access info", K(ret), K(path));
|
||||
}
|
||||
|
||||
|
||||
@ -63,6 +63,7 @@ int ObDDLExecutorUtil::wait_ddl_finish(
|
||||
LOG_WARN("invalid argument", K(ret), K(tenant_id), K(task_id), KP(common_rpc_proxy));
|
||||
} else {
|
||||
int tmp_ret = OB_SUCCESS;
|
||||
bool is_tenant_dropped = false;
|
||||
while (OB_SUCC(ret)) {
|
||||
if (OB_SUCCESS == ObDDLErrorMessageTableOperator::get_ddl_error_message(
|
||||
tenant_id, task_id, -1 /* target_object_id */, unused_addr, false /* is_ddl_retry_task */, *GCTX.sql_proxy_, error_message, unused_user_msg_len)) {
|
||||
@ -71,6 +72,13 @@ int ObDDLExecutorUtil::wait_ddl_finish(
|
||||
FORWARD_USER_ERROR(ret, error_message.user_message_);
|
||||
}
|
||||
break;
|
||||
} else if (OB_TMP_FAIL(GSCHEMASERVICE.check_if_tenant_has_been_dropped(
|
||||
tenant_id, is_tenant_dropped))) {
|
||||
LOG_WARN("check if tenant has been dropped failed", K(tmp_ret), K(tenant_id));
|
||||
} else if (is_tenant_dropped) {
|
||||
ret = OB_TENANT_HAS_BEEN_DROPPED;
|
||||
LOG_WARN("tenant has been dropped", K(ret), K(tenant_id));
|
||||
break;
|
||||
} else if (OB_FAIL(handle_session_exception(session))) {
|
||||
LOG_WARN("session exeception happened", K(ret), K(is_support_cancel));
|
||||
if (is_support_cancel && OB_TMP_FAIL(cancel_ddl_task(tenant_id, common_rpc_proxy))) {
|
||||
@ -90,6 +98,8 @@ int ObDDLExecutorUtil::wait_ddl_finish(
|
||||
int ObDDLExecutorUtil::wait_build_index_finish(const uint64_t tenant_id, const int64_t task_id, bool &is_finish)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
int tmp_ret = OB_SUCCESS;
|
||||
bool is_tenant_dropped = false;
|
||||
ObAddr unused_addr;
|
||||
int64_t unused_user_msg_len = 0;
|
||||
THIS_WORKER.set_timeout_ts(ObTimeUtility::current_time() + OB_MAX_USER_SPECIFIED_TIMEOUT);
|
||||
@ -106,6 +116,12 @@ int ObDDLExecutorUtil::wait_build_index_finish(const uint64_t tenant_id, const i
|
||||
FORWARD_USER_ERROR(ret, error_message.user_message_);
|
||||
}
|
||||
is_finish = true;
|
||||
} else if (OB_TMP_FAIL(GSCHEMASERVICE.check_if_tenant_has_been_dropped(
|
||||
tenant_id, is_tenant_dropped))) {
|
||||
LOG_WARN("check if tenant has been dropped failed", K(tmp_ret), K(tenant_id));
|
||||
} else if (is_tenant_dropped) {
|
||||
ret = OB_TENANT_HAS_BEEN_DROPPED;
|
||||
LOG_WARN("tenant has been dropped", K(ret), K(tenant_id));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -129,6 +145,7 @@ int ObDDLExecutorUtil::wait_ddl_retry_task_finish(
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid argument", K(ret), K(tenant_id), K(task_id), KP(common_rpc_proxy));
|
||||
} else {
|
||||
bool is_tenant_dropped = false;
|
||||
int tmp_ret = OB_SUCCESS;
|
||||
while (OB_SUCC(ret)) {
|
||||
if (OB_SUCCESS == ObDDLErrorMessageTableOperator::get_ddl_error_message(
|
||||
@ -165,6 +182,13 @@ int ObDDLExecutorUtil::wait_ddl_retry_task_finish(
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else if (OB_TMP_FAIL(GSCHEMASERVICE.check_if_tenant_has_been_dropped(
|
||||
tenant_id, is_tenant_dropped))) {
|
||||
LOG_WARN("check if tenant has been dropped failed", K(tmp_ret), K(tenant_id));
|
||||
} else if (is_tenant_dropped) {
|
||||
ret = OB_TENANT_HAS_BEEN_DROPPED;
|
||||
LOG_WARN("tenant has been dropped", K(ret), K(tenant_id));
|
||||
break;
|
||||
} else if (OB_FAIL(handle_session_exception(session))) {
|
||||
LOG_WARN("session exeception happened", K(ret));
|
||||
if (OB_TMP_FAIL(cancel_ddl_task(tenant_id, common_rpc_proxy))) {
|
||||
|
||||
@ -403,14 +403,14 @@ int ObGetDiagnosticsExecutor::execute(ObExecContext &ctx, ObGetDiagnosticsStmt &
|
||||
LOG_TRACE("condition num is invalid");
|
||||
LOG_USER_WARN(OB_ERR_INVALID_CONDITION_NUMBER);
|
||||
} else {
|
||||
int err_ret;
|
||||
ObString err_msg, err_msg_c, sqlstate, sqlstate_c;
|
||||
ObSqlString query_virtual;
|
||||
if (OB_FAIL(query_virtual.assign_fmt(
|
||||
"select message, ori_code, sql_state from %s.%s limit %ld, 1",
|
||||
OB_SYS_DATABASE_NAME, OB_TENANT_VIRTUAL_WARNING_TNAME, restored_arg - 1))) {
|
||||
LOG_WARN("assign fmt failed", K(ret));
|
||||
} else {
|
||||
int err_ret;
|
||||
ObString err_msg, err_msg_c, sqlstate, sqlstate_c;
|
||||
SMART_VAR(ObISQLClient::ReadResult, res) {
|
||||
common::sqlclient::ObMySQLResult *result = NULL;
|
||||
if (OB_FAIL(conn->execute_read(tenant_id, query_virtual.ptr(), res))) {
|
||||
@ -423,7 +423,7 @@ int ObGetDiagnosticsExecutor::execute(ObExecContext &ctx, ObGetDiagnosticsStmt &
|
||||
EXTRACT_INT_FIELD_MYSQL(*result, "ori_code", err_ret, int);
|
||||
EXTRACT_VARCHAR_FIELD_MYSQL(*result, "sql_state", sqlstate);
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if (OB_FAIL(ob_write_string(ctx.get_allocator(), err_msg, err_msg_c, true))) {
|
||||
} else if (OB_FAIL(ob_write_string(ctx.get_allocator(), err_msg, err_msg_c, true))) {
|
||||
//when using ptr(), char *'s end should be '\0'
|
||||
LOG_WARN("ob write string failed", K(ret));
|
||||
} else if (OB_FAIL(ob_write_string(ctx.get_allocator(), sqlstate, sqlstate_c, true))) {
|
||||
@ -432,8 +432,8 @@ int ObGetDiagnosticsExecutor::execute(ObExecContext &ctx, ObGetDiagnosticsStmt &
|
||||
}
|
||||
}
|
||||
}
|
||||
OZ (assign_condition_val(ctx, stmt, session_info, conn, err_ret, err_msg_c, sqlstate_c));
|
||||
}
|
||||
OZ (assign_condition_val(ctx, stmt, session_info, conn, err_ret, err_msg_c, sqlstate_c));
|
||||
}
|
||||
} else if (stmt.get_diagnostics_type() == DiagnosticsType::GET_STACKED_COND) {
|
||||
int64_t restored_arg = 0;
|
||||
|
||||
@ -291,6 +291,8 @@ int ObDropIndexExecutor::wait_drop_index_finish(
|
||||
int64_t unused_user_msg_len = 0;
|
||||
const int64_t retry_interval = 100 * 1000;
|
||||
while (OB_SUCC(ret)) {
|
||||
int tmp_ret = OB_SUCCESS;
|
||||
bool is_tenant_dropped = false;
|
||||
if (OB_SUCCESS == share::ObDDLErrorMessageTableOperator::get_ddl_error_message(
|
||||
tenant_id, task_id, -1 /* target_object_id */, unused_addr, false /* is_ddl_retry_task */, *GCTX.sql_proxy_, error_message, unused_user_msg_len)) {
|
||||
ret = error_message.ret_code_;
|
||||
@ -298,6 +300,13 @@ int ObDropIndexExecutor::wait_drop_index_finish(
|
||||
FORWARD_USER_ERROR(ret, error_message.user_message_);
|
||||
}
|
||||
break;
|
||||
} else if (OB_TMP_FAIL(GSCHEMASERVICE.check_if_tenant_has_been_dropped(
|
||||
tenant_id, is_tenant_dropped))) {
|
||||
LOG_WARN("check if tenant has been dropped failed", K(tmp_ret), K(tenant_id));
|
||||
} else if (is_tenant_dropped) {
|
||||
ret = OB_TENANT_HAS_BEEN_DROPPED;
|
||||
LOG_WARN("tenant has been dropped", K(ret), K(tenant_id));
|
||||
break;
|
||||
} else if (OB_FAIL(session.check_session_status())) {
|
||||
LOG_WARN("session exeception happened", K(ret));
|
||||
} else {
|
||||
|
||||
@ -370,7 +370,7 @@ int ObDMLService::process_before_stmt_trigger(const ObDMLBaseCtDef &dml_ctdef,
|
||||
dml_event))) {
|
||||
LOG_WARN("failed to handle before stmt trigger", K(ret));
|
||||
} else if (OB_FAIL(ObSqlTransControl::stmt_refresh_snapshot(dml_rtctx.get_exec_ctx()))) {
|
||||
LOG_WARN("failed to get new sanpshot after before stmt trigger evaluated", K(ret));
|
||||
LOG_WARN("failed to get new snapshot after before stmt trigger evaluated", K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
@ -609,16 +609,20 @@ int ObExpr::eval_one_datum_of_batch(ObEvalCtx &ctx, common::ObDatum *&datum) con
|
||||
}
|
||||
datum = reinterpret_cast<ObDatum *>(frame + datum_off_) + ctx.get_batch_idx();
|
||||
if (need_evaluate) {
|
||||
reset_datum_ptr(frame, ctx.get_batch_size(), ctx.get_batch_idx());
|
||||
ret = eval_func_(*this, ctx, *datum);
|
||||
if (OB_SUCC(ret)) {
|
||||
ObBitVector *evaluated_flags = to_bit_vector(frame + eval_flags_off_);
|
||||
evaluated_flags->set(ctx.get_batch_idx());
|
||||
if (OB_UNLIKELY(need_stack_check_) && OB_FAIL(check_stack_overflow())) {
|
||||
SQL_LOG(WARN, "failed to check stack overflow", K(ret));
|
||||
} else {
|
||||
datum->set_null();
|
||||
}
|
||||
if (datum->is_null()) {
|
||||
info->notnull_ = false;
|
||||
reset_datum_ptr(frame, ctx.get_batch_size(), ctx.get_batch_idx());
|
||||
ret = eval_func_(*this, ctx, *datum);
|
||||
if (OB_SUCC(ret)) {
|
||||
ObBitVector *evaluated_flags = to_bit_vector(frame + eval_flags_off_);
|
||||
evaluated_flags->set(ctx.get_batch_idx());
|
||||
} else {
|
||||
datum->set_null();
|
||||
}
|
||||
if (datum->is_null()) {
|
||||
info->notnull_ = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -655,17 +659,21 @@ int ObExpr::do_eval_batch(ObEvalCtx &ctx,
|
||||
info->notnull_ = false;
|
||||
info->point_to_frame_ = true;
|
||||
}
|
||||
ret = (*eval_batch_func_)(*this, ctx, skip, size);
|
||||
if (OB_SUCC(ret)) {
|
||||
if (!info->evaluated_) {
|
||||
info->cnt_ = size;
|
||||
info->evaluated_ = true;
|
||||
}
|
||||
if (OB_UNLIKELY(need_stack_check_) && OB_FAIL(check_stack_overflow())) {
|
||||
SQL_LOG(WARN, "failed to check stack overflow", K(ret));
|
||||
} else {
|
||||
ObDatum *datum = reinterpret_cast<ObDatum *>(frame + datum_off_);
|
||||
ObDatum *datum_end = datum + size;
|
||||
for (; datum < datum_end; datum += 1) {
|
||||
datum->set_null();
|
||||
ret = (*eval_batch_func_)(*this, ctx, skip, size);
|
||||
if (OB_SUCC(ret)) {
|
||||
if (!info->evaluated_) {
|
||||
info->cnt_ = size;
|
||||
info->evaluated_ = true;
|
||||
}
|
||||
} else {
|
||||
ObDatum *datum = reinterpret_cast<ObDatum *>(frame + datum_off_);
|
||||
ObDatum *datum_end = datum + size;
|
||||
for (; datum < datum_end; datum += 1) {
|
||||
datum->set_null();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
#include "sql/engine/ob_serializable_function.h"
|
||||
#include "objit/common/ob_item_type.h"
|
||||
#include "sql/engine/ob_bit_vector.h"
|
||||
#include "common/ob_common_utility.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
@ -610,6 +611,7 @@ public:
|
||||
uint64_t is_static_const_:1; // is const during the whole execution
|
||||
uint64_t is_boolean_:1; // to distinguish result of this expr between and int tc
|
||||
uint64_t is_dynamic_const_:1; // is const during the subplan execution, including exec param
|
||||
uint64_t need_stack_check_:1; // the expression tree depth needs to check whether the stack overflows
|
||||
};
|
||||
uint64_t flag_;
|
||||
};
|
||||
@ -976,7 +978,6 @@ OB_INLINE int ObExpr::eval(ObEvalCtx &ctx, common::ObDatum *&datum) const
|
||||
OB_ASSERT(NULL != frame);
|
||||
datum = (ObDatum *)(frame + datum_off_);
|
||||
ObEvalInfo *eval_info = (ObEvalInfo *)(frame + eval_info_off_);
|
||||
|
||||
if (is_batch_result()) {
|
||||
if (NULL == eval_func_ || eval_info->projected_) {
|
||||
datum = datum + ctx.get_batch_idx();
|
||||
@ -985,14 +986,18 @@ OB_INLINE int ObExpr::eval(ObEvalCtx &ctx, common::ObDatum *&datum) const
|
||||
}
|
||||
} else if (NULL != eval_func_ && !eval_info->evaluated_) {
|
||||
// do nothing for const/column reference expr or already evaluated expr
|
||||
if (datum->ptr_ != frame + res_buf_off_) {
|
||||
datum->ptr_ = frame + res_buf_off_;
|
||||
}
|
||||
ret = eval_func_(*this, ctx, *datum);
|
||||
if (OB_LIKELY(common::OB_SUCCESS == ret)) {
|
||||
eval_info->evaluated_ = true;
|
||||
if (OB_UNLIKELY(need_stack_check_) && OB_FAIL(check_stack_overflow())) {
|
||||
SQL_LOG(WARN, "failed to check stack overflow", K(ret));
|
||||
} else {
|
||||
datum->set_null();
|
||||
if (datum->ptr_ != frame + res_buf_off_) {
|
||||
datum->ptr_ = frame + res_buf_off_;
|
||||
}
|
||||
ret = eval_func_(*this, ctx, *datum);
|
||||
if (OB_LIKELY(common::OB_SUCCESS == ret)) {
|
||||
eval_info->evaluated_ = true;
|
||||
} else {
|
||||
datum->set_null();
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
@ -192,10 +192,11 @@ int ObExprMod::mod_double(ObObj &res,
|
||||
{
|
||||
|
||||
int ret = OB_SUCCESS;
|
||||
const double EPSILON = 1e-14;
|
||||
if (OB_UNLIKELY(left.get_type_class() != right.get_type_class())) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("Invalid types", K(ret), K(left), K(right));
|
||||
} else if (fabs(right.get_double()) == 0.0) {
|
||||
} else if (fabs(right.get_double()) < EPSILON) {
|
||||
if (lib::is_oracle_mode()) {
|
||||
res.set_double(left.get_double());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user