Commit 56c1f8da authored by Sergei Golubchik's avatar Sergei Golubchik

bugfix: table->get_fields_in_item_tree=true

partitioning was setting subj as a partitioning-specific
hack (GET_FIXED_FIELDS_FLAG field flag to detect partitioning fields)
inside init_lex_with_single_table(). But vcols also use
init_lex_with_single_table(), they run fix_fields()
in open_table_from_share() before partitioning and this messes up
partitioning GET_FIXED_FIELDS_FLAG logic.
parent f73bdb68
......@@ -196,7 +196,6 @@ init_lex_with_single_table(THD *thd, TABLE *table, LEX *lex)
lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VCOL_EXPR;
select_lex->cur_pos_in_select_list= UNDEF_POS;
table->map= 1; //To ensure correct calculation of const item
table->get_fields_in_item_tree= TRUE;
table_list->table= table;
table_list->cacheable_table= false;
return FALSE;
......
......@@ -936,6 +936,7 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
if (init_lex_with_single_table(thd, table, &lex))
goto end;
table->get_fields_in_item_tree= true;
func_expr->walk(&Item::change_context_processor, 0, &lex.select_lex.context);
thd->where= "partition function";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment