summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAndrei Elkin <aelkin@mysql.com>2010-03-23 17:00:50 +0200
committerAndrei Elkin <aelkin@mysql.com>2010-03-23 17:00:50 +0200
commit307fb75e68e854d721c6dbf12d1a066743ace5a5 (patch)
treebb7e116e3a64ea181be6c9b1c7d3da3a62415d22 /sql
parenta4332c256edded6a6d2378ad3edca945ea57a77f (diff)
downloadmariadb-git-307fb75e68e854d721c6dbf12d1a066743ace5a5.tar.gz
Bug #52304 valgrind does not like to print un-inited string in Protocol_text::store()
The reason of the failure was apparent flaw in that a pointer to an uninitialized buffer was passed to DBUG_PRINT of Protocol_text::store(). Fixed with splitting the print-out into two branches: one with length zero of the problematic arg and the rest.
Diffstat (limited to 'sql')
-rw-r--r--sql/protocol.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index fad84f8be40..dc53e029647 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -850,7 +850,7 @@ bool Protocol_text::store(const char *from, size_t length,
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
#ifndef DBUG_OFF
DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %s", field_pos,
- field_count, from));
+ field_count, (length == 0? "" : from)));
DBUG_ASSERT(field_pos < field_count);
DBUG_ASSERT(field_types == 0 ||
field_types[field_pos] == MYSQL_TYPE_DECIMAL ||