Skip to content

Commit bd9a236

Browse files
committed
Merge branch 'merge-perfschema-5.6' into 10.0
2 parents 3b35d74 + 98470fc commit bd9a236

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

storage/perfschema/pfs.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -41,6 +41,7 @@
4141
#include "sp_head.h"
4242
#include "pfs_digest.h"
4343

44+
using std::min;
4445
/**
4546
@page PAGE_PERFORMANCE_SCHEMA The Performance Schema main page
4647
MySQL PERFORMANCE_SCHEMA implementation.
@@ -2018,7 +2019,8 @@ static void set_thread_account_v1(const char *user, int user_len,
20182019
DBUG_ASSERT((uint) user_len <= sizeof(pfs->m_username));
20192020
DBUG_ASSERT((host != NULL) || (host_len == 0));
20202021
DBUG_ASSERT(host_len >= 0);
2021-
DBUG_ASSERT((uint) host_len <= sizeof(pfs->m_hostname));
2022+
2023+
host_len= min<size_t>(host_len, sizeof(pfs->m_hostname));
20222024

20232025
if (unlikely(pfs == NULL))
20242026
return;

0 commit comments

Comments
 (0)