1 |
=== modified file 'a/sql/sql_parse.cc' |
2 |
--- a/sql/sql_parse.cc 2012-05-28 05:44:43 +0000 |
3 |
+++ b/sql/sql_parse.cc 2012-12-05 13:24:45 +0000 |
4 |
@@ -6000,8 +6000,13 @@ |
5 |
ptr->next_name_resolution_table= NULL; |
6 |
/* Link table in global list (all used tables) */ |
7 |
lex->add_to_query_tables(ptr); |
8 |
- ptr->mdl_request.init(MDL_key::TABLE, ptr->db, ptr->table_name, mdl_type, |
9 |
- MDL_TRANSACTION); |
10 |
+ |
11 |
+ // Pure table aliases do not need to be locked: |
12 |
+ if (!test(table_options & TL_OPTION_ALIAS)) |
13 |
+ { |
14 |
+ ptr->mdl_request.init(MDL_key::TABLE, ptr->db, ptr->table_name, mdl_type, |
15 |
+ MDL_TRANSACTION); |
16 |
+ } |
17 |
DBUG_RETURN(ptr); |
18 |
} |
19 |
|
20 |
|