Commit 747479ab authored by Monty's avatar Monty

Fixed removed warning from valgrind in Protocol::store_str

The problem was that field_count is not initialized for the Protocol
variable used when printing metadata.
parent 61c15ebe
...@@ -774,6 +774,7 @@ void Protocol::init(THD *thd_arg) ...@@ -774,6 +774,7 @@ void Protocol::init(THD *thd_arg)
convert= &thd->convert_buffer; convert= &thd->convert_buffer;
#ifndef DBUG_OFF #ifndef DBUG_OFF
field_handlers= 0; field_handlers= 0;
field_pos= 0;
#endif #endif
} }
...@@ -1217,8 +1218,8 @@ bool Protocol_text::store_str(const char *from, size_t length, ...@@ -1217,8 +1218,8 @@ bool Protocol_text::store_str(const char *from, size_t length,
CHARSET_INFO *tocs) CHARSET_INFO *tocs)
{ {
#ifndef DBUG_OFF #ifndef DBUG_OFF
DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %.*b", field_pos, DBUG_PRINT("info", ("Protocol_text::store field %u : %.*b", field_pos,
field_count, (int) length, (length == 0 ? "" : from))); (int) length, (length == 0 ? "" : from)));
DBUG_ASSERT(field_handlers == 0 || field_pos < field_count); 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++;
......
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