Commit 39fb9472 authored by Alexander Barkov's avatar Alexander Barkov

Changing the parameter of Field::eq_def() from "Field *" to "const Field *"

parent 0f94f94b
......@@ -8863,7 +8863,7 @@ void Field_set::sql_type(String &res) const
0 if the fields are unequally defined
*/
bool Field::eq_def(Field *field)
bool Field::eq_def(const Field *field)
{
if (real_type() != field->real_type() || charset() != field->charset() ||
pack_length() != field->pack_length())
......@@ -8895,7 +8895,7 @@ static bool compare_type_names(CHARSET_INFO *charset, TYPELIB *t1, TYPELIB *t2)
returns 1 if the fields are equally defined
*/
bool Field_enum::eq_def(Field *field)
bool Field_enum::eq_def(const Field *field)
{
TYPELIB *values;
......@@ -8972,7 +8972,7 @@ const uchar *Field_enum::unpack(uchar *to, const uchar *from,
@return
returns 1 if the fields are equally defined
*/
bool Field_num::eq_def(Field *field)
bool Field_num::eq_def(const Field *field)
{
if (!Field::eq_def(field))
return 0;
......
......@@ -775,7 +775,7 @@ class Field: public Value_source
return (ptr == field->ptr && null_ptr == field->null_ptr &&
null_bit == field->null_bit && field->type() == type());
}
virtual bool eq_def(Field *field);
virtual bool eq_def(const Field *field);
/*
pack_length() returns size (in bytes) used to store field data in memory
......@@ -1501,7 +1501,7 @@ class Field_num :public Field {
void make_field(Send_field *);
uint decimals() const { return (uint) dec; }
uint size_of() const { return sizeof(*this); }
bool eq_def(Field *field);
bool eq_def(const Field *field);
int store_decimal(const my_decimal *);
my_decimal *val_decimal(my_decimal *);
bool val_bool() { return val_int() != 0; }
......@@ -2097,7 +2097,7 @@ class Field_temporal: public Field {
enum Item_result cmp_type () const { return TIME_RESULT; }
bool val_bool() { return val_real() != 0e0; }
uint is_equal(Create_field *new_field);
bool eq_def(Field *field)
bool eq_def(const Field *field)
{
return (Field::eq_def(field) && decimals() == field->decimals());
}
......@@ -3211,7 +3211,7 @@ class Field_enum :public Field_str {
uint row_pack_length() const { return pack_length(); }
virtual bool zero_pack() const { return 0; }
bool optimize_range(uint idx, uint part) { return 0; }
bool eq_def(Field *field);
bool eq_def(const Field *field);
bool has_charset(void) const { return TRUE; }
/* enum and set are sorted as integers */
CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; }
......
......@@ -5062,7 +5062,7 @@ class Item_cache: public Item_basic_constant,
static Item_cache* get_cache(THD *thd, const Item* item, const Item_result type);
virtual void keep_array() {}
virtual void print(String *str, enum_query_type query_type);
bool eq_def(Field *field)
bool eq_def(const Field *field)
{
return cached_field ? cached_field->eq_def (field) : FALSE;
}
......
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