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

Function tc_release_table

sql/table_cache.cc:447–471  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445*/
446
447void tc_release_table(TABLE *table)
448{
449 uint32 i= table->instance;
450 DBUG_ENTER("tc_release_table");
451 DBUG_ASSERT(table->in_use);
452 DBUG_ASSERT(table->file);
453 DBUG_ASSERT(!table->pos_in_locked_tables);
454
455 mysql_mutex_lock(&tc[i].LOCK_table_cache);
456 if (table->needs_reopen() || table->s->tdc->flushed ||
457 tc[i].records > tc_size)
458 {
459 tc[i].records--;
460 mysql_mutex_unlock(&tc[i].LOCK_table_cache);
461 tc_remove_table(table);
462 }
463 else
464 {
465 table->in_use= 0;
466 table->s->tdc->free_tables[i].list.push_front(table);
467 tc[i].free_tables.push_back(table);
468 mysql_mutex_unlock(&tc[i].LOCK_table_cache);
469 }
470 DBUG_VOID_RETURN;
471}
472
473
474static void tdc_assert_clean_share(TDC_element *element)

Callers 3

flush_tablesFunction · 0.85
close_thread_tableFunction · 0.85
open_tableFunction · 0.85

Calls 4

tc_remove_tableFunction · 0.85
needs_reopenMethod · 0.80
push_frontMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected