Browse Source

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.
pull/211/head
Sergei Golubchik 10 years ago
parent
commit
c3e06381ab
  1. 4
      sql/item.h
  2. 4
      sql/table.cc

4
sql/item.h

@ -2511,6 +2511,10 @@ public:
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; }

4
sql/table.cc

@ -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

Loading…
Cancel
Save