提交 b5fd1cec 编写于 作者: B bf0 提交者: wangzelin.wzl

fix load data case failed

上级 7be8c365
...@@ -424,7 +424,7 @@ int ObInnerSQLConnection::process_retry( ...@@ -424,7 +424,7 @@ int ObInnerSQLConnection::process_retry(
is_get_location_timeout_error(last_ret) || is_try_lock_row_err(last_ret) || is_get_location_timeout_error(last_ret) || is_try_lock_row_err(last_ret) ||
is_has_no_readable_replica_err(last_ret) || is_select_dup_follow_replic_err(last_ret) || is_has_no_readable_replica_err(last_ret) || is_select_dup_follow_replic_err(last_ret) ||
is_trans_stmt_need_retry_error(last_ret) || is_transaction_set_violation_err(last_ret) || is_trans_stmt_need_retry_error(last_ret) || is_transaction_set_violation_err(last_ret) ||
is_snapshot_discarded_err(last_ret) || OB_AUTOINC_SERVICE_BUSY == last_ret)) { is_snapshot_discarded_err(last_ret))) {
need_retry = true; need_retry = true;
const uint64_t* trace_id = ObCurTraceId::get(); const uint64_t* trace_id = ObCurTraceId::get();
bool sql_trigger_by_user_req = (NULL != trace_id && 0 != trace_id[0] && 0 != trace_id[1]); bool sql_trigger_by_user_req = (NULL != trace_id && 0 != trace_id[0] && 0 != trace_id[1]);
......
...@@ -1264,20 +1264,19 @@ int ObCSVParser::next_line(bool& yield_line) ...@@ -1264,20 +1264,19 @@ int ObCSVParser::next_line(bool& yield_line)
bool yield = false; bool yield = false;
int with_back_slash = 0; int with_back_slash = 0;
for (; !yield && cur_pos_ != buf_end_pos_; ++cur_pos_, ++cur_field_end_pos_) { for (; !yield && cur_pos_ < buf_end_pos_; ++cur_pos_, ++cur_field_end_pos_) {
bool line_term_matched = false; bool line_term_matched = false;
if (*cur_pos_ == formats_.enclose_char_ && !in_enclose_flag_ && cur_pos_ == cur_field_begin_pos_) { if (*cur_pos_ == formats_.enclose_char_ && !in_enclose_flag_ && cur_pos_ == cur_field_begin_pos_) {
in_enclose_flag_ = true; in_enclose_flag_ = true;
last_end_enclosed_ = NULL; last_end_enclosed_ = NULL;
} else if ((*cur_pos_ == formats_.escape_char_ && formats_.escape_char_ != formats_.enclose_char_) || } else if (cur_pos_ + 1 < buf_end_pos_ &&
(in_enclose_flag_ && formats_.enclose_char_ == *cur_pos_ && cur_pos_ < buf_end_pos_ && ((*cur_pos_ == formats_.escape_char_ && formats_.escape_char_ != formats_.enclose_char_) ||
formats_.enclose_char_ == *(cur_pos_ + 1))) { (in_enclose_flag_ && formats_.enclose_char_ == *cur_pos_ &&
if (cur_pos_ < buf_end_pos_) { formats_.enclose_char_ == *(cur_pos_ + 1)))) {
cur_pos_++; cur_pos_++;
if (!is_fast_parse_) { if (!is_fast_parse_) {
*cur_field_end_pos_ = escaped_char(*cur_pos_, &with_back_slash); *cur_field_end_pos_ = escaped_char(*cur_pos_, &with_back_slash);
} }
}
} else { } else {
if (cur_field_end_pos_ != cur_pos_ && !is_fast_parse_) { if (cur_field_end_pos_ != cur_pos_ && !is_fast_parse_) {
*cur_field_end_pos_ = *cur_pos_; *cur_field_end_pos_ = *cur_pos_;
...@@ -1369,13 +1368,11 @@ int ObCSVParser::fast_parse_lines( ...@@ -1369,13 +1368,11 @@ int ObCSVParser::fast_parse_lines(
if (OB_UNLIKELY(!buffer.is_valid())) { if (OB_UNLIKELY(!buffer.is_valid())) {
ret = OB_INVALID_ARGUMENT; ret = OB_INVALID_ARGUMENT;
} else if (formats.is_simple_format_) { } else if (formats.is_simple_format_) {
char* cur_pos = buffer.begin_ptr(); char *cur_pos = buffer.begin_ptr();
bool in_escaped = false; for (char *p = buffer.begin_ptr(); p < buffer.current_ptr(); ++p) {
for (char* p = buffer.begin_ptr(); p != buffer.current_ptr(); ++p) {
char cur_char = *p; char cur_char = *p;
if (!in_escaped) { if (formats.escape_char_ == cur_char && p + 1 < buffer.current_ptr()) {
if (formats.enclose_char_ == cur_char) { p++;
in_escaped = true;
} else if (formats.line_term_char_ == cur_char) { } else if (formats.line_term_char_ == cur_char) {
cur_lines++; cur_lines++;
cur_pos = p + 1; cur_pos = p + 1;
...@@ -1384,7 +1381,6 @@ int ObCSVParser::fast_parse_lines( ...@@ -1384,7 +1381,6 @@ int ObCSVParser::fast_parse_lines(
} }
} }
} }
}
if (is_last_buf && buffer.current_ptr() > cur_pos) { if (is_last_buf && buffer.current_ptr() > cur_pos) {
cur_lines++; cur_lines++;
cur_pos = buffer.current_ptr(); cur_pos = buffer.current_ptr();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册