Commit 2ecf2f9b authored by Alexander Barkov's avatar Alexander Barkov

Adding "const" qualifier to the MYSQL_TIME* argument of Field::store_time_dec()

parent 705283f7
......@@ -2196,7 +2196,7 @@ bool Field::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
Needs to be changed if/when we want to support different time formats.
*/
int Field::store_time_dec(MYSQL_TIME *ltime, uint dec)
int Field::store_time_dec(const MYSQL_TIME *ltime, uint dec)
{
ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
char buff[MAX_DATE_STRING_REP_LENGTH];
......@@ -3241,7 +3241,7 @@ int Field_new_decimal::store_decimal(const my_decimal *decimal_value)
}
int Field_new_decimal::store_time_dec(MYSQL_TIME *ltime, uint dec_arg)
int Field_new_decimal::store_time_dec(const MYSQL_TIME *ltime, uint dec_arg)
{
my_decimal decimal_value;
return store_value(date2my_decimal(ltime, &decimal_value));
......@@ -3480,7 +3480,7 @@ Item *Field_new_decimal::get_equal_const_item(THD *thd, const Context &ctx,
}
int Field_num::store_time_dec(MYSQL_TIME *ltime, uint dec_arg)
int Field_num::store_time_dec(const MYSQL_TIME *ltime, uint dec_arg)
{
longlong v= TIME_to_ulonglong(ltime);
if (ltime->neg == 0)
......@@ -4734,7 +4734,7 @@ int Field_real::store_decimal(const my_decimal *dm)
return store(dbl);
}
int Field_real::store_time_dec(MYSQL_TIME *ltime, uint dec_arg)
int Field_real::store_time_dec(const MYSQL_TIME *ltime, uint dec_arg)
{
return store(TIME_to_double(ltime));
}
......@@ -5016,7 +5016,7 @@ copy_or_convert_to_datetime(THD *thd, const MYSQL_TIME *from, MYSQL_TIME *to)
}
int Field_timestamp::store_time_dec(MYSQL_TIME *ltime, uint dec)
int Field_timestamp::store_time_dec(const MYSQL_TIME *ltime, uint dec)
{
int unused;
ErrConvTime str(ltime);
......@@ -5582,7 +5582,7 @@ int Field_temporal_with_date::store(longlong nr, bool unsigned_val)
}
int Field_temporal_with_date::store_time_dec(MYSQL_TIME *ltime, uint dec)
int Field_temporal_with_date::store_time_dec(const MYSQL_TIME *ltime, uint dec)
{
int error= 0, have_smth_to_conv= 1;
ErrConvTime str(ltime);
......@@ -5774,7 +5774,7 @@ static void calc_datetime_days_diff(MYSQL_TIME *ltime, long days)
}
int Field_time::store_time_dec(MYSQL_TIME *ltime, uint dec)
int Field_time::store_time_dec(const MYSQL_TIME *ltime, uint dec)
{
MYSQL_TIME l_time= *ltime;
ErrConvTime str(ltime);
......@@ -6234,7 +6234,7 @@ int Field_year::store(longlong nr, bool unsigned_val)
}
int Field_year::store_time_dec(MYSQL_TIME *ltime, uint dec_arg)
int Field_year::store_time_dec(const MYSQL_TIME *ltime, uint dec_arg)
{
ErrConvTime str(ltime);
if (Field_year::store(ltime->year, 0))
......
......@@ -815,9 +815,9 @@ class Field: public Value_source
virtual int store(double nr)=0;
virtual int store(longlong nr, bool unsigned_val)=0;
virtual int store_decimal(const my_decimal *d)=0;
virtual int store_time_dec(MYSQL_TIME *ltime, uint dec);
virtual int store_time_dec(const MYSQL_TIME *ltime, uint dec);
virtual int store_timestamp(my_time_t timestamp, ulong sec_part);
int store_time(MYSQL_TIME *ltime)
int store_time(const MYSQL_TIME *ltime)
{ return store_time_dec(ltime, TIME_SECOND_PART_DIGITS); }
int store(const char *to, uint length, CHARSET_INFO *cs,
enum_check_fields check_level);
......@@ -1673,7 +1673,7 @@ class Field_num :public Field {
field_metadata, length));
return length;
}
int store_time_dec(MYSQL_TIME *ltime, uint dec);
int store_time_dec(const MYSQL_TIME *ltime, uint dec);
double pos_in_interval(Field *min, Field *max)
{
return pos_in_interval_val_real(min, max);
......@@ -1813,7 +1813,7 @@ class Field_real :public Field_num {
field_length >= from->field_length;
}
int store_decimal(const my_decimal *);
int store_time_dec(MYSQL_TIME *ltime, uint dec);
int store_time_dec(const MYSQL_TIME *ltime, uint dec);
bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
my_decimal *val_decimal(my_decimal *);
bool val_bool() { return val_real() != 0e0; }
......@@ -1903,7 +1903,7 @@ class Field_new_decimal :public Field_num {
int store(const char *to, uint length, CHARSET_INFO *charset);
int store(double nr);
int store(longlong nr, bool unsigned_val);
int store_time_dec(MYSQL_TIME *ltime, uint dec);
int store_time_dec(const MYSQL_TIME *ltime, uint dec);
int store_decimal(const my_decimal *);
double val_real(void);
longlong val_int(void);
......@@ -2382,7 +2382,7 @@ class Field_temporal_with_date: public Field_temporal {
int store(const char *to, uint length, CHARSET_INFO *charset);
int store(double nr);
int store(longlong nr, bool unsigned_val);
int store_time_dec(MYSQL_TIME *ltime, uint dec);
int store_time_dec(const MYSQL_TIME *ltime, uint dec);
int store_decimal(const my_decimal *);
bool validate_value_in_record(THD *thd, const uchar *record) const;
};
......@@ -2404,7 +2404,7 @@ class Field_timestamp :public Field_temporal {
int store(const char *to,uint length,CHARSET_INFO *charset);
int store(double nr);
int store(longlong nr, bool unsigned_val);
int store_time_dec(MYSQL_TIME *ltime, uint dec);
int store_time_dec(const MYSQL_TIME *ltime, uint dec);
int store_decimal(const my_decimal *);
int store_timestamp(my_time_t timestamp, ulong sec_part);
int save_in_field(Field *to);
......@@ -2601,7 +2601,7 @@ class Field_year :public Field_tiny {
int store(const char *to,uint length,CHARSET_INFO *charset);
int store(double nr);
int store(longlong nr, bool unsigned_val);
int store_time_dec(MYSQL_TIME *ltime, uint dec);
int store_time_dec(const MYSQL_TIME *ltime, uint dec);
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
......@@ -2711,7 +2711,7 @@ class Field_time :public Field_temporal {
return real_type() == from->real_type() &&
decimals() == from->decimals();
}
int store_time_dec(MYSQL_TIME *ltime, uint dec);
int store_time_dec(const MYSQL_TIME *ltime, uint dec);
int store(const char *to,uint length,CHARSET_INFO *charset);
int store(double nr);
int store(longlong nr, bool unsigned_val);
......
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