MDEV-20052 Add a MEM_ROOT pointer argument to Type_handler::make_xxx_field()
This commit is contained in:
parent
1517087b54
commit
e6ff3f9d1c
71
sql/item.h
71
sql/item.h
@ -783,10 +783,11 @@ protected:
|
||||
/**
|
||||
Create a field based on the exact data type handler.
|
||||
*/
|
||||
Field *create_table_field_from_handler(TABLE *table)
|
||||
Field *create_table_field_from_handler(MEM_ROOT *root, TABLE *table)
|
||||
{
|
||||
const Type_handler *h= type_handler();
|
||||
return h->make_and_init_table_field(&name, Record_addr(maybe_null),
|
||||
return h->make_and_init_table_field(root, &name,
|
||||
Record_addr(maybe_null),
|
||||
*this, table);
|
||||
}
|
||||
/**
|
||||
@ -799,11 +800,12 @@ protected:
|
||||
@retval NULL error
|
||||
@retval !NULL on success
|
||||
*/
|
||||
Field *tmp_table_field_from_field_type(TABLE *table)
|
||||
Field *tmp_table_field_from_field_type(MEM_ROOT *root, TABLE *table)
|
||||
{
|
||||
DBUG_ASSERT(is_fixed());
|
||||
const Type_handler *h= type_handler()->type_handler_for_tmp_table(this);
|
||||
return h->make_and_init_table_field(&name, Record_addr(maybe_null),
|
||||
return h->make_and_init_table_field(root, &name,
|
||||
Record_addr(maybe_null),
|
||||
*this, table);
|
||||
}
|
||||
/**
|
||||
@ -815,17 +817,20 @@ protected:
|
||||
- does not need to set Field::is_created_from_null_item for the result
|
||||
See create_tmp_field_ex() for details on parameters and return values.
|
||||
*/
|
||||
Field *create_tmp_field_ex_simple(TABLE *table,
|
||||
Field *create_tmp_field_ex_simple(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
DBUG_ASSERT(!param->make_copy_field());
|
||||
DBUG_ASSERT(!is_result_field());
|
||||
DBUG_ASSERT(type() != NULL_ITEM);
|
||||
return tmp_table_field_from_field_type(table);
|
||||
return tmp_table_field_from_field_type(root, table);
|
||||
}
|
||||
Field *create_tmp_field_int(TABLE *table, uint convert_int_length);
|
||||
Field *tmp_table_field_from_field_type_maybe_null(TABLE *table,
|
||||
Field *create_tmp_field_int(MEM_ROOT *root, TABLE *table,
|
||||
uint convert_int_length);
|
||||
Field *tmp_table_field_from_field_type_maybe_null(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
Tmp_field_src *src,
|
||||
const Tmp_field_param *param,
|
||||
bool is_explicit_null);
|
||||
@ -1505,7 +1510,7 @@ public:
|
||||
int save_str_value_in_field(Field *field, String *result);
|
||||
|
||||
virtual Field *get_tmp_table_field() { return 0; }
|
||||
virtual Field *create_field_for_create_select(TABLE *table);
|
||||
virtual Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table);
|
||||
virtual const char *full_name() const { return name.str ? name.str : "???"; }
|
||||
const char *field_name_or_null()
|
||||
{ return real_item()->type() == Item::FIELD_ITEM ? name.str : NULL; }
|
||||
@ -2082,7 +2087,8 @@ public:
|
||||
@retval NULL (on error)
|
||||
@retval a pointer to a newly create Field (on success)
|
||||
*/
|
||||
virtual Field *create_tmp_field_ex(TABLE *table,
|
||||
virtual Field *create_tmp_field_ex(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
Tmp_field_src *src,
|
||||
const Tmp_field_param *param)= 0;
|
||||
virtual Item_field *field_for_view_update() { return 0; }
|
||||
@ -2653,7 +2659,8 @@ protected:
|
||||
}
|
||||
Item_basic_value(THD *thd): Item(thd) {}
|
||||
public:
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root,
|
||||
TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
|
||||
@ -2665,7 +2672,8 @@ public:
|
||||
DECLARE c CURSOR FOR SELECT 'test';
|
||||
OPEN c;
|
||||
*/
|
||||
return tmp_table_field_from_field_type_maybe_null(table, src, param,
|
||||
return tmp_table_field_from_field_type_maybe_null(root,
|
||||
table, src, param,
|
||||
type() == Item::NULL_ITEM);
|
||||
}
|
||||
bool eq(const Item *item, bool binary_cmp) const;
|
||||
@ -2737,10 +2745,11 @@ public:
|
||||
|
||||
inline bool const_item() const;
|
||||
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root,
|
||||
TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
return create_tmp_field_ex_simple(table, src, param);
|
||||
return create_tmp_field_ex_simple(root, table, src, param);
|
||||
}
|
||||
inline int save_in_field(Field *field, bool no_conversions);
|
||||
inline bool send(Protocol *protocol, st_value *buffer);
|
||||
@ -2843,8 +2852,8 @@ public:
|
||||
The inherited implementation would create a column
|
||||
based on result_type(), which is less exact.
|
||||
*/
|
||||
Field *create_field_for_create_select(TABLE *table)
|
||||
{ return create_table_field_from_handler(table); }
|
||||
Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table)
|
||||
{ return create_table_field_from_handler(root, table); }
|
||||
|
||||
bool is_valid_limit_clause_variable_with_error() const
|
||||
{
|
||||
@ -3033,7 +3042,8 @@ public:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root,
|
||||
TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
/*
|
||||
@ -3041,7 +3051,7 @@ public:
|
||||
DECLARE c CURSOR FOR SELECT NAME_CONST('x','y') FROM t1;
|
||||
OPEN c;
|
||||
*/
|
||||
return tmp_table_field_from_field_type_maybe_null(table, src, param,
|
||||
return tmp_table_field_from_field_type_maybe_null(root, table, src, param,
|
||||
type() == Item::NULL_ITEM);
|
||||
}
|
||||
int save_in_field(Field *field, bool no_conversions)
|
||||
@ -3101,7 +3111,7 @@ public:
|
||||
{}
|
||||
~Item_result_field() {} /* Required with gcc 2.95 */
|
||||
Field *get_tmp_table_field() { return result_field; }
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param);
|
||||
void get_tmp_field_src(Tmp_field_src *src, const Tmp_field_param *param);
|
||||
/*
|
||||
@ -3289,10 +3299,11 @@ public:
|
||||
return &type_handler_null;
|
||||
return field->type_handler();
|
||||
}
|
||||
Field *create_tmp_field_from_item_field(TABLE *new_table,
|
||||
Field *create_tmp_field_from_item_field(MEM_ROOT *root, TABLE *new_table,
|
||||
Item_ref *orig_item,
|
||||
const Tmp_field_param *param);
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root,
|
||||
TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param);
|
||||
const TYPELIB *get_typelib() const { return field->get_typelib(); }
|
||||
enum_monotonicity_info get_monotonicity_info() const
|
||||
@ -3535,7 +3546,7 @@ public:
|
||||
{
|
||||
return result_field->type();
|
||||
}
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
@ -4003,8 +4014,8 @@ public:
|
||||
Item_int(THD *thd, const char *str_arg, size_t length=64);
|
||||
const Type_handler *type_handler() const
|
||||
{ return type_handler_long_or_longlong(); }
|
||||
Field *create_field_for_create_select(TABLE *table)
|
||||
{ return tmp_table_field_from_field_type(table); }
|
||||
Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table)
|
||||
{ return tmp_table_field_from_field_type(root, table); }
|
||||
const longlong *const_ptr_longlong() const { return &value; }
|
||||
longlong val_int() { return value; }
|
||||
longlong val_int_min() const { return value; }
|
||||
@ -5106,7 +5117,7 @@ public:
|
||||
Field *get_tmp_table_field()
|
||||
{ return result_field ? result_field : (*ref)->get_tmp_table_field(); }
|
||||
Item *get_tmp_table_item(THD *thd);
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param);
|
||||
Item* propagate_equal_fields(THD *, const Context &, COND_EQUAL *);
|
||||
table_map used_tables() const;
|
||||
@ -5866,7 +5877,7 @@ public:
|
||||
const Type_handler *type_handler() const
|
||||
{ return Type_handler_hybrid_field_type::type_handler(); }
|
||||
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
@ -6384,10 +6395,10 @@ public:
|
||||
|
||||
const Type_handler *type_handler() const
|
||||
{ return Type_handler_hybrid_field_type::type_handler(); }
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
return create_tmp_field_ex_simple(table, src, param);
|
||||
return create_tmp_field_ex_simple(root, table, src, param);
|
||||
}
|
||||
|
||||
virtual void keep_array() {}
|
||||
@ -6929,11 +6940,11 @@ public:
|
||||
my_decimal *val_decimal(my_decimal *);
|
||||
String *val_str(String*);
|
||||
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
return Item_type_holder::real_type_handler()->
|
||||
make_and_init_table_field(&name, Record_addr(maybe_null),
|
||||
make_and_init_table_field(root, &name, Record_addr(maybe_null),
|
||||
*this, table);
|
||||
}
|
||||
Item* get_copy(THD *thd) { return 0; }
|
||||
|
@ -188,8 +188,8 @@ public:
|
||||
|
||||
void signal_divide_by_null();
|
||||
friend class udf_handler;
|
||||
Field *create_field_for_create_select(TABLE *table)
|
||||
{ return tmp_table_field_from_field_type(table); }
|
||||
Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table)
|
||||
{ return tmp_table_field_from_field_type(root, table); }
|
||||
Item *get_tmp_table_item(THD *thd);
|
||||
|
||||
my_decimal *val_decimal(my_decimal *);
|
||||
@ -2673,10 +2673,10 @@ public:
|
||||
Item_func_user_var(THD *thd, Item_func_user_var *item)
|
||||
:Item_hybrid_func(thd, item),
|
||||
m_var_entry(item->m_var_entry), name(item->name) { }
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param);
|
||||
Field *create_field_for_create_select(TABLE *table)
|
||||
{ return create_table_field_from_handler(table); }
|
||||
Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table)
|
||||
{ return create_table_field_from_handler(root, table); }
|
||||
bool check_vcol_func_processor(void *arg);
|
||||
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
|
||||
{
|
||||
@ -2851,7 +2851,7 @@ public:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
@ -3173,13 +3173,13 @@ public:
|
||||
|
||||
const Type_handler *type_handler() const;
|
||||
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param);
|
||||
Field *create_field_for_create_select(TABLE *table)
|
||||
Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table)
|
||||
{
|
||||
return result_type() != STRING_RESULT ?
|
||||
sp_result_field :
|
||||
create_table_field_from_handler(table);
|
||||
create_table_field_from_handler(root, table);
|
||||
}
|
||||
void make_send_field(THD *thd, Send_field *tmp_field);
|
||||
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
bool with_subquery() const { DBUG_ASSERT(fixed); return m_with_subquery; }
|
||||
enum Type type() const { return ROW_ITEM; };
|
||||
const Type_handler *type_handler() const { return &type_handler_row; }
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
return NULL; // Check with Vicentiu why it's called for Item_row
|
||||
|
@ -1796,8 +1796,8 @@ public:
|
||||
TABLE *table;
|
||||
Item_temptable_rowid(TABLE *table_arg);
|
||||
const Type_handler *type_handler() const { return &type_handler_string; }
|
||||
Field *create_tmp_field(bool group, TABLE *table)
|
||||
{ return create_table_field_from_handler(table); }
|
||||
Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table)
|
||||
{ return create_table_field_from_handler(root, table); }
|
||||
String *val_str(String *str);
|
||||
enum Functype functype() const { return TEMPTABLE_ROWID; }
|
||||
const char *func_name() const { return "<rowid>"; }
|
||||
|
@ -1231,21 +1231,22 @@ void Item_sum_hybrid::setup_hybrid(THD *thd, Item *item, Item *value_arg)
|
||||
}
|
||||
|
||||
|
||||
Field *Item_sum_hybrid::create_tmp_field(bool group, TABLE *table)
|
||||
Field *Item_sum_hybrid::create_tmp_field(MEM_ROOT *root,
|
||||
bool group, TABLE *table)
|
||||
{
|
||||
DBUG_ENTER("Item_sum_hybrid::create_tmp_field");
|
||||
|
||||
if (args[0]->type() == Item::FIELD_ITEM)
|
||||
{
|
||||
Field *field= ((Item_field*) args[0])->field;
|
||||
if ((field= field->create_tmp_field(table->in_use->mem_root, table, true)))
|
||||
if ((field= field->create_tmp_field(root, table, true)))
|
||||
{
|
||||
DBUG_ASSERT((field->flags & NOT_NULL_FLAG) == 0);
|
||||
field->field_name= name;
|
||||
}
|
||||
DBUG_RETURN(field);
|
||||
}
|
||||
DBUG_RETURN(tmp_table_field_from_field_type(table));
|
||||
DBUG_RETURN(tmp_table_field_from_field_type(root, table));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@ -1935,7 +1936,7 @@ Item *Item_sum_avg::copy_or_same(THD* thd)
|
||||
}
|
||||
|
||||
|
||||
Field *Item_sum_avg::create_tmp_field(bool group, TABLE *table)
|
||||
Field *Item_sum_avg::create_tmp_field(MEM_ROOT *root, bool group, TABLE *table)
|
||||
{
|
||||
|
||||
if (group)
|
||||
@ -1945,7 +1946,7 @@ Field *Item_sum_avg::create_tmp_field(bool group, TABLE *table)
|
||||
The easiest way is to do this is to store both value in a string
|
||||
and unpack on access.
|
||||
*/
|
||||
Field *field= new (table->in_use->mem_root)
|
||||
Field *field= new (root)
|
||||
Field_string(((result_type() == DECIMAL_RESULT) ?
|
||||
dec_bin_size : sizeof(double)) + sizeof(longlong),
|
||||
0, &name, &my_charset_bin);
|
||||
@ -1953,7 +1954,7 @@ Field *Item_sum_avg::create_tmp_field(bool group, TABLE *table)
|
||||
field->init(table);
|
||||
return field;
|
||||
}
|
||||
return tmp_table_field_from_field_type(table);
|
||||
return tmp_table_field_from_field_type(root, table);
|
||||
}
|
||||
|
||||
|
||||
@ -2177,7 +2178,8 @@ Item *Item_sum_variance::copy_or_same(THD* thd)
|
||||
If we're grouping, then we need some space to serialize variables into, to
|
||||
pass around.
|
||||
*/
|
||||
Field *Item_sum_variance::create_tmp_field(bool group, TABLE *table)
|
||||
Field *Item_sum_variance::create_tmp_field(MEM_ROOT *root,
|
||||
bool group, TABLE *table)
|
||||
{
|
||||
Field *field;
|
||||
if (group)
|
||||
@ -2187,11 +2189,12 @@ Field *Item_sum_variance::create_tmp_field(bool group, TABLE *table)
|
||||
The easiest way is to do this is to store both value in a string
|
||||
and unpack on access.
|
||||
*/
|
||||
field= new Field_string(Stddev::binary_size(), 0, &name, &my_charset_bin);
|
||||
field= new (root) Field_string(Stddev::binary_size(), 0,
|
||||
&name, &my_charset_bin);
|
||||
}
|
||||
else
|
||||
field= new Field_double(max_length, maybe_null, &name, decimals,
|
||||
TRUE);
|
||||
field= new (root) Field_double(max_length, maybe_null, &name, decimals,
|
||||
TRUE);
|
||||
|
||||
if (field != NULL)
|
||||
field->init(table);
|
||||
|
@ -513,11 +513,11 @@ public:
|
||||
}
|
||||
virtual void make_unique() { force_copy_fields= TRUE; }
|
||||
Item *get_tmp_table_item(THD *thd);
|
||||
virtual Field *create_tmp_field(bool group, TABLE *table);
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
virtual Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table);
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
return create_tmp_field(param->group(), table);
|
||||
return create_tmp_field(root, param->group(), table);
|
||||
}
|
||||
virtual bool collect_outer_ref_processor(void *param);
|
||||
bool init_sum_func_check(THD *thd);
|
||||
@ -928,7 +928,7 @@ public:
|
||||
return has_with_distinct() ? "avg(distinct " : "avg(";
|
||||
}
|
||||
Item *copy_or_same(THD* thd);
|
||||
Field *create_tmp_field(bool group, TABLE *table);
|
||||
Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table);
|
||||
void cleanup()
|
||||
{
|
||||
count= 0;
|
||||
@ -1013,7 +1013,7 @@ public:
|
||||
const char *func_name() const
|
||||
{ return sample ? "var_samp(" : "variance("; }
|
||||
Item *copy_or_same(THD* thd);
|
||||
Field *create_tmp_field(bool group, TABLE *table);
|
||||
Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table);
|
||||
const Type_handler *type_handler() const { return &type_handler_double; }
|
||||
void cleanup()
|
||||
{
|
||||
@ -1100,7 +1100,7 @@ protected:
|
||||
bool any_value() { return was_values; }
|
||||
void no_rows_in_result();
|
||||
void restore_to_before_no_rows_in_result();
|
||||
Field *create_tmp_field(bool group, TABLE *table);
|
||||
Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table);
|
||||
void setup_caches(THD *thd) { setup_hybrid(thd, arguments()[0], NULL); }
|
||||
};
|
||||
|
||||
@ -1323,9 +1323,9 @@ public:
|
||||
{
|
||||
return SP_AGGREGATE_FUNC;
|
||||
}
|
||||
Field *create_field_for_create_select(TABLE *table)
|
||||
Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table)
|
||||
{
|
||||
return create_table_field_from_handler(table);
|
||||
return create_table_field_from_handler(root, table);
|
||||
}
|
||||
bool fix_length_and_dec();
|
||||
bool fix_fields(THD *thd, Item **ref);
|
||||
@ -1407,10 +1407,10 @@ public:
|
||||
unsigned_flag= item->unsigned_flag;
|
||||
}
|
||||
table_map used_tables() const { return (table_map) 1L; }
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
return create_tmp_field_ex_simple(table, src, param);
|
||||
return create_tmp_field_ex_simple(root, table, src, param);
|
||||
}
|
||||
void save_in_result_field(bool no_conversions) { DBUG_ASSERT(0); }
|
||||
bool check_vcol_func_processor(void *arg)
|
||||
|
@ -458,7 +458,8 @@ bool Item_sum_hybrid_simple::get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t f
|
||||
return retval;
|
||||
}
|
||||
|
||||
Field *Item_sum_hybrid_simple::create_tmp_field(bool group, TABLE *table)
|
||||
Field *Item_sum_hybrid_simple::create_tmp_field(MEM_ROOT *root,
|
||||
bool group, TABLE *table)
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
return NULL;
|
||||
|
@ -320,7 +320,7 @@ class Item_sum_hybrid_simple : public Item_sum,
|
||||
const Type_handler *type_handler() const
|
||||
{ return Type_handler_hybrid_field_type::type_handler(); }
|
||||
void update_field();
|
||||
Field *create_tmp_field(bool group, TABLE *table);
|
||||
Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table);
|
||||
void clear()
|
||||
{
|
||||
value->clear();
|
||||
|
@ -195,7 +195,7 @@ public:
|
||||
{
|
||||
return &type_handler_xpath_nodeset;
|
||||
}
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
@ -606,7 +606,7 @@ public:
|
||||
{
|
||||
return mark_unsupported_function(func_name(), arg, VCOL_IMPOSSIBLE);
|
||||
}
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
this->name.length= strlen(name_par);
|
||||
}
|
||||
enum Type type() const { return Item::PROC_ITEM; }
|
||||
Field *create_tmp_field_ex(TABLE *table, Tmp_field_src *src,
|
||||
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
/*
|
||||
@ -52,7 +52,7 @@ public:
|
||||
DECLARE c CURSOR FOR SELECT * FROM t1 PROCEDURE analyse();
|
||||
OPEN c;
|
||||
*/
|
||||
return create_tmp_field_ex_simple(table, src, param);
|
||||
return create_tmp_field_ex_simple(root, table, src, param);
|
||||
}
|
||||
virtual void set(double nr)=0;
|
||||
virtual void set(const char *str,uint length,CHARSET_INFO *cs)=0;
|
||||
|
@ -1034,7 +1034,8 @@ public:
|
||||
bool add(const Type_handler *handler,
|
||||
uint16 metadata, const Field *target_field)
|
||||
{
|
||||
Field *tmp= handler->make_conversion_table_field(this, metadata,
|
||||
Field *tmp= handler->make_conversion_table_field(in_use->mem_root,
|
||||
this, metadata,
|
||||
target_field);
|
||||
if (!tmp)
|
||||
return true;
|
||||
|
@ -4127,11 +4127,11 @@ void select_insert::abort_result_set() {
|
||||
CREATE TABLE (SELECT) ...
|
||||
***************************************************************************/
|
||||
|
||||
Field *Item::create_field_for_create_select(TABLE *table)
|
||||
Field *Item::create_field_for_create_select(MEM_ROOT *root, TABLE *table)
|
||||
{
|
||||
static Tmp_field_param param(false, false, false, false);
|
||||
Tmp_field_src src;
|
||||
return create_tmp_field_ex(table, &src, ¶m);
|
||||
return create_tmp_field_ex(root, table, &src, ¶m);
|
||||
}
|
||||
|
||||
|
||||
@ -4202,7 +4202,8 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
|
||||
|
||||
while ((item=it++))
|
||||
{
|
||||
Field *tmp_field= item->create_field_for_create_select(&tmp_table);
|
||||
Field *tmp_field= item->create_field_for_create_select(thd->mem_root,
|
||||
&tmp_table);
|
||||
|
||||
if (!tmp_field)
|
||||
DBUG_RETURN(NULL);
|
||||
|
@ -17474,16 +17474,18 @@ const_expression_in_where(COND *cond, Item *comp_item, Field *comp_field,
|
||||
Create internal temporary table
|
||||
****************************************************************************/
|
||||
|
||||
Field *Item::create_tmp_field_int(TABLE *table, uint convert_int_length)
|
||||
Field *Item::create_tmp_field_int(MEM_ROOT *root, TABLE *table,
|
||||
uint convert_int_length)
|
||||
{
|
||||
const Type_handler *h= &type_handler_long;
|
||||
if (max_char_length() > convert_int_length)
|
||||
h= &type_handler_longlong;
|
||||
return h->make_and_init_table_field(&name, Record_addr(maybe_null),
|
||||
return h->make_and_init_table_field(root, &name, Record_addr(maybe_null),
|
||||
*this, table);
|
||||
}
|
||||
|
||||
Field *Item::tmp_table_field_from_field_type_maybe_null(TABLE *table,
|
||||
Field *Item::tmp_table_field_from_field_type_maybe_null(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
Tmp_field_src *src,
|
||||
const Tmp_field_param *param,
|
||||
bool is_explicit_null)
|
||||
@ -17495,7 +17497,7 @@ Field *Item::tmp_table_field_from_field_type_maybe_null(TABLE *table,
|
||||
DBUG_ASSERT(!param->make_copy_field() || type() == CONST_ITEM);
|
||||
DBUG_ASSERT(!is_result_field());
|
||||
Field *result;
|
||||
if ((result= tmp_table_field_from_field_type(table)))
|
||||
if ((result= tmp_table_field_from_field_type(root, table)))
|
||||
{
|
||||
if (result && is_explicit_null)
|
||||
result->is_created_from_null_item= true;
|
||||
@ -17504,15 +17506,14 @@ Field *Item::tmp_table_field_from_field_type_maybe_null(TABLE *table,
|
||||
}
|
||||
|
||||
|
||||
Field *Item_sum::create_tmp_field(bool group, TABLE *table)
|
||||
Field *Item_sum::create_tmp_field(MEM_ROOT *root, bool group, TABLE *table)
|
||||
{
|
||||
Field *UNINIT_VAR(new_field);
|
||||
MEM_ROOT *mem_root= table->in_use->mem_root;
|
||||
|
||||
switch (cmp_type()) {
|
||||
case REAL_RESULT:
|
||||
{
|
||||
new_field= new (mem_root)
|
||||
new_field= new (root)
|
||||
Field_double(max_char_length(), maybe_null, &name, decimals, TRUE);
|
||||
break;
|
||||
}
|
||||
@ -17520,7 +17521,7 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table)
|
||||
case TIME_RESULT:
|
||||
case DECIMAL_RESULT:
|
||||
case STRING_RESULT:
|
||||
new_field= tmp_table_field_from_field_type(table);
|
||||
new_field= tmp_table_field_from_field_type(root, table);
|
||||
break;
|
||||
case ROW_RESULT:
|
||||
// This case should never be choosen
|
||||
@ -17539,7 +17540,7 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table)
|
||||
either direct or referenced by an Item_ref.
|
||||
*/
|
||||
Field *
|
||||
Item_field::create_tmp_field_from_item_field(TABLE *new_table,
|
||||
Item_field::create_tmp_field_from_item_field(MEM_ROOT *root, TABLE *new_table,
|
||||
Item_ref *orig_item,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
@ -17563,14 +17564,15 @@ Item_field::create_tmp_field_from_item_field(TABLE *new_table,
|
||||
Record_addr rec(orig_item ? orig_item->maybe_null : maybe_null);
|
||||
const Type_handler *handler= type_handler()->
|
||||
type_handler_for_tmp_table(this);
|
||||
result= handler->make_and_init_table_field(orig_item ? &orig_item->name : &name,
|
||||
result= handler->make_and_init_table_field(root,
|
||||
orig_item ? &orig_item->name : &name,
|
||||
rec, *this, new_table);
|
||||
}
|
||||
else if (param->table_cant_handle_bit_fields() &&
|
||||
field->type() == MYSQL_TYPE_BIT)
|
||||
{
|
||||
const Type_handler *handler= type_handler_long_or_longlong();
|
||||
result= handler->make_and_init_table_field(&name,
|
||||
result= handler->make_and_init_table_field(root, &name,
|
||||
Record_addr(maybe_null),
|
||||
*this, new_table);
|
||||
}
|
||||
@ -17579,8 +17581,7 @@ Item_field::create_tmp_field_from_item_field(TABLE *new_table,
|
||||
LEX_CSTRING *tmp= orig_item ? &orig_item->name : &name;
|
||||
bool tmp_maybe_null= param->modify_item() ? maybe_null :
|
||||
field->maybe_null();
|
||||
result= field->create_tmp_field(new_table->in_use->mem_root, new_table,
|
||||
tmp_maybe_null);
|
||||
result= field->create_tmp_field(root, new_table, tmp_maybe_null);
|
||||
if (result)
|
||||
result->field_name= *tmp;
|
||||
}
|
||||
@ -17590,14 +17591,14 @@ Item_field::create_tmp_field_from_item_field(TABLE *new_table,
|
||||
}
|
||||
|
||||
|
||||
Field *Item_field::create_tmp_field_ex(TABLE *table,
|
||||
Field *Item_field::create_tmp_field_ex(MEM_ROOT *root, TABLE *table,
|
||||
Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
DBUG_ASSERT(!is_result_field());
|
||||
Field *result;
|
||||
src->set_field(field);
|
||||
if (!(result= create_tmp_field_from_item_field(table, NULL, param)))
|
||||
if (!(result= create_tmp_field_from_item_field(root, table, NULL, param)))
|
||||
return NULL;
|
||||
/*
|
||||
Fields that are used as arguments to the DEFAULT() function already have
|
||||
@ -17610,7 +17611,7 @@ Field *Item_field::create_tmp_field_ex(TABLE *table,
|
||||
}
|
||||
|
||||
|
||||
Field *Item_ref::create_tmp_field_ex(TABLE *table,
|
||||
Field *Item_ref::create_tmp_field_ex(MEM_ROOT *root, TABLE *table,
|
||||
Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
@ -17623,13 +17624,14 @@ Field *Item_ref::create_tmp_field_ex(TABLE *table,
|
||||
Tmp_field_param prm2(*param);
|
||||
prm2.set_modify_item(false);
|
||||
src->set_field(field->field);
|
||||
if (!(result= field->create_tmp_field_from_item_field(table, this, &prm2)))
|
||||
if (!(result= field->create_tmp_field_from_item_field(root, table,
|
||||
this, &prm2)))
|
||||
return NULL;
|
||||
if (param->modify_item())
|
||||
result_field= result;
|
||||
return result;
|
||||
}
|
||||
return Item_result_field::create_tmp_field_ex(table, src, param);
|
||||
return Item_result_field::create_tmp_field_ex(root, table, src, param);
|
||||
}
|
||||
|
||||
|
||||
@ -17648,7 +17650,7 @@ void Item_result_field::get_tmp_field_src(Tmp_field_src *src,
|
||||
}
|
||||
|
||||
|
||||
Field *Item_result_field::create_tmp_field_ex(TABLE *table,
|
||||
Field *Item_result_field::create_tmp_field_ex(MEM_ROOT *root, TABLE *table,
|
||||
Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
@ -17662,13 +17664,14 @@ Field *Item_result_field::create_tmp_field_ex(TABLE *table,
|
||||
DBUG_ASSERT(type() != NULL_ITEM);
|
||||
get_tmp_field_src(src, param);
|
||||
Field *result;
|
||||
if ((result= tmp_table_field_from_field_type(table)) && param->modify_item())
|
||||
if ((result= tmp_table_field_from_field_type(root, table)) &&
|
||||
param->modify_item())
|
||||
result_field= result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Field *Item_func_user_var::create_tmp_field_ex(TABLE *table,
|
||||
Field *Item_func_user_var::create_tmp_field_ex(MEM_ROOT *root, TABLE *table,
|
||||
Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
@ -17676,20 +17679,20 @@ Field *Item_func_user_var::create_tmp_field_ex(TABLE *table,
|
||||
DBUG_ASSERT(type() != NULL_ITEM);
|
||||
get_tmp_field_src(src, param);
|
||||
Field *result;
|
||||
if ((result= create_table_field_from_handler(table)) && param->modify_item())
|
||||
if ((result= create_table_field_from_handler(root, table)) &&
|
||||
param->modify_item())
|
||||
result_field= result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Field *Item_func_sp::create_tmp_field_ex(TABLE *table,
|
||||
Field *Item_func_sp::create_tmp_field_ex(MEM_ROOT *root, TABLE *table,
|
||||
Tmp_field_src *src,
|
||||
const Tmp_field_param *param)
|
||||
{
|
||||
Field *result;
|
||||
get_tmp_field_src(src, param);
|
||||
if ((result= sp_result_field->create_tmp_field(table->in_use->mem_root,
|
||||
table)))
|
||||
if ((result= sp_result_field->create_tmp_field(root, table)))
|
||||
{
|
||||
result->field_name= name;
|
||||
if (param->modify_item())
|
||||
@ -17735,7 +17738,8 @@ Field *create_tmp_field(TABLE *table, Item *item,
|
||||
Tmp_field_src src;
|
||||
Tmp_field_param prm(group, modify_item, table_cant_handle_bit_fields,
|
||||
make_copy_field);
|
||||
Field *result= item->create_tmp_field_ex(table, &src, &prm);
|
||||
Field *result= item->create_tmp_field_ex(table->in_use->mem_root,
|
||||
table, &src, &prm);
|
||||
*from_field= src.field();
|
||||
*default_field= src.default_field();
|
||||
if (src.item_result_field())
|
||||
@ -18736,7 +18740,8 @@ bool Create_tmp_table::add_schema_fields(THD *thd, TABLE *table,
|
||||
bool visible= bitmap_is_set(&bitmap, fieldnr);
|
||||
Record_addr addr(def.nullable());
|
||||
const Type_handler *h= def.type_handler();
|
||||
Field *field= h->make_schema_field(table, addr, def, visible);
|
||||
Field *field= h->make_schema_field(&table->mem_root, table,
|
||||
addr, def, visible);
|
||||
if (!field)
|
||||
{
|
||||
thd->mem_root= mem_root_save;
|
||||
|
364
sql/sql_type.cc
364
sql/sql_type.cc
File diff suppressed because it is too large
Load Diff
225
sql/sql_type.h
225
sql/sql_type.h
@ -3472,7 +3472,8 @@ public:
|
||||
This information is not available in the binary log, so
|
||||
we assume that these fields are the same on the master and on the slave.
|
||||
*/
|
||||
virtual Field *make_conversion_table_field(TABLE *TABLE,
|
||||
virtual Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
uint metadata,
|
||||
const Field *target) const= 0;
|
||||
virtual void show_binlog_type(const Conv_source &src, String *str) const;
|
||||
@ -3566,15 +3567,18 @@ public:
|
||||
{
|
||||
return true; // Error
|
||||
}
|
||||
virtual Field *make_table_field(const LEX_CSTRING *name,
|
||||
virtual Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const= 0;
|
||||
Field *make_and_init_table_field(const LEX_CSTRING *name,
|
||||
Field *make_and_init_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
virtual Field *make_schema_field(TABLE *table,
|
||||
virtual Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const
|
||||
@ -3943,7 +3947,8 @@ public:
|
||||
DBUG_ASSERT(0);
|
||||
return NULL;
|
||||
}
|
||||
Field *make_conversion_table_field(TABLE *TABLE,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
uint metadata,
|
||||
const Field *target) const
|
||||
{
|
||||
@ -3980,7 +3985,8 @@ public:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const
|
||||
@ -4385,7 +4391,8 @@ public:
|
||||
}
|
||||
bool subquery_type_allows_materialization(const Item *inner,
|
||||
const Item *outer) const;
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const;
|
||||
@ -4971,18 +4978,21 @@ public:
|
||||
{
|
||||
return Item_send_tiny(item, protocol, buf);
|
||||
}
|
||||
Field *make_conversion_table_field(TABLE *TABLE, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_TINY); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const;
|
||||
@ -5022,18 +5032,21 @@ public:
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const
|
||||
{ return 6; }
|
||||
uint32 calc_pack_length(uint32 length) const { return 2; }
|
||||
Field *make_conversion_table_field(TABLE *TABLE, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_SHORT); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const;
|
||||
@ -5073,18 +5086,21 @@ public:
|
||||
{
|
||||
return Item_send_long(item, protocol, buf);
|
||||
}
|
||||
Field *make_conversion_table_field(TABLE *TABLE, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_LONG); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const;
|
||||
@ -5137,7 +5153,8 @@ public:
|
||||
{
|
||||
return Item_send_longlong(item, protocol, buf);
|
||||
}
|
||||
Field *make_conversion_table_field(TABLE *TABLE, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
@ -5146,11 +5163,13 @@ public:
|
||||
{
|
||||
return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_LONGLONG);
|
||||
}
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const;
|
||||
@ -5170,7 +5189,8 @@ class Type_handler_vers_trx_id: public Type_handler_longlong
|
||||
{
|
||||
public:
|
||||
virtual ~Type_handler_vers_trx_id() {}
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -5201,14 +5221,16 @@ public:
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const
|
||||
{ return 9; }
|
||||
uint32 calc_pack_length(uint32 length) const { return 3; }
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *mem_root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_INT24); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -5241,7 +5263,8 @@ public:
|
||||
{
|
||||
return Item_send_short(item, protocol, buf);
|
||||
}
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
void Column_definition_reuse_fix_attributes(THD *thd,
|
||||
@ -5251,7 +5274,8 @@ public:
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_YEAR); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -5296,7 +5320,8 @@ public:
|
||||
return print_item_value_csstr(thd, item, str);
|
||||
}
|
||||
void show_binlog_type(const Conv_source &src, String *str) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage1(THD *thd,
|
||||
@ -5312,7 +5337,8 @@ public:
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const;
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -5350,18 +5376,21 @@ public:
|
||||
return Item_send_float(item, protocol, buf);
|
||||
}
|
||||
Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy_real(c, MYSQL_TYPE_FLOAT); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const;
|
||||
@ -5404,18 +5433,21 @@ public:
|
||||
{
|
||||
return Item_send_double(item, protocol, buf);
|
||||
}
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy_real(c, MYSQL_TYPE_DOUBLE); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const;
|
||||
@ -5456,7 +5488,8 @@ public:
|
||||
{
|
||||
return MYSQL_TIMESTAMP_TIME;
|
||||
}
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const;
|
||||
@ -5536,13 +5569,15 @@ public:
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const
|
||||
{ return MIN_TIME_WIDTH; }
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_TIME); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -5564,13 +5599,15 @@ public:
|
||||
enum_field_types real_field_type() const { return MYSQL_TYPE_TIME2; }
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const;
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_TIME2); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -5635,7 +5672,8 @@ public:
|
||||
{
|
||||
return true;
|
||||
}
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const;
|
||||
@ -5668,13 +5706,15 @@ class Type_handler_date: public Type_handler_date_common
|
||||
public:
|
||||
virtual ~Type_handler_date() {}
|
||||
uint32 calc_pack_length(uint32 length) const { return 4; }
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_DATE); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -5694,13 +5734,15 @@ public:
|
||||
virtual ~Type_handler_newdate() {}
|
||||
enum_field_types real_field_type() const { return MYSQL_TYPE_NEWDATE; }
|
||||
uint32 calc_pack_length(uint32 length) const { return 3; }
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_NEWDATE); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -5739,7 +5781,8 @@ public:
|
||||
{
|
||||
return true;
|
||||
}
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const;
|
||||
@ -5790,13 +5833,15 @@ public:
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const
|
||||
{ return MAX_DATETIME_WIDTH; }
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_DATETIME); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -5818,13 +5863,15 @@ public:
|
||||
enum_field_types real_field_type() const { return MYSQL_TYPE_DATETIME2; }
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const;
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_DATETIME2); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -5928,13 +5975,15 @@ public:
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const
|
||||
{ return MAX_DATETIME_WIDTH; }
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_TIMESTAMP); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -5956,7 +6005,8 @@ public:
|
||||
enum_field_types real_field_type() const { return MYSQL_TYPE_TIMESTAMP2; }
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const;
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
@ -5964,7 +6014,8 @@ public:
|
||||
{
|
||||
return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_TIMESTAMP2);
|
||||
}
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -5990,14 +6041,16 @@ public:
|
||||
const Type_handler *type_handler_for_tmp_table(const Item *item) const;
|
||||
const Type_handler *type_handler_for_union(const Item *item) const;
|
||||
void show_binlog_type(const Conv_source &src, String *str) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy_num(c, MYSQL_TYPE_DECIMAL); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -6021,7 +6074,8 @@ public:
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const;
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
void show_binlog_type(const Conv_source &src, String *str) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage1(THD *thd,
|
||||
@ -6037,7 +6091,8 @@ public:
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const;
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -6072,7 +6127,8 @@ public:
|
||||
bool binary_cmp) const;
|
||||
bool Item_save_in_value(THD *thd, Item *item, st_value *value) const;
|
||||
bool Item_send(Item *item, Protocol *protocol, st_value *buf) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage1(THD *thd,
|
||||
@ -6089,7 +6145,8 @@ public:
|
||||
handler *file,
|
||||
ulonglong table_flags) const
|
||||
{ return Column_definition_prepare_stage2_legacy(c, MYSQL_TYPE_NULL); }
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -6128,7 +6185,8 @@ public:
|
||||
return varstring_type_handler(item);
|
||||
}
|
||||
void show_binlog_type(const Conv_source &src, String *str) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
@ -6136,7 +6194,8 @@ public:
|
||||
ulonglong table_flags) const;
|
||||
bool Key_part_spec_init_ft(Key_part_spec *part,
|
||||
const Column_definition &def) const;
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -6208,7 +6267,8 @@ public:
|
||||
}
|
||||
bool is_param_long_data_type() const { return true; }
|
||||
void show_binlog_type(const Conv_source &src, String *str) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
@ -6216,11 +6276,13 @@ public:
|
||||
ulonglong table_flags) const;
|
||||
bool Key_part_spec_init_ft(Key_part_spec *part,
|
||||
const Column_definition &def) const;
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const;
|
||||
@ -6255,7 +6317,8 @@ public:
|
||||
}
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const;
|
||||
void show_binlog_type(const Conv_source &src, String *str) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr) const
|
||||
{
|
||||
@ -6270,7 +6333,8 @@ class Type_handler_blob_common: public Type_handler_longstr
|
||||
public:
|
||||
virtual ~Type_handler_blob_common() { }
|
||||
virtual uint length_bytes() const= 0;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const override;
|
||||
const Type_handler *type_handler_for_tmp_table(const Item *item) const
|
||||
override
|
||||
@ -6318,7 +6382,8 @@ public:
|
||||
override;
|
||||
void Item_param_setup_conversion(THD *thd, Item_param *) const override;
|
||||
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const override;
|
||||
@ -6342,7 +6407,8 @@ public:
|
||||
enum_field_types field_type() const { return MYSQL_TYPE_TINY_BLOB; }
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const;
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -6360,7 +6426,8 @@ public:
|
||||
enum_field_types field_type() const { return MYSQL_TYPE_MEDIUM_BLOB; }
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const;
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -6380,7 +6447,8 @@ public:
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
Item *create_typecast_item(THD *thd, Item *item,
|
||||
const Type_cast_attributes &attr) const;
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -6398,7 +6466,8 @@ public:
|
||||
enum_field_types field_type() const { return MYSQL_TYPE_BLOB; }
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const;
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -6415,7 +6484,8 @@ public:
|
||||
}
|
||||
uint32 max_display_length_for_field(const Conv_source &src) const;
|
||||
void show_binlog_type(const Conv_source &src, String *str) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr) const
|
||||
{
|
||||
@ -6469,13 +6539,15 @@ public:
|
||||
return MYSQL_TYPE_ENUM;
|
||||
}
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const;
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
@ -6486,7 +6558,8 @@ public:
|
||||
const Bit_addr &bit,
|
||||
const Column_definition_attributes *attr,
|
||||
uint32 flags) const;
|
||||
Field *make_schema_field(TABLE *table,
|
||||
Field *make_schema_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
const Record_addr &addr,
|
||||
const ST_FIELD_INFO &def,
|
||||
bool show_field) const;
|
||||
@ -6505,13 +6578,15 @@ public:
|
||||
return MYSQL_TYPE_SET;
|
||||
}
|
||||
uint32 calc_pack_length(uint32 length) const;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const;
|
||||
bool Column_definition_fix_attributes(Column_definition *c) const;
|
||||
bool Column_definition_prepare_stage2(Column_definition *c,
|
||||
handler *file,
|
||||
ulonglong table_flags) const;
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const;
|
||||
|
@ -205,7 +205,8 @@ const Type_handler *Type_handler_geometry::type_handler_for_comparison() const
|
||||
}
|
||||
|
||||
|
||||
Field *Type_handler_geometry::make_conversion_table_field(TABLE *table,
|
||||
Field *Type_handler_geometry::make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table,
|
||||
uint metadata,
|
||||
const Field *target)
|
||||
const
|
||||
@ -218,7 +219,7 @@ Field *Type_handler_geometry::make_conversion_table_field(TABLE *table,
|
||||
The statistics was already incremented when "target" was created.
|
||||
*/
|
||||
const Field_geom *fg= static_cast<const Field_geom*>(target);
|
||||
return new(table->in_use->mem_root)
|
||||
return new (root)
|
||||
Field_geom(NULL, (uchar *) "", 1, Field::NONE, &empty_clex_str,
|
||||
table->s, 4, fg->type_handler_geom(), fg->srid);
|
||||
}
|
||||
@ -440,12 +441,13 @@ uint32 Type_handler_geometry::calc_pack_length(uint32 length) const
|
||||
}
|
||||
|
||||
|
||||
Field *Type_handler_geometry::make_table_field(const LEX_CSTRING *name,
|
||||
Field *Type_handler_geometry::make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const
|
||||
{
|
||||
return new (table->in_use->mem_root)
|
||||
return new (root)
|
||||
Field_geom(addr.ptr(), addr.null_ptr(), addr.null_bit(),
|
||||
Field::NONE, name, table->s, 4, this, 0);
|
||||
}
|
||||
@ -609,14 +611,14 @@ void Type_handler_geometry::Item_param_set_param_func(Item_param *param,
|
||||
|
||||
|
||||
Field *Type_handler_geometry::
|
||||
make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *mem_root,
|
||||
make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &rec, const Bit_addr &bit,
|
||||
const Column_definition_attributes *attr,
|
||||
uint32 flags) const
|
||||
{
|
||||
status_var_increment(current_thd->status_var.feature_gis);
|
||||
return new (mem_root)
|
||||
return new (root)
|
||||
Field_geom(rec.ptr(), rec.null_ptr(), rec.null_bit(),
|
||||
attr->unireg_check, name, share,
|
||||
attr->pack_flag_to_pack_length(), this, attr->srid);
|
||||
|
@ -73,7 +73,8 @@ public:
|
||||
Item_param *param,
|
||||
const Type_all_attributes *attr,
|
||||
const st_value *value) const override;
|
||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||
Field *make_conversion_table_field(MEM_ROOT *root,
|
||||
TABLE *table, uint metadata,
|
||||
const Field *target) const override;
|
||||
uint Column_definition_gis_options_image(uchar *buff,
|
||||
const Column_definition &def)
|
||||
@ -115,7 +116,8 @@ public:
|
||||
const handler *file) const override;
|
||||
bool Key_part_spec_init_spatial(Key_part_spec *part,
|
||||
const Column_definition &def) const override;
|
||||
Field *make_table_field(const LEX_CSTRING *name,
|
||||
Field *make_table_field(MEM_ROOT *root,
|
||||
const LEX_CSTRING *name,
|
||||
const Record_addr &addr,
|
||||
const Type_all_attributes &attr,
|
||||
TABLE *table) const override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user