Commit c3e06381 authored by Sergei Golubchik's avatar Sergei Golubchik

cannot use item->const_item() in open_table_from_share()

because table->map is set much later.
Use check_vcol_func_processor() to detect fields too.
parent 12d75e61
......@@ -2511,6 +2511,10 @@ class Item_field :public Item_ident
bool enumerate_field_refs_processor(void *arg);
bool update_table_bitmaps_processor(void *arg);
bool switch_to_nullable_fields_processor(void *arg);
bool check_vcol_func_processor(void *arg)
{ // may be, a special flag VCOL_FIELD ?
return mark_unsupported_function(field_name, arg, VCOL_UNKNOWN);
}
void cleanup();
Item_equal *get_item_equal() { return item_equal; }
void set_item_equal(Item_equal *item_eq) { item_equal= item_eq; }
......
......@@ -3041,8 +3041,8 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share,
goto err;
}
field->default_value= vcol;
if (is_create_table && vcol->expr_item->const_item() &&
!(vcol->flags & (VCOL_NON_DETERMINISTIC | VCOL_TIME_FUNC)))
if (is_create_table &&
!(vcol->flags & (VCOL_UNKNOWN | VCOL_NON_DETERMINISTIC | VCOL_TIME_FUNC)))
{
enum_check_fields old_count_cuted_fields= thd->count_cuted_fields;
thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong default values
......
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