mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
cleanup: small simplification
This commit is contained in:
@ -1032,39 +1032,21 @@ TABLE *THD::find_temporary_table(const char *key, uint key_length,
|
|||||||
/* A matching TMP_TABLE_SHARE is found. */
|
/* A matching TMP_TABLE_SHARE is found. */
|
||||||
All_share_tables_list::Iterator tables_it(share->all_tmp_tables);
|
All_share_tables_list::Iterator tables_it(share->all_tmp_tables);
|
||||||
|
|
||||||
while ((table= tables_it++))
|
bool found= false;
|
||||||
|
while (!found && (table= tables_it++))
|
||||||
{
|
{
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case TMP_TABLE_IN_USE:
|
case TMP_TABLE_IN_USE: found= table->query_id > 0; break;
|
||||||
if (table->query_id > 0)
|
case TMP_TABLE_NOT_IN_USE: found= table->query_id == 0; break;
|
||||||
{
|
case TMP_TABLE_ANY: found= true; break;
|
||||||
result= table;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case TMP_TABLE_NOT_IN_USE:
|
|
||||||
if (table->query_id == 0)
|
|
||||||
{
|
|
||||||
result= table;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case TMP_TABLE_ANY:
|
|
||||||
{
|
|
||||||
result= table;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default: /* Invalid */
|
|
||||||
DBUG_ASSERT(0);
|
|
||||||
goto done;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
result= table;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
|
||||||
if (locked)
|
if (locked)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(m_tmp_tables_locked);
|
DBUG_ASSERT(m_tmp_tables_locked);
|
||||||
|
Reference in New Issue
Block a user