Bug #117281 sql/table_cache.cc init does not cleanup on failure
Submitted: 23 Jan 10:27 Modified: 23 Jan 14:18
Reporter: Eimantas Jatkonis Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[23 Jan 10:27] Eimantas Jatkonis
Description:
mysql-8.0.41/sql/table_cache.cc
line 193
for (uint j = 0; j < i; j++) m_table_cache[i].destroy();

should be not [i], but [j]

How to repeat:
full function in question:

bool Table_cache_manager::init() {
  Table_cache::init_psi_keys();
  for (uint i = 0; i < table_cache_instances; i++) {
    if (m_table_cache[i].init()) {
      for (uint j = 0; j < i; j++) m_table_cache[i].destroy();
      return true;
    }
  }

  return false;
}
[23 Jan 14:18] MySQL Verification Team
HI Mr. Jatkonis,

Thank you for your bug report.

Your analysis is 100 % correct.

This is now a verified bug report for versions 8.0 and all higher versions.