mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
find() method for Hash_set<>.
Move key function from template parameter to the constructor
This commit is contained in:
@ -4542,10 +4542,9 @@ end:
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
extern "C" uchar *schema_set_get_key(const uchar *record, size_t *length,
|
||||
extern "C" uchar *schema_set_get_key(const TABLE_LIST *table, size_t *length,
|
||||
my_bool not_used __attribute__((unused)))
|
||||
{
|
||||
TABLE_LIST *table=(TABLE_LIST*) record;
|
||||
*length= table->db_length;
|
||||
return (uchar*) table->db;
|
||||
}
|
||||
@ -4586,7 +4585,7 @@ lock_table_names(THD *thd,
|
||||
MDL_request_list mdl_requests;
|
||||
TABLE_LIST *table;
|
||||
MDL_request global_request;
|
||||
Hash_set<TABLE_LIST, schema_set_get_key> schema_set;
|
||||
Hash_set<TABLE_LIST> schema_set(schema_set_get_key);
|
||||
ulong org_lock_wait_timeout= lock_wait_timeout;
|
||||
/* Check if we are using CREATE TABLE ... IF NOT EXISTS */
|
||||
bool create_table;
|
||||
@ -4625,7 +4624,7 @@ lock_table_names(THD *thd,
|
||||
Scoped locks: Take intention exclusive locks on all involved
|
||||
schemas.
|
||||
*/
|
||||
Hash_set<TABLE_LIST, schema_set_get_key>::Iterator it(schema_set);
|
||||
Hash_set<TABLE_LIST>::Iterator it(schema_set);
|
||||
while ((table= it++))
|
||||
{
|
||||
MDL_request *schema_request= new (thd->mem_root) MDL_request;
|
||||
|
Reference in New Issue
Block a user