diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-05 16:51:26 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-05 16:51:26 +0300 |
commit | 680463a8d991389f4ea5942e87764137c55c0eb4 (patch) | |
tree | 427f8946aa9085c7f6346e1047144995cb7c459e /sql | |
parent | 05693cf2149f8792863a32325090e789015286fc (diff) | |
parent | efc70da5fd0459ff44153529d13651741cc32bc4 (diff) | |
download | mariadb-git-680463a8d991389f4ea5942e87764137c55c0eb4.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_base.cc | 8 | ||||
-rw-r--r-- | sql/sql_window.cc | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e3993600b37..073c37e9b99 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1715,6 +1715,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx) { table= best_table; table->query_id= thd->query_id; + table->init(thd, table_list); DBUG_PRINT("info",("Using locked table")); #ifdef WITH_PARTITION_STORAGE_ENGINE part_names_error= set_partitions_as_used(table_list, table); @@ -2011,12 +2012,13 @@ retry_share: } table->mdl_ticket= mdl_ticket; + table->reginfo.lock_type=TL_READ; /* Assume read */ + + table->init(thd, table_list); table->next= thd->open_tables; /* Link into simple list */ thd->set_open_tables(table); - table->reginfo.lock_type=TL_READ; /* Assume read */ - reset: /* Check that there is no reference to a condition from an earlier query @@ -2049,8 +2051,6 @@ retry_share: DBUG_RETURN(true); } - table->init(thd, table_list); - DBUG_RETURN(FALSE); err_lock: diff --git a/sql/sql_window.cc b/sql/sql_window.cc index 7e319c96000..35f5a83608c 100644 --- a/sql/sql_window.cc +++ b/sql/sql_window.cc @@ -3058,7 +3058,8 @@ bool Window_funcs_sort::setup(THD *thd, SQL_SELECT *sel, */ ORDER *order= (ORDER *)alloc_root(thd->mem_root, sizeof(ORDER)); memset(order, 0, sizeof(*order)); - Item *item= new (thd->mem_root) Item_field(thd, join_tab->table->field[0]); + Item *item= new (thd->mem_root) Item_temptable_field(thd, + join_tab->table->field[0]); order->item= (Item **)alloc_root(thd->mem_root, 2 * sizeof(Item *)); order->item[1]= NULL; order->item[0]= item; |