Skip to content

Commit 1513630

Browse files
committed
remove dead code
1 parent 0c8d6fd commit 1513630

File tree

3 files changed

+0
-65
lines changed

3 files changed

+0
-65
lines changed

sql/sql_class.cc

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -5037,66 +5037,6 @@ thd_need_ordering_with(const MYSQL_THD thd, const MYSQL_THD other_thd)
50375037
return 0;
50385038
}
50395039

5040-
5041-
/*
5042-
If the storage engine detects a deadlock, and needs to choose a victim
5043-
transaction to roll back, it can call this function to ask the upper
5044-
server layer for which of two possible transactions is prefered to be
5045-
aborted and rolled back.
5046-
5047-
In parallel replication, if two transactions are running in parallel and
5048-
one is fixed to commit before the other, then the one that commits later
5049-
will be prefered as the victim - chosing the early transaction as a victim
5050-
will not resolve the deadlock anyway, as the later transaction still needs
5051-
to wait for the earlier to commit.
5052-
5053-
Otherwise, a transaction that uses only transactional tables, and can thus
5054-
be safely rolled back, will be prefered as a deadlock victim over a
5055-
transaction that also modified non-transactional (eg. MyISAM) tables.
5056-
5057-
The return value is -1 if the first transaction is prefered as a deadlock
5058-
victim, 1 if the second transaction is prefered, or 0 for no preference (in
5059-
which case the storage engine can make the choice as it prefers).
5060-
*/
5061-
extern "C" int
5062-
thd_deadlock_victim_preference(const MYSQL_THD thd1, const MYSQL_THD thd2)
5063-
{
5064-
rpl_group_info *rgi1, *rgi2;
5065-
bool nontrans1, nontrans2;
5066-
5067-
if (!thd1 || !thd2)
5068-
return 0;
5069-
5070-
/*
5071-
If the transactions are participating in the same replication domain in
5072-
parallel replication, then request to select the one that will commit
5073-
later (in the fixed commit order from the master) as the deadlock victim.
5074-
*/
5075-
rgi1= thd1->rgi_slave;
5076-
rgi2= thd2->rgi_slave;
5077-
if (rgi1 && rgi2 &&
5078-
rgi1->is_parallel_exec &&
5079-
rgi1->rli == rgi2->rli &&
5080-
rgi1->current_gtid.domain_id == rgi2->current_gtid.domain_id)
5081-
return rgi1->gtid_sub_id < rgi2->gtid_sub_id ? 1 : -1;
5082-
5083-
/*
5084-
If one transaction has modified non-transactional tables (so that it
5085-
cannot be safely rolled back), and the other has not, then prefer to
5086-
select the purely transactional one as the victim.
5087-
*/
5088-
nontrans1= thd1->transaction.all.modified_non_trans_table;
5089-
nontrans2= thd2->transaction.all.modified_non_trans_table;
5090-
if (nontrans1 && !nontrans2)
5091-
return 1;
5092-
else if (!nontrans1 && nontrans2)
5093-
return -1;
5094-
5095-
/* No preferences, let the storage engine decide. */
5096-
return 0;
5097-
}
5098-
5099-
51005040
extern "C" int thd_non_transactional_update(const MYSQL_THD thd)
51015041
{
51025042
return(thd->transaction.all.modified_non_trans_table);

storage/innobase/lock/lock0lock.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ extern "C" void thd_rpl_deadlock_check(MYSQL_THD thd, MYSQL_THD other_thd);
8888
extern "C" int thd_need_wait_reports(const MYSQL_THD thd);
8989
extern "C" int thd_need_ordering_with(const MYSQL_THD thd, const MYSQL_THD other_thd);
9090

91-
extern "C" int thd_deadlock_victim_preference(const MYSQL_THD thd1, const MYSQL_THD thd2);
92-
9391
/** Print info of a table lock.
9492
@param[in,out] file output stream
9593
@param[in] lock table lock */

storage/innobase/trx/trx0trx.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ Created 3/26/1996 Heikki Tuuri
5656
#include <set>
5757
#include <new>
5858

59-
extern "C"
60-
int thd_deadlock_victim_preference(const MYSQL_THD thd1, const MYSQL_THD thd2);
61-
6259
/** The bit pattern corresponding to TRX_ID_MAX */
6360
const byte trx_id_max_bytes[8] = {
6461
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff

0 commit comments

Comments
 (0)