diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-10-25 22:04:17 +0300 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-10-25 22:04:17 +0300 |
commit | 98470fc800fb03cecc101b53e0f2d0bfe653cb7a (patch) | |
tree | 98c33009dfd3e7ddeeed13b462e9e3d87c1e4cf5 /storage/perfschema | |
parent | e1b5e986485a2e7660468fd3fab80d0085ecba62 (diff) | |
download | mariadb-git-98470fc800fb03cecc101b53e0f2d0bfe653cb7a.tar.gz |
5.6.38
Diffstat (limited to 'storage/perfschema')
-rw-r--r-- | storage/perfschema/pfs.cc | 6 |
1 files changed, 4 insertions, 2 deletions
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<size_t>(host_len, sizeof(pfs->m_hostname)); if (unlikely(pfs == NULL)) return; |