diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-11-10 16:10:41 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-09-04 08:37:44 +0200 |
commit | 3b365fa82917ea0a29e11f160a80707d27b9948a (patch) | |
tree | bdb910f764802ab38f4163371bf52aee4f453845 /sql/table.h | |
parent | 22bcfa011acd81c44c2ad969a0edc2401a32a311 (diff) | |
download | mariadb-git-3b365fa82917ea0a29e11f160a80707d27b9948a.tar.gz |
cleanup: sp_head::add_used_tables_to_table_list()
Use TABLE::init_one_table(), don't duplicate it.
Put additional initializations into TABLE::init_one_table_for_prelocking()
Backport of f1362910980
Diffstat (limited to 'sql/table.h')
-rw-r--r-- | sql/table.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/table.h b/sql/table.h index 1b7a447eaf1..5e99c89150b 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1707,6 +1707,28 @@ struct TABLE_LIST MDL_TRANSACTION); } + inline void init_one_table_for_prelocking(const char *db_name_arg, + size_t db_length_arg, + const char *table_name_arg, + size_t table_name_length_arg, + const char *alias_arg, + enum thr_lock_type lock_type_arg, + TABLE_LIST *belong_to_view_arg, + uint8 trg_event_map_arg, + TABLE_LIST ***last_ptr) + { + init_one_table(db_name_arg, db_length_arg, table_name_arg, + table_name_length_arg, alias_arg, lock_type_arg); + cacheable_table= 1; + prelocking_placeholder= 1; + belong_to_view= belong_to_view_arg; + trg_event_map= trg_event_map_arg; + + **last_ptr= this; + prev_global= *last_ptr; + *last_ptr= &next_global; + } + /* List of tables local to a subquery (used by SQL_I_List). Considers views as leaves (unlike 'next_leaf' below). Created at parse time |