int ha_commit_trans(THD *thd, bool all, bool ignore_global_read_lock)
{
int error= 0;
bool need_clear_owned_gtid= false;
/*
Save transaction owned gtid into table before transaction prepare
if binlog is disabled, or binlog is enabled and log_slave_updates
is disabled with slave SQL thread or slave worker thread.
*/
error= commit_owned_gtids(thd, all, &need_clear_owned_gtid);
/*
'all' means that this is either an explicit commit issued by
user, or an implicit commit issued by a DDL.
*/
Transaction_ctx *trn_ctx= thd->get_transaction();
Transaction_ctx::enum_trx_scope trx_scope=
all ? Transaction_ctx::SESSION : Transaction_ctx::STMT;
.....
}
? : 为三元运算符,如果all 为真,则trx_scope=Transaction_ctx::SESSION;如果all 为假,则trx_scope=Transaction_ctx::STMT;