1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-11 05:52:26 +03:00

Backport of:

----------------------------------------------------------
revno: 2617.69.20
committer: Konstantin Osipov <kostja@sun.com>
branch nick: 5.4-4284-1-assert
timestamp: Thu 2009-08-13 18:29:55 +0400
message:
  WL#4284 "Transactional DDL locking"
  A review fix.
  Since WL#4284 implementation separated MDL_request and MDL_ticket,
  MDL_request becamse a utility object necessary only to get a ticket.
  Store it by-value in TABLE_LIST with the intent to merge
  MDL_request::key with table_list->table_name and table_list->db
  in future.
  Change the MDL subsystem to not require MDL_requests to
  stay around till close_thread_tables().
  Remove the list of requests from the MDL context.
  Requests for shared metadata locks acquired in open_tables()
  are only used as a list in recover_from_failed_open_table_attempt(),
  which calls mdl_context.wait_for_locks() for this list.
  To keep such list for recover_from_failed_open_table_attempt(),
  introduce a context class (Open_table_context), that collects
  all requests.
  A lot of minor cleanups and simplications that became possible
  with this change.
This commit is contained in:
Konstantin Osipov
2009-12-08 12:57:07 +03:00
parent 4a8a1c568d
commit a66a2608ae
30 changed files with 566 additions and 733 deletions

View File

@@ -18,6 +18,7 @@
#include "sql_plist.h"
#include "mdl.h"
/* Structs that defines the TABLE */
@@ -30,8 +31,6 @@ class st_select_lex;
class partition_info;
class COND_EQUAL;
class Security_context;
class MDL_request;
class MDL_ticket;
/*************************************************************************/
@@ -1126,6 +1125,7 @@ struct TABLE_LIST
table_name_length= table_name_length_arg;
alias= (char*) alias_arg;
lock_type= lock_type_arg;
mdl_request.init(0, db, table_name, MDL_SHARED);
}
/*
@@ -1429,7 +1429,7 @@ struct TABLE_LIST
uint table_open_method;
enum enum_schema_table_state schema_table_state;
MDL_request *mdl_request;
MDL_request mdl_request;
void calc_md5(char *buffer);
void set_underlying_merge();
@@ -1798,6 +1798,6 @@ static inline void dbug_tmp_restore_column_maps(MY_BITMAP *read_set,
size_t max_row_length(TABLE *table, const uchar *data);
void alloc_mdl_requests(TABLE_LIST *table_list, MEM_ROOT *root);
void init_mdl_requests(TABLE_LIST *table_list);
#endif /* TABLE_INCLUDED */