From 1173ce6b95d78291ed6ff20ea97c0ebd5bb9e81e Mon Sep 17 00:00:00 2001 From: hamstersox <673144759@qq.com> Date: Mon, 14 Nov 2022 03:13:22 +0000 Subject: [PATCH] fix bugs --- .../backup/ob_backup_data_scheduler.cpp | 1 + .../backup/ob_backup_data_table_operator.cpp | 1 + src/sql/engine/expr/ob_expr_to_outfile_row.cpp | 18 +++++++++--------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/rootserver/backup/ob_backup_data_scheduler.cpp b/src/rootserver/backup/ob_backup_data_scheduler.cpp index e0beea07be..2e2575406a 100644 --- a/src/rootserver/backup/ob_backup_data_scheduler.cpp +++ b/src/rootserver/backup/ob_backup_data_scheduler.cpp @@ -109,6 +109,7 @@ int ObBackupDataScheduler::get_need_reload_task( LOG_INFO("[DATA_BACKUP]no job need to reload"); } else { for (int64_t i = 0; OB_SUCC(ret) && i < jobs.count(); ++i) { + ls_tasks.reset(); const ObBackupJobAttr &job = jobs.at(i); ObBackupSetTaskAttr set_task_attr; bool is_valid = true; diff --git a/src/share/backup/ob_backup_data_table_operator.cpp b/src/share/backup/ob_backup_data_table_operator.cpp index 05ce7b7af4..52bf57c476 100644 --- a/src/share/backup/ob_backup_data_table_operator.cpp +++ b/src/share/backup/ob_backup_data_table_operator.cpp @@ -1647,6 +1647,7 @@ int ObBackupLSTaskOperator::get_ls_tasks( { int ret = OB_SUCCESS; ObSqlString sql; + ls_attrs.reset(); if (job_id <= 0 || tenant_id == OB_INVALID_TENANT_ID) { ret = OB_INVALID_ARGUMENT; LOG_WARN("[DATA_BACKUP]invalid argument", K(ret), K(tenant_id), K(tenant_id)); diff --git a/src/sql/engine/expr/ob_expr_to_outfile_row.cpp b/src/sql/engine/expr/ob_expr_to_outfile_row.cpp index a4d65fd1d0..35fc325b8d 100644 --- a/src/sql/engine/expr/ob_expr_to_outfile_row.cpp +++ b/src/sql/engine/expr/ob_expr_to_outfile_row.cpp @@ -52,9 +52,9 @@ int ObExprToOutfileRow::calc_result_typeN(ObExprResType &type, if (OB_UNLIKELY(param_num <= PARAM_SELECT_ITEM)) { ret = OB_INVALID_ARGUMENT_NUM; LOG_WARN("invalid argument number", K(ret), K(param_num)); - } else { - // deduce type and length - type.set_varbinary(); + } else { + // deduce type and length + type.set_varbinary(); // the result is only used to select into outile, so we don't care the accurate length type.set_length(OB_MAX_ROW_LENGTH); // field_str @@ -81,9 +81,9 @@ int ObExprToOutfileRow::cg_expr(ObExprCGCtx &, const ObRawExpr &, ObExpr &expr) CK(expr.arg_cnt_ > PARAM_SELECT_ITEM); if (OB_SUCC(ret)) { for (int i = PARAM_FIELD; i < PARAM_SELECT_ITEM; i++) { - if (!expr.args_[i]->is_static_const_) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("non-const format not supported", K(ret)); + if (!expr.args_[i]->is_static_const_) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("non-const format not supported", K(ret)); } } expr.eval_func_ = &to_outfile_str; @@ -169,9 +169,9 @@ int ObExprToOutfileRow::to_outfile_str(const ObExpr &expr, ObEvalCtx &ctx, ObDat ctx.exec_ctx_.get_allocator(), *out_info))) { LOG_WARN("fail calc outfile info", K(ret)); } - } - if (OB_SUCC(ret)) { - do { + } + if (OB_SUCC(ret)) { + do { int64_t pos = 0; char *buf = out_info->buf_; int64_t buf_len = out_info->buf_len_;