| 445 | */ |
| 446 | |
| 447 | void 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 | |
| 474 | static void tdc_assert_clean_share(TDC_element *element) |
no test coverage detected