mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Merge 10.3 into 10.4
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2018, MariaDB
|
||||
Copyright (c) 2010, 2019, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -10021,6 +10021,8 @@ do_continue:;
|
||||
new_table->file->get_foreign_key_list(thd, &fk_list);
|
||||
while ((fk= fk_list_it++))
|
||||
{
|
||||
MDL_request mdl_request;
|
||||
|
||||
if (lower_case_table_names)
|
||||
{
|
||||
char buf[NAME_LEN];
|
||||
@ -10032,19 +10034,14 @@ do_continue:;
|
||||
len = my_casedn_str(files_charset_info, buf);
|
||||
thd->make_lex_string(fk->referenced_table, buf, len);
|
||||
}
|
||||
if (table_already_fk_prelocked(table_list, fk->referenced_db,
|
||||
fk->referenced_table, TL_READ_NO_INSERT))
|
||||
continue;
|
||||
|
||||
TABLE_LIST *tl= (TABLE_LIST *) thd->alloc(sizeof(TABLE_LIST));
|
||||
tl->init_one_table_for_prelocking(fk->referenced_db, fk->referenced_table,
|
||||
NULL, TL_READ_NO_INSERT, TABLE_LIST::PRELOCK_FK,
|
||||
NULL, 0, &thd->lex->query_tables_last);
|
||||
mdl_request.init(MDL_key::TABLE,
|
||||
fk->referenced_db->str, fk->referenced_table->str,
|
||||
MDL_SHARED_NO_WRITE, MDL_TRANSACTION);
|
||||
if (thd->mdl_context.acquire_lock(&mdl_request,
|
||||
thd->variables.lock_wait_timeout))
|
||||
goto err_new_table_cleanup;
|
||||
}
|
||||
|
||||
if (open_tables(thd, &table_list->next_global, &tables_opened, 0,
|
||||
&alter_prelocking_strategy))
|
||||
goto err_new_table_cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user