cleanup: ha_external_unlock() helper
as mentioned in f9f33b85be6 and generally to make it easier to talk about
This commit is contained in:
parent
f29287d280
commit
67aaf51cf9
@ -1701,7 +1701,7 @@ void ha_partition::cleanup_new_partition(uint part_count)
|
|||||||
handler **file= m_added_file;
|
handler **file= m_added_file;
|
||||||
while ((part_count > 0) && (*file))
|
while ((part_count > 0) && (*file))
|
||||||
{
|
{
|
||||||
(*file)->ha_external_lock(thd, F_UNLCK);
|
(*file)->ha_external_unlock(thd);
|
||||||
(*file)->ha_close();
|
(*file)->ha_close();
|
||||||
|
|
||||||
/* Leave the (*file)->ha_delete_table(part_name) to the ddl-log */
|
/* Leave the (*file)->ha_delete_table(part_name) to the ddl-log */
|
||||||
@ -4055,7 +4055,7 @@ err_handler:
|
|||||||
j < i;
|
j < i;
|
||||||
j= bitmap_get_next_set(&m_locked_partitions, j))
|
j= bitmap_get_next_set(&m_locked_partitions, j))
|
||||||
{
|
{
|
||||||
(void) m_file[j]->ha_external_lock(thd, F_UNLCK);
|
(void) m_file[j]->ha_external_unlock(thd);
|
||||||
}
|
}
|
||||||
bitmap_clear_all(&m_locked_partitions);
|
bitmap_clear_all(&m_locked_partitions);
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
|
@ -6556,7 +6556,7 @@ int handler::ha_reset()
|
|||||||
clear_top_table_fields();
|
clear_top_table_fields();
|
||||||
if (lookup_handler != this)
|
if (lookup_handler != this)
|
||||||
{
|
{
|
||||||
lookup_handler->ha_external_lock(table->in_use, F_UNLCK);
|
lookup_handler->ha_external_unlock(table->in_use);
|
||||||
lookup_handler->close();
|
lookup_handler->close();
|
||||||
delete lookup_handler;
|
delete lookup_handler;
|
||||||
lookup_handler= this;
|
lookup_handler= this;
|
||||||
|
@ -3381,6 +3381,7 @@ public:
|
|||||||
and delete_row() below.
|
and delete_row() below.
|
||||||
*/
|
*/
|
||||||
int ha_external_lock(THD *thd, int lock_type);
|
int ha_external_lock(THD *thd, int lock_type);
|
||||||
|
int ha_external_unlock(THD *thd) { return ha_external_lock(thd, F_UNLCK); }
|
||||||
int ha_write_row(const uchar * buf);
|
int ha_write_row(const uchar * buf);
|
||||||
int ha_update_row(const uchar * old_data, const uchar * new_data);
|
int ha_update_row(const uchar * old_data, const uchar * new_data);
|
||||||
int ha_delete_row(const uchar * buf);
|
int ha_delete_row(const uchar * buf);
|
||||||
|
@ -396,7 +396,7 @@ static int lock_external(THD *thd, TABLE **tables, uint count)
|
|||||||
while (--i)
|
while (--i)
|
||||||
{
|
{
|
||||||
tables--;
|
tables--;
|
||||||
(*tables)->file->ha_external_lock(thd, F_UNLCK);
|
(*tables)->file->ha_external_unlock(thd);
|
||||||
(*tables)->current_lock=F_UNLCK;
|
(*tables)->current_lock=F_UNLCK;
|
||||||
}
|
}
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
@ -724,7 +724,7 @@ static int unlock_external(THD *thd, TABLE **table,uint count)
|
|||||||
if ((*table)->current_lock != F_UNLCK)
|
if ((*table)->current_lock != F_UNLCK)
|
||||||
{
|
{
|
||||||
(*table)->current_lock = F_UNLCK;
|
(*table)->current_lock = F_UNLCK;
|
||||||
if (unlikely((error=(*table)->file->ha_external_lock(thd, F_UNLCK))))
|
if (unlikely((error=(*table)->file->ha_external_unlock(thd))))
|
||||||
{
|
{
|
||||||
error_code= error;
|
error_code= error;
|
||||||
(*table)->file->print_error(error, MYF(0));
|
(*table)->file->print_error(error, MYF(0));
|
||||||
|
@ -1380,7 +1380,7 @@ void DsMrr_impl::close_second_handler()
|
|||||||
{
|
{
|
||||||
secondary_file->extra(HA_EXTRA_NO_KEYREAD);
|
secondary_file->extra(HA_EXTRA_NO_KEYREAD);
|
||||||
secondary_file->ha_index_or_rnd_end();
|
secondary_file->ha_index_or_rnd_end();
|
||||||
secondary_file->ha_external_lock(current_thd, F_UNLCK);
|
secondary_file->ha_external_unlock(current_thd);
|
||||||
secondary_file->ha_close();
|
secondary_file->ha_close();
|
||||||
delete secondary_file;
|
delete secondary_file;
|
||||||
secondary_file= NULL;
|
secondary_file= NULL;
|
||||||
|
@ -1338,7 +1338,7 @@ QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT()
|
|||||||
{
|
{
|
||||||
DBUG_PRINT("info", ("Freeing separate handler %p (free: %d)", file,
|
DBUG_PRINT("info", ("Freeing separate handler %p (free: %d)", file,
|
||||||
free_file));
|
free_file));
|
||||||
file->ha_external_lock(current_thd, F_UNLCK);
|
file->ha_external_unlock(current_thd);
|
||||||
file->ha_close();
|
file->ha_close();
|
||||||
delete file;
|
delete file;
|
||||||
}
|
}
|
||||||
@ -1528,7 +1528,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler,
|
|||||||
|
|
||||||
if (init())
|
if (init())
|
||||||
{
|
{
|
||||||
file->ha_external_lock(thd, F_UNLCK);
|
file->ha_external_unlock(thd);
|
||||||
file->ha_close();
|
file->ha_close();
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
@ -1557,7 +1557,7 @@ end:
|
|||||||
{
|
{
|
||||||
if (!reuse_handler)
|
if (!reuse_handler)
|
||||||
{
|
{
|
||||||
file->ha_external_lock(thd, F_UNLCK);
|
file->ha_external_unlock(thd);
|
||||||
file->ha_close();
|
file->ha_close();
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
@ -11322,7 +11322,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
|
|||||||
ha_enable_transaction(thd, TRUE);
|
ha_enable_transaction(thd, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (to->file->ha_external_lock(thd,F_UNLCK))
|
if (to->file->ha_external_unlock(thd))
|
||||||
error=1;
|
error=1;
|
||||||
if (error < 0 && !from->s->tmp_table &&
|
if (error < 0 && !from->s->tmp_table &&
|
||||||
to->file->extra(HA_EXTRA_PREPARE_FOR_RENAME))
|
to->file->extra(HA_EXTRA_PREPARE_FOR_RENAME))
|
||||||
|
@ -33,7 +33,7 @@ namespace mrn {
|
|||||||
|
|
||||||
ExternalLock::~ExternalLock() {
|
ExternalLock::~ExternalLock() {
|
||||||
if (lock_type_ != F_UNLCK) {
|
if (lock_type_ != F_UNLCK) {
|
||||||
handler_->ha_external_lock(thd_, F_UNLCK);
|
handler_->ha_external_unlock(thd_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10453,7 +10453,7 @@ int spider_db_udf_direct_sql(
|
|||||||
if (table->file->has_transactions())
|
if (table->file->has_transactions())
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
table->file->ha_external_lock(table->in_use, F_UNLCK);
|
table->file->ha_external_unlock(table->in_use);
|
||||||
#if MYSQL_VERSION_ID < 50500
|
#if MYSQL_VERSION_ID < 50500
|
||||||
#else
|
#else
|
||||||
if (
|
if (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user