MCPcopy Create free account
hub / github.com/MariaDB/server / wait_while_table_is_used

Function wait_while_table_is_used

sql/sql_base.cc:1477–1501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1475*/
1476
1477bool wait_while_table_is_used(THD *thd, TABLE *table,
1478 enum ha_extra_function function)
1479{
1480 DBUG_ENTER("wait_while_table_is_used");
1481 DBUG_ASSERT(!table->s->tmp_table);
1482 DBUG_PRINT("enter", ("table: '%s' share: %p db_stat: %u",
1483 table->s->table_name.str, table->s,
1484 table->db_stat));
1485
1486 if (thd->mdl_context.upgrade_shared_lock(
1487 table->mdl_ticket, MDL_EXCLUSIVE,
1488 thd->variables.lock_wait_timeout))
1489 DBUG_RETURN(TRUE);
1490
1491 table->s->tdc->flush(thd, true);
1492 /* extra() call must come only after all instances above are closed */
1493 if (function != HA_EXTRA_NOT_USED)
1494 {
1495 int error= table->file->extra(function);
1496 if (error)
1497 table->file->print_error(error, MYF(0));
1498 DBUG_RETURN(error);
1499 }
1500 DBUG_RETURN(FALSE);
1501}
1502
1503
1504/**

Callers 13

handle_alter_part_errorFunction · 0.85
mysql_rm_table_no_locksFunction · 0.85
mysql_alter_tableFunction · 0.85
handler_truncateMethod · 0.85
lock_tableMethod · 0.85
exchange_partitionMethod · 0.85
prepare_for_repairFunction · 0.85
mysql_admin_tableFunction · 0.85

Calls 4

upgrade_shared_lockMethod · 0.80
flushMethod · 0.45
extraMethod · 0.45
print_errorMethod · 0.45

Tested by

no test coverage detected