Commit 30e7a0a8 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-23157 Remove redundant virtual Protocol::store()

parent 5967dfdb
...@@ -1206,6 +1206,9 @@ bool Protocol_text::store(const char *from, size_t length, ...@@ -1206,6 +1206,9 @@ bool Protocol_text::store(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs) CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{ {
#ifndef DBUG_OFF #ifndef DBUG_OFF
DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %.*b", field_pos,
field_count, (int) length, (length == 0 ? "" : from)));
DBUG_ASSERT(field_handlers == 0 || field_pos < field_count);
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_STRING)); DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_STRING));
field_pos++; field_pos++;
#endif #endif
...@@ -1213,18 +1216,11 @@ bool Protocol_text::store(const char *from, size_t length, ...@@ -1213,18 +1216,11 @@ bool Protocol_text::store(const char *from, size_t length,
} }
bool Protocol_text::store(const char *from, size_t length, bool Protocol::store(const char *from, size_t length,
CHARSET_INFO *fromcs) CHARSET_INFO *fromcs)
{ {
CHARSET_INFO *tocs= this->thd->variables.character_set_results; CHARSET_INFO *tocs= this->thd->variables.character_set_results;
#ifndef DBUG_OFF return store(from, length, fromcs, tocs);
DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %.*b", field_pos,
field_count, (int) length, (length == 0 ? "" : from)));
DBUG_ASSERT(field_handlers == 0 || field_pos < field_count);
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_STRING));
field_pos++;
#endif
return store_string_aux(from, length, fromcs, tocs);
} }
...@@ -1455,14 +1451,6 @@ void Protocol_binary::prepare_for_resend() ...@@ -1455,14 +1451,6 @@ void Protocol_binary::prepare_for_resend()
} }
bool Protocol_binary::store(const char *from, size_t length,
CHARSET_INFO *fromcs)
{
CHARSET_INFO *tocs= thd->variables.character_set_results;
field_pos++;
return store_string_aux(from, length, fromcs, tocs);
}
bool Protocol_binary::store(const char *from, size_t length, bool Protocol_binary::store(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs) CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{ {
...@@ -1526,11 +1514,11 @@ bool Protocol_binary::store_decimal(const my_decimal *d) ...@@ -1526,11 +1514,11 @@ bool Protocol_binary::store_decimal(const my_decimal *d)
{ {
#ifndef DBUG_OFF #ifndef DBUG_OFF
DBUG_ASSERT(0); // This method is not used yet DBUG_ASSERT(0); // This method is not used yet
field_pos++;
#endif #endif
StringBuffer<DECIMAL_MAX_STR_LENGTH> str; StringBuffer<DECIMAL_MAX_STR_LENGTH> str;
(void) d->to_string(&str); (void) d->to_string(&str);
return store(str.ptr(), str.length(), str.charset()); return store(str.ptr(), str.length(), str.charset(),
thd->variables.character_set_results);
} }
bool Protocol_binary::store(float from, uint32 decimals, String *buffer) bool Protocol_binary::store(float from, uint32 decimals, String *buffer)
......
...@@ -120,7 +120,7 @@ class Protocol ...@@ -120,7 +120,7 @@ class Protocol
virtual bool store_long(longlong from)=0; virtual bool store_long(longlong from)=0;
virtual bool store_longlong(longlong from, bool unsigned_flag)=0; virtual bool store_longlong(longlong from, bool unsigned_flag)=0;
virtual bool store_decimal(const my_decimal *)=0; virtual bool store_decimal(const my_decimal *)=0;
virtual bool store(const char *from, size_t length, CHARSET_INFO *cs)=0; bool store(const char *from, size_t length, CHARSET_INFO *cs);
virtual bool store(const char *from, size_t length, virtual bool store(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)=0; CHARSET_INFO *fromcs, CHARSET_INFO *tocs)=0;
bool store_str(const LEX_CSTRING &s, CHARSET_INFO *fromcs, CHARSET_INFO *tocs) bool store_str(const LEX_CSTRING &s, CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
...@@ -178,7 +178,6 @@ class Protocol_text :public Protocol ...@@ -178,7 +178,6 @@ class Protocol_text :public Protocol
virtual bool store_long(longlong from); virtual bool store_long(longlong from);
virtual bool store_longlong(longlong from, bool unsigned_flag); virtual bool store_longlong(longlong from, bool unsigned_flag);
virtual bool store_decimal(const my_decimal *); virtual bool store_decimal(const my_decimal *);
virtual bool store(const char *from, size_t length, CHARSET_INFO *cs);
virtual bool store(const char *from, size_t length, virtual bool store(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs); CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
virtual bool store(MYSQL_TIME *time, int decimals); virtual bool store(MYSQL_TIME *time, int decimals);
...@@ -223,7 +222,6 @@ class Protocol_binary :public Protocol ...@@ -223,7 +222,6 @@ class Protocol_binary :public Protocol
virtual bool store_long(longlong from); virtual bool store_long(longlong from);
virtual bool store_longlong(longlong from, bool unsigned_flag); virtual bool store_longlong(longlong from, bool unsigned_flag);
virtual bool store_decimal(const my_decimal *); virtual bool store_decimal(const my_decimal *);
virtual bool store(const char *from, size_t length, CHARSET_INFO *cs);
virtual bool store(const char *from, size_t length, virtual bool store(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs); CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
virtual bool store(MYSQL_TIME *time, int decimals); virtual bool store(MYSQL_TIME *time, int decimals);
...@@ -272,7 +270,6 @@ class Protocol_discard : public Protocol_text ...@@ -272,7 +270,6 @@ class Protocol_discard : public Protocol_text
bool store_long(longlong) { return false; } bool store_long(longlong) { return false; }
bool store_longlong(longlong, bool) { return false; } bool store_longlong(longlong, bool) { return false; }
bool store_decimal(const my_decimal *) { return false; } bool store_decimal(const my_decimal *) { return false; }
bool store(const char *, size_t, CHARSET_INFO *) { return false; }
bool store(const char *, size_t, CHARSET_INFO *, CHARSET_INFO *) { return false; } bool store(const char *, size_t, CHARSET_INFO *, CHARSET_INFO *) { return false; }
bool store(MYSQL_TIME *, int) { return false; } bool store(MYSQL_TIME *, int) { return false; }
bool store_date(MYSQL_TIME *) { return false; } bool store_date(MYSQL_TIME *) { return 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