[4.1] call tx interface for dblink select in trans
This commit is contained in:
@ -409,5 +409,19 @@ int ObLinkScanOp::inner_get_next_batch(const int64_t max_row_cnt)
|
|||||||
return ret;
|
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 sql
|
||||||
} // end namespace oceanbase
|
} // end namespace oceanbase
|
||||||
|
|||||||
@ -43,6 +43,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
virtual void reset_dblink() override;
|
virtual void reset_dblink() override;
|
||||||
void reset_result();
|
void reset_result();
|
||||||
|
bool need_tx(const ObSQLSessionInfo *my_session) const;
|
||||||
private:
|
private:
|
||||||
common::ObMySQLProxy::MySQLResult res_;
|
common::ObMySQLProxy::MySQLResult res_;
|
||||||
common::sqlclient::ObMySQLResult *result_;
|
common::sqlclient::ObMySQLResult *result_;
|
||||||
@ -59,4 +60,4 @@ private:
|
|||||||
} // end namespace sql
|
} // end namespace sql
|
||||||
} // end namespace oceanbase
|
} // end namespace oceanbase
|
||||||
|
|
||||||
#endif /* OCEANBASE_SQL_ENGINE_LINK_SCAN_ */
|
#endif /* OCEANBASE_SQL_ENGINE_LINK_SCAN_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user