summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index ba1f770fea6..855a6842f1f 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -413,8 +413,8 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
thd->variables.character_set_results,
err, strlen(err),
system_charset_info, &error);
- length= (uint) (strmake((char*) pos, (char*)converted_err, MYSQL_ERRMSG_SIZE) -
- (char*) buff);
+ length= (uint) (strmake((char*) pos, (char*)converted_err,
+ MYSQL_ERRMSG_SIZE - 1) - (char*) buff);
err= (char*) buff;
DBUG_RETURN(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) err,
@@ -1012,8 +1012,8 @@ 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));
+ DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %*.s",
+ field_pos, field_count, (int) length, from));
DBUG_ASSERT(field_pos < field_count);
DBUG_ASSERT(field_types == 0 ||
field_types[field_pos] == MYSQL_TYPE_DECIMAL ||