summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-07-17 17:56:17 +0300
committerMonty <monty@mariadb.org>2020-07-23 10:54:32 +0300
commit747479aba26dd5502565ec0ccf4c2f58dd70ee05 (patch)
tree1e66f2daff5a4b132cb43998dae26cf65c9c0504
parent61c15ebe323d4d6f02fab86c405b2613e5784961 (diff)
downloadmariadb-git-747479aba26dd5502565ec0ccf4c2f58dd70ee05.tar.gz
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.
-rw-r--r--sql/protocol.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 55373bcd2b5..5c287cff9e9 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -774,6 +774,7 @@ void Protocol::init(THD *thd_arg)
convert= &thd->convert_buffer;
#ifndef DBUG_OFF
field_handlers= 0;
+ field_pos= 0;
#endif
}
@@ -1217,8 +1218,8 @@ bool Protocol_text::store_str(const char *from, size_t length,
CHARSET_INFO *tocs)
{
#ifndef DBUG_OFF
- DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %.*b", field_pos,
- field_count, (int) length, (length == 0 ? "" : from)));
+ DBUG_PRINT("info", ("Protocol_text::store field %u : %.*b", field_pos,
+ (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++;