Skip to content

Commit

Permalink
cleanup: rename Protocol::store() to Protocol::store_datetime()
Browse files Browse the repository at this point in the history
to match the naming pattern of all other Protocol::store_xxx() methods
  • Loading branch information
vuvova committed Jun 11, 2021
1 parent 59b51e6 commit abc3889
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions sql/field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5459,7 +5459,7 @@ bool Field_timestamp0::send(Protocol *protocol)
{
MYSQL_TIME ltime;
Field_timestamp0::get_date(&ltime, date_mode_t(0));
return protocol->store(&ltime, 0);
return protocol->store_datetime(&ltime, 0);
}


Expand Down Expand Up @@ -5619,7 +5619,7 @@ bool Field_timestamp_with_dec::send(Protocol *protocol)
{
MYSQL_TIME ltime;
Field_timestamp::get_date(&ltime, date_mode_t(0));
return protocol->store(&ltime, dec);
return protocol->store_datetime(&ltime, dec);
}


Expand Down Expand Up @@ -6906,7 +6906,7 @@ bool Field_datetime0::send(Protocol *protocol)
{
MYSQL_TIME tm;
Field_datetime0::get_date(&tm, date_mode_t(0));
return protocol->store(&tm, 0);
return protocol->store_datetime(&tm, 0);
}


Expand Down Expand Up @@ -7034,7 +7034,7 @@ bool Field_datetime_with_dec::send(Protocol *protocol)
{
MYSQL_TIME ltime;
get_date(&ltime, date_mode_t(0));
return protocol->store(&ltime, dec);
return protocol->store_datetime(&ltime, dec);
}


Expand Down
6 changes: 3 additions & 3 deletions sql/protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@ bool Protocol_text::store(Field *field)
}


bool Protocol_text::store(MYSQL_TIME *tm, int decimals)
bool Protocol_text::store_datetime(MYSQL_TIME *tm, int decimals)
{
#ifndef DBUG_OFF
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_DATETIME));
Expand Down Expand Up @@ -1807,7 +1807,7 @@ bool Protocol_binary::store(Field *field)
}


bool Protocol_binary::store(MYSQL_TIME *tm, int decimals)
bool Protocol_binary::store_datetime(MYSQL_TIME *tm, int decimals)
{
char buff[12],*pos;
uint length;
Expand Down Expand Up @@ -1841,7 +1841,7 @@ bool Protocol_binary::store_date(MYSQL_TIME *tm)
{
tm->hour= tm->minute= tm->second=0;
tm->second_part= 0;
return Protocol_binary::store(tm, 0);
return Protocol_binary::store_datetime(tm, 0);
}


Expand Down
8 changes: 4 additions & 4 deletions sql/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class Protocol
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)=0;
virtual bool store_float(float from, uint32 decimals)=0;
virtual bool store_double(double from, uint32 decimals)=0;
virtual bool store(MYSQL_TIME *time, int decimals)=0;
virtual bool store_datetime(MYSQL_TIME *time, int decimals)=0;
virtual bool store_date(MYSQL_TIME *time)=0;
virtual bool store_time(MYSQL_TIME *time, int decimals)=0;
virtual bool store(Field *field)=0;
Expand Down Expand Up @@ -217,7 +217,7 @@ class Protocol_text :public Protocol
bool store_decimal(const my_decimal *) override;
bool store_str(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs) override;
bool store(MYSQL_TIME *time, int decimals) override;
bool store_datetime(MYSQL_TIME *time, int decimals) override;
bool store_date(MYSQL_TIME *time) override;
bool store_time(MYSQL_TIME *time, int decimals) override;
bool store_float(float nr, uint32 decimals) override;
Expand Down Expand Up @@ -265,7 +265,7 @@ class Protocol_binary final :public Protocol
bool store_decimal(const my_decimal *) override;
bool store_str(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs) override;
bool store(MYSQL_TIME *time, int decimals) override;
bool store_datetime(MYSQL_TIME *time, int decimals) override;
bool store_date(MYSQL_TIME *time) override;
bool store_time(MYSQL_TIME *time, int decimals) override;
bool store_float(float nr, uint32 decimals) override;
Expand Down Expand Up @@ -316,7 +316,7 @@ class Protocol_discard final : public Protocol
{
return false;
}
bool store(MYSQL_TIME *, int) override { return false; }
bool store_datetime(MYSQL_TIME *, int) override { return false; }
bool store_date(MYSQL_TIME *) override { return false; }
bool store_time(MYSQL_TIME *, int) override { return false; }
bool store_float(float, uint32) override { return false; }
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_show.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9840,7 +9840,7 @@ static bool show_create_trigger_impl(THD *thd, Trigger *trigger)
thd->variables.time_zone->gmt_sec_to_TIME(&timestamp,
(my_time_t)(trigger->create_time/100));
timestamp.second_part= (trigger->create_time % 100) * 10000;
p->store(&timestamp, 2);
p->store_datetime(&timestamp, 2);
}
else
p->store_null();
Expand Down
4 changes: 2 additions & 2 deletions sql/sql_type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7522,7 +7522,7 @@ bool Type_handler::Item_send_timestamp(Item *item,
if (native.is_null())
return protocol->store_null();
native.to_TIME(protocol->thd, &buf->value.m_time);
return protocol->store(&buf->value.m_time, item->decimals);
return protocol->store_datetime(&buf->value.m_time, item->decimals);
}


Expand All @@ -7532,7 +7532,7 @@ bool Type_handler::
item->get_date(protocol->thd, &buf->value.m_time,
Datetime::Options(protocol->thd));
if (!item->null_value)
return protocol->store(&buf->value.m_time, item->decimals);
return protocol->store_datetime(&buf->value.m_time, item->decimals);
return protocol->store_null();
}

Expand Down

0 comments on commit abc3889

Please sign in to comment.