[4.1] call tx interface for dblink select in trans

This commit is contained in:
obdev
2023-04-06 08:03:02 +00:00
committed by ob-robot
parent d5faf6c8c8
commit 841bfb32a3
2 changed files with 16 additions and 1 deletions

View File

@ -409,5 +409,19 @@ int ObLinkScanOp::inner_get_next_batch(const int64_t max_row_cnt)
return ret;
}
// PLEASE check the input parameter in public interface
bool ObLinkScanOp::need_tx(const ObSQLSessionInfo *my_session) const
{
bool ret_bool = false;
if (MY_SPEC.has_for_update_) {
// case 1, if select for update, tm_rm_start is required to be called.
ret_bool = true;
} else if (my_session->is_in_transaction()) {
// case 2, if select in transaction, tm_rm_start is required to be called.
ret_bool = true;
}
return ret_bool;
}
} // end namespace sql
} // end namespace oceanbase

View File

@ -43,6 +43,7 @@ public:
private:
virtual void reset_dblink() override;
void reset_result();
bool need_tx(const ObSQLSessionInfo *my_session) const;
private:
common::ObMySQLProxy::MySQLResult res_;
common::sqlclient::ObMySQLResult *result_;
@ -59,4 +60,4 @@ private:
} // end namespace sql
} // end namespace oceanbase
#endif /* OCEANBASE_SQL_ENGINE_LINK_SCAN_ */
#endif /* OCEANBASE_SQL_ENGINE_LINK_SCAN_ */