提交 5048204f 编写于 作者: O obdev 提交者: wangzelin.wzl

Fix core of table scan iter

上级 00bd416b
......@@ -250,9 +250,9 @@ int ObExprToOutfileRow::print_field(char *buf, const int64_t buf_len, int64_t &p
auto escape_func =
[buf, buf_len, &pos, need_enclose, &out_info] (ObString &code_point, int32_t wchar) -> int {
int ret = OB_SUCCESS;
if (wchar == '\0') {
OZ(out_info.escape_.print_plain_str_literal(buf, buf_len, pos, out_info.print_params_));
OZ(print_wchar_to_buf(buf, buf_len, pos, '0', out_info.print_params_.cs_type_));
if (wchar == '\0') {
OZ(out_info.escape_.print_plain_str_literal(buf, buf_len, pos, out_info.print_params_));
OZ(print_wchar_to_buf(buf, buf_len, pos, '0', out_info.print_params_.cs_type_));
} else if (wchar == out_info.wchar_enclose_ || wchar == out_info.wchar_escape_) {
OZ(out_info.escape_.print_plain_str_literal(buf, buf_len, pos, out_info.print_params_));
OZ(copy_string_to_buf(buf, buf_len, pos, code_point));
......
......@@ -730,17 +730,16 @@ int ObLSTabletService::table_scan(ObTableScanIterator &iter, ObTableScanParam &p
} else if (OB_FAIL(get_tablet_with_timeout(param.tablet_id_, data_tablet, param.timeout_))) {
LOG_WARN("failed to check and get tablet", K(ret), K(param));
} else if (OB_FAIL(inner_table_scan(data_tablet, iter, param))) {
LOG_WARN("failed to do table scan", K(ret), K(param));
LOG_WARN("failed to do table scan", K(ret), KP(&iter), K(param));
} else {
result = &iter;
}
if (OB_SUCC(ret)) {
bool is_same = false;
allow_to_read_mgr_.check_read_info_same(read_info, is_same);
if (!is_same) {
ret = OB_REPLICA_NOT_READABLE;
LOG_WARN("ls is not allow to read", K(ret), KPC(ls_));
LOG_WARN("ls is not allow to read", K(ret), KPC(ls_), KP(&iter));
} else {
// result should be assigned at the last
result = &iter;
}
}
NG_TRACE(S_table_scan_end);
......
......@@ -271,18 +271,11 @@ int ObAccessService::table_rescan(
ret = OB_NOT_SUPPORTED;
LOG_WARN("only table scan iter can be rescan", K(ret), K(result->get_type()));
} else if (!param.need_switch_param_) {
if (ObNewRowIterator::ObTableScanIterator == result->get_type() &&
OB_FAIL(static_cast<ObTableScanIterator*>(result)->rescan(param))) {
if (OB_FAIL(static_cast<ObTableScanIterator*>(result)->rescan(param))) {
LOG_WARN("rescan ObTableScanIterator failed", K(ret), K(result), K(vparam));
}
} else {
ObTableScanIterator *iter = nullptr;
if (ObNewRowIterator::ObTableScanIterator == result->get_type()) {
iter = static_cast<ObTableScanIterator*>(result);
} else {
ret = OB_ERR_UNEXPECTED;
STORAGE_LOG(WARN, "Unexpected table iter type", K(ret), K(result->get_type()));
}
ObTableScanIterator *iter = static_cast<ObTableScanIterator*>(result);
const share::ObLSID &ls_id = vparam.ls_id_;
const common::ObTabletID &data_tablet_id = vparam.tablet_id_;
ObLS *ls = nullptr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册