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

Function tdc_delete_share_from_hash

sql/table_cache.cc:494–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492*/
493
494static void tdc_delete_share_from_hash(TDC_element *element)
495{
496 THD *thd= current_thd;
497 LF_PINS *pins;
498 TABLE_SHARE *share;
499 DBUG_ENTER("tdc_delete_share_from_hash");
500
501 mysql_mutex_assert_owner(&element->LOCK_table_share);
502 share= element->share;
503 DBUG_ASSERT(share);
504 element->share= 0;
505 PSI_CALL_release_table_share(share->m_psi);
506 share->m_psi= 0;
507
508 if (!element->m_flush_tickets.is_empty())
509 {
510 Wait_for_flush_list::Iterator it(element->m_flush_tickets);
511 Wait_for_flush *ticket;
512 while ((ticket= it++))
513 (void) ticket->get_ctx()->m_wait.set_status(MDL_wait::GRANTED);
514
515 do
516 {
517 mysql_cond_wait(&element->COND_release, &element->LOCK_table_share);
518 } while (!element->m_flush_tickets.is_empty());
519 }
520
521 mysql_mutex_unlock(&element->LOCK_table_share);
522
523 if (thd)
524 {
525 fix_thd_pins(thd);
526 pins= thd->tdc_hash_pins;
527 }
528 else
529 pins= lf_hash_get_pins(&tdc_hash);
530
531 DBUG_ASSERT(pins); // What can we do about it?
532 tdc_assert_clean_share(element);
533 lf_hash_delete(&tdc_hash, pins, element->m_key, element->m_key_length);
534 if (!thd)
535 lf_hash_put_pins(pins);
536 free_table_share(share);
537 DBUG_VOID_RETURN;
538}
539
540
541/**

Callers 4

tdc_purgeFunction · 0.85
tdc_release_shareFunction · 0.85
tdc_remove_tableFunction · 0.85

Calls 7

tdc_assert_clean_shareFunction · 0.85
lf_hash_deleteFunction · 0.85
free_table_shareFunction · 0.85
set_statusMethod · 0.80
fix_thd_pinsFunction · 0.70
is_emptyMethod · 0.45
get_ctxMethod · 0.45

Tested by

no test coverage detected