From 83f8e7721db08f25d074e0937a25411651346a98 Mon Sep 17 00:00:00 2001 From: obdev Date: Mon, 24 Apr 2023 09:11:25 +0000 Subject: [PATCH] [foreign key] remove change DMLFlag by iter_uncommited_row in sstable, to avoid 4377 problem --- deps/easy/src/io/easy_negotiation.c | 12 ++++++------ src/sql/engine/table/ob_table_scan_op.cpp | 2 +- .../blocksstable/ob_micro_block_row_scanner.cpp | 7 +------ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/deps/easy/src/io/easy_negotiation.c b/deps/easy/src/io/easy_negotiation.c index e0a2734ff..51c11ed43 100644 --- a/deps/easy/src/io/easy_negotiation.c +++ b/deps/easy/src/io/easy_negotiation.c @@ -112,13 +112,13 @@ static int easy_encode_negotiation_msg(easy_negotiation_msg_t *ne_msg, char *buf easy_error_log("easy_encode_negotiation_msg, invalid param!"); return EASY_ERROR; } - - ret = easy_encode_uint64(buf, buf_len, &pos, ne_msg->msg_header.header_magic); - if (ret != EASY_OK) { + + ret = easy_encode_uint64(buf, buf_len, &pos, ne_msg->msg_header.header_magic); + if (ret != EASY_OK) { easy_error_log("send negotiation msg, encode header magic failed!"); - return ret; - } - + return ret; + } + ret = easy_encode_uint16(buf, buf_len, &pos, ne_msg->msg_header.msg_body_len); if (ret != EASY_OK) { easy_error_log("send negotiation msg, encode msg body len failed!"); diff --git a/src/sql/engine/table/ob_table_scan_op.cpp b/src/sql/engine/table/ob_table_scan_op.cpp index 46a8e201f..52cc5a055 100644 --- a/src/sql/engine/table/ob_table_scan_op.cpp +++ b/src/sql/engine/table/ob_table_scan_op.cpp @@ -873,7 +873,7 @@ OB_INLINE int ObTableScanOp::init_das_scan_rtdef(const ObDASScanCtDef &das_ctdef das_rtdef.tx_lock_timeout_ = my_session->get_trx_lock_timeout(); das_rtdef.scan_flag_ = MY_CTDEF.scan_flags_; das_rtdef.scan_flag_.is_show_seed_ = plan_ctx->get_show_seed(); - if(is_foreign_check_nested_session() && stmt::T_SELECT == ctx_.get_sql_ctx()->stmt_type_) { + if(is_foreign_check_nested_session()) { das_rtdef.is_for_foreign_check_ = true; } if (MY_SPEC.batch_scan_flag_ || is_lookup) { diff --git a/src/storage/blocksstable/ob_micro_block_row_scanner.cpp b/src/storage/blocksstable/ob_micro_block_row_scanner.cpp index d35216dbf..6a82b346b 100644 --- a/src/storage/blocksstable/ob_micro_block_row_scanner.cpp +++ b/src/storage/blocksstable/ob_micro_block_row_scanner.cpp @@ -1165,12 +1165,7 @@ int ObMultiVersionMicroBlockRowScanner::inner_inner_get_next_row( LOG_DEBUG("success to set trans_version on uncommitted row", K(ret), K(trans_version)); row->storage_datums_[read_info_->get_schema_rowkey_count()].set_int(-trans_version); } - if (read_uncommitted_row) { - // Need to iterate out uncommitted rows when building a bloomfilter or marking for deletion, - // The uncommitted rows are not yet determined, - // so even if they are deleted, they must be treated as existing rows. - row->row_flag_.set_flag(ObDmlFlag::DF_INSERT); - } + if (!row->mvcc_row_flag_.is_uncommitted_row() || is_determined_state) { row->snapshot_version_ = 0; row->trans_id_.reset();