From 98470fc800fb03cecc101b53e0f2d0bfe653cb7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Wed, 25 Oct 2017 22:04:17 +0300 Subject: 5.6.38 --- storage/perfschema/pfs.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'storage/perfschema/pfs.cc') diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index 18c58294b5c..b8848d108ff 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,6 +41,7 @@ #include "sp_head.h" #include "pfs_digest.h" +using std::min; /** @page PAGE_PERFORMANCE_SCHEMA The Performance Schema main page MySQL PERFORMANCE_SCHEMA implementation. @@ -2018,7 +2019,8 @@ static void set_thread_account_v1(const char *user, int user_len, DBUG_ASSERT((uint) user_len <= sizeof(pfs->m_username)); DBUG_ASSERT((host != NULL) || (host_len == 0)); DBUG_ASSERT(host_len >= 0); - DBUG_ASSERT((uint) host_len <= sizeof(pfs->m_hostname)); + + host_len= min(host_len, sizeof(pfs->m_hostname)); if (unlikely(pfs == NULL)) return; -- cgit v1.2.1