Skip to content

Commit

Permalink
cannot use item->const_item() in open_table_from_share()
Browse files Browse the repository at this point in the history
because table->map is set much later.
Use check_vcol_func_processor() to detect fields too.
  • Loading branch information
vuvova committed Jul 1, 2016
1 parent 12d75e6 commit c3e0638
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions sql/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
4 changes: 2 additions & 2 deletions sql/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c3e0638

Please sign in to comment.