1
0
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:
Sergei Golubchik
2013-10-18 12:36:03 -07:00
parent 3098b6cf5b
commit 7fba8e5164
2 changed files with 16 additions and 11 deletions

View File

@ -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;