summaryrefslogtreecommitdiff
path: root/storage/perfschema
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-10-27 10:24:02 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-10-27 10:24:02 +0300
commit786a722eba12418f646d4260dc9d6c4a1599f52f (patch)
treed72acb37e723635180cbdbd401bcdff4833f6578 /storage/perfschema
parent965c72d331013dc724c90a66cd18840e56729e1e (diff)
parent38e12db478fdea10531f198323c07a46c722d832 (diff)
downloadmariadb-git-786a722eba12418f646d4260dc9d6c4a1599f52f.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'storage/perfschema')
-rw-r--r--storage/perfschema/pfs.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc
index d51908bdd66..f781a83b324 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.
@@ -2020,7 +2021,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;