mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Remove the unnecessary method handlerton::release_temporary_latches()
The sole purpose of handlerton::release_temporary_latches and its wrapper function was to release the InnoDB adaptive hash index latch (btr_search_latch). When the btr_search_latch was split into an array of latches in MySQL 5.7.8 as part of the Oracle Bug#20985298 fix, the "caching" of the latch across storage engine API calls was removed. As part of that, the function trx_search_latch_release_if_reserved() was changed to an assertion and the function trx_reserve_search_latch_if_not_reserved() was removed, and handlerton::release_temporary_latches() practically became a no-op. Note: MDEV-12121 replaced the function trx_search_latch_release_if_reserved() with the more appropriately named macro trx_assert_no_search_latch().
This commit is contained in:
@ -2015,44 +2015,6 @@ commit_checkpoint_notify_ha(handlerton *hton, void *cookie)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@details
|
||||
This function should be called when MySQL sends rows of a SELECT result set
|
||||
or the EOF mark to the client. It releases a possible adaptive hash index
|
||||
S-latch held by thd in InnoDB and also releases a possible InnoDB query
|
||||
FIFO ticket to enter InnoDB. To save CPU time, InnoDB allows a thd to
|
||||
keep them over several calls of the InnoDB handler interface when a join
|
||||
is executed. But when we let the control to pass to the client they have
|
||||
to be released because if the application program uses mysql_use_result(),
|
||||
it may deadlock on the S-latch if the application on another connection
|
||||
performs another SQL query. In MySQL-4.1 this is even more important because
|
||||
there a connection can have several SELECT queries open at the same time.
|
||||
|
||||
@param thd the thread handle of the current connection
|
||||
|
||||
@return
|
||||
always 0
|
||||
*/
|
||||
|
||||
int ha_release_temporary_latches(THD *thd)
|
||||
{
|
||||
Ha_trx_info *info;
|
||||
|
||||
/*
|
||||
Note that below we assume that only transactional storage engines
|
||||
may need release_temporary_latches(). If this will ever become false,
|
||||
we could iterate on thd->open_tables instead (and remove duplicates
|
||||
as if (!seen[hton->slot]) { seen[hton->slot]=1; ... }).
|
||||
*/
|
||||
for (info= thd->transaction.stmt.ha_list; info; info= info->next())
|
||||
{
|
||||
handlerton *hton= info->ht();
|
||||
if (hton && hton->release_temporary_latches)
|
||||
hton->release_temporary_latches(hton, thd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Check if all storage engines used in transaction agree that after
|
||||
rollback to savepoint it is safe to release MDL locks acquired after
|
||||
|
Reference in New Issue
Block a user