1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-11 15:22:09 +03:00

Next part of merge. See TODO for details

This commit is contained in:
Michael Widenius
2012-08-14 17:23:34 +03:00
parent b39e6e3d09
commit 60589aeee0
701 changed files with 138276 additions and 2292 deletions

17
TODO
View File

@ -4,10 +4,17 @@ Featured copied/merged
- storage/innodb/* - storage/innodb/*
- storage/perfschema - storage/perfschema
- sql/share/errmsg-utf8.txt - sql/share/errmsg-utf8.txt
- mysqltest/suite/perfschema
- All CF_XXX states in sql_class.h. - All CF_XXX states in sql_class.h.
- handler error messages. - handler error messages.
- Removed timestamp handling from all handler::write and handler::update - Removed timestamp handling from all handler::write and handler::update
methods. methods.
- Added PSI_CALLS to handler.cc
- Added thd->m_statement_psi
- Added variables Sys_ssl_crl & Sys_ssl_crlpath
(Including support in all clients)
- Added Ssl_server_not_before & Ssl_server_not_after variables
(Including changes to yassl)
Features recoded Features recoded
- Better error messages - Better error messages
@ -16,6 +23,7 @@ Features recoded
Fetures half done: Fetures half done:
- Support for TRANSACTION READ ONLY | READ WRITE - Support for TRANSACTION READ ONLY | READ WRITE
- CF_XXX states added to init_update_queries() but not otherwise used. - CF_XXX states added to init_update_queries() but not otherwise used.
- Merge sql/rpl_mi.cc (To get Sys_ssl_crl ? crlpath)
Short time TODO: Short time TODO:
- Add support for TRANSACTION READ ONLY | READ WRITE in sql_yacc.yy - Add support for TRANSACTION READ ONLY | READ WRITE in sql_yacc.yy
@ -27,3 +35,12 @@ Short time TODO:
- Enable performance_schema.host_cache in scripts/mysql_system_tables.sql - Enable performance_schema.host_cache in scripts/mysql_system_tables.sql
- Add full support for timestamp. (remove timestamp handling from ha_write()) - Add full support for timestamp. (remove timestamp handling from ha_write())
- Add Sys_my_bind_addr(); Needed for perfschema
- Add THD_STAGE_INFO everywhere.
- mysql_socket_shutdown() was removed from vio/viosocket.cc.
It was replaced with inline function in include/mysql/psi/mysql_socket.h
but this doesn't call DisconnectEx(). We should check if we need to
add this to the inline function...

View File

@ -91,6 +91,7 @@ enum options_client
OPT_REWRITE_DB, OPT_REWRITE_DB,
OPT_REPORT_PROGRESS, OPT_REPORT_PROGRESS,
OPT_SKIP_ANNOTATE_ROWS_EVENTS, OPT_SKIP_ANNOTATE_ROWS_EVENTS,
OPT_SSL_CRL, OPT_SSL_CRLPATH,
OPT_MAX_CLIENT_OPTION /* should be always the last */ OPT_MAX_CLIENT_OPTION /* should be always the last */
}; };

View File

@ -4402,8 +4402,12 @@ sql_real_connect(char *host,char *database,char *user,char *password,
mysql_options(&mysql,MYSQL_OPT_LOCAL_INFILE, (char*) &opt_local_infile); mysql_options(&mysql,MYSQL_OPT_LOCAL_INFILE, (char*) &opt_local_infile);
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (opt_use_ssl) if (opt_use_ssl)
{
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher); opt_ssl_capath, opt_ssl_cipher);
mysql_options(&mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(&mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
}
mysql_options(&mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT, mysql_options(&mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert); (char*)&opt_ssl_verify_server_cert);
#endif #endif

View File

@ -341,8 +341,12 @@ int main(int argc,char *argv[])
} }
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
if (opt_use_ssl) if (opt_use_ssl)
{
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher); opt_ssl_capath, opt_ssl_cipher);
mysql_options(&mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(&mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
}
mysql_options(&mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT, mysql_options(&mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert); (char*)&opt_ssl_verify_server_cert);
#endif #endif

View File

@ -908,8 +908,12 @@ static int dbConnect(char *host, char *user, char *passwd)
mysql_options(&mysql_connection, MYSQL_OPT_COMPRESS, NullS); mysql_options(&mysql_connection, MYSQL_OPT_COMPRESS, NullS);
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
if (opt_use_ssl) if (opt_use_ssl)
{
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher); opt_ssl_capath, opt_ssl_cipher);
mysql_options(&mysql_connection, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(&mysql_connection, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
}
#endif #endif
if (opt_protocol) if (opt_protocol)
mysql_options(&mysql_connection,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol); mysql_options(&mysql_connection,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);

View File

@ -1528,8 +1528,12 @@ static int connect_to_db(char *host, char *user,char *passwd)
mysql_options(&mysql_connection,MYSQL_OPT_COMPRESS,NullS); mysql_options(&mysql_connection,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
if (opt_use_ssl) if (opt_use_ssl)
{
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher); opt_ssl_capath, opt_ssl_cipher);
mysql_options(&mysql_connection, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(&mysql_connection, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
}
mysql_options(&mysql_connection,MYSQL_OPT_SSL_VERIFY_SERVER_CERT, mysql_options(&mysql_connection,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert); (char*)&opt_ssl_verify_server_cert);
#endif #endif

View File

@ -432,8 +432,12 @@ static MYSQL *db_connect(char *host, char *database,
(char*) &opt_local_file); (char*) &opt_local_file);
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
if (opt_use_ssl) if (opt_use_ssl)
{
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher); opt_ssl_capath, opt_ssl_cipher);
mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
}
mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT, mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert); (char*)&opt_ssl_verify_server_cert);
#endif #endif

View File

@ -116,8 +116,12 @@ int main(int argc, char **argv)
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS); mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
if (opt_use_ssl) if (opt_use_ssl)
{
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher); opt_ssl_capath, opt_ssl_cipher);
mysql_options(&mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(&mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
}
mysql_options(&mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT, mysql_options(&mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert); (char*)&opt_ssl_verify_server_cert);
#endif #endif

View File

@ -66,7 +66,7 @@ TODO:
*/ */
#define SLAP_VERSION "1.0" #define SLAP_VERSION "1.1"
#define HUGE_STRING_LENGTH 8196 #define HUGE_STRING_LENGTH 8196
#define RAND_STRING_SIZE 126 #define RAND_STRING_SIZE 126
@ -299,8 +299,12 @@ void set_mysql_connect_options(MYSQL *mysql)
mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS); mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
if (opt_use_ssl) if (opt_use_ssl)
{
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher); opt_ssl_capath, opt_ssl_cipher);
mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
}
#endif #endif
if (opt_protocol) if (opt_protocol)
mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol); mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);

View File

@ -5920,6 +5920,8 @@ void do_connect(struct st_command *command)
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
mysql_ssl_set(con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, mysql_ssl_set(con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher); opt_ssl_capath, opt_ssl_cipher);
mysql_options(con_slot->mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(con_slot->mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
#if MYSQL_VERSION_ID >= 50000 #if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */ /* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost"); opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost");
@ -8954,6 +8956,8 @@ int main(int argc, char **argv)
{ {
mysql_ssl_set(con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, mysql_ssl_set(con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher); opt_ssl_capath, opt_ssl_cipher);
mysql_options(con->mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(con->mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
#if MYSQL_VERSION_ID >= 50000 #if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */ /* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= opt_host && !strcmp(opt_host, "localhost"); opt_ssl_verify_server_cert= opt_host && !strcmp(opt_host, "localhost");

View File

@ -79,6 +79,7 @@ class CertManager {
CertList peerList_; // peer CertList peerList_; // peer
input_buffer peerPublicKey_; input_buffer peerPublicKey_;
X509* peerX509_; // peer's openSSL X509 X509* peerX509_; // peer's openSSL X509
X509* selfX509_; // our own openSSL X509
SignatureAlgorithm keyType_; // self key type SignatureAlgorithm keyType_; // self key type
SignatureAlgorithm peerKeyType_; // peer's key type SignatureAlgorithm peerKeyType_; // peer's key type
@ -105,6 +106,7 @@ public:
const opaque* get_peerKey() const; const opaque* get_peerKey() const;
const opaque* get_privateKey() const; const opaque* get_privateKey() const;
X509* get_peerX509() const; X509* get_peerX509() const;
X509* get_selfX509() const;
SignatureAlgorithm get_keyType() const; SignatureAlgorithm get_keyType() const;
SignatureAlgorithm get_peerKeyType() const; SignatureAlgorithm get_peerKeyType() const;

View File

@ -179,6 +179,7 @@
#define SSL_get1_session yaSSL_get1_session #define SSL_get1_session yaSSL_get1_session
#define X509_get_notBefore yaX509_get_notBefore #define X509_get_notBefore yaX509_get_notBefore
#define X509_get_notAfter yaX509_get_notAfter #define X509_get_notAfter yaX509_get_notAfter
#define yaSSL_ASN1_TIME_to_string ya_SSL_ASN1_TIME_to_string
#define MD4_Init yaMD4_Init #define MD4_Init yaMD4_Init
#define MD4_Update yaMD4_Update #define MD4_Update yaMD4_Update
#define MD4_Final yaMD4_Final #define MD4_Final yaMD4_Final

View File

@ -1,6 +1,5 @@
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2005, 2011, Oracle and/or its affiliates.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -539,11 +538,23 @@ void MD5_Final(unsigned char*, MD5_CTX*);
#define SSL_DEFAULT_CIPHER_LIST "" /* default all */ #define SSL_DEFAULT_CIPHER_LIST "" /* default all */
/* yaSSL adds */ /* yaSSL extensions */
int SSL_set_compression(SSL*); /* turn on yaSSL zlib compression */ int SSL_set_compression(SSL*); /* turn on yaSSL zlib compression */
char *yaSSL_ASN1_TIME_to_string(ASN1_TIME *time, char *buf, size_t len);
#include "transport_types.h"
/*
Set functions for yaSSL to use in order to send and receive data.
These hooks are offered in order to enable non-blocking I/O. If
not set, yaSSL defaults to using send() and recv().
@todo Remove hooks and accompanying code when yaSSL is fixed.
*/
void yaSSL_transport_set_ptr(SSL *, void *);
void yaSSL_transport_set_recv_function(SSL *, yaSSL_recv_func_t);
void yaSSL_transport_set_send_function(SSL *, yaSSL_send_func_t);
#if defined(__cplusplus) && !defined(YASSL_MYSQL_COMPATIBLE) #if defined(__cplusplus) && !defined(YASSL_MYSQL_COMPATIBLE)
} /* namespace */ } /* namespace */

View File

@ -0,0 +1,26 @@
/*
Copyright (c) 2011, 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
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA.
*/
#ifndef yaSSL_transport_types_h__
#define yaSSL_transport_types_h__
/* Type of transport functions used for sending and receiving data. */
typedef long (*yaSSL_recv_func_t) (void *, void *, size_t, int);
typedef long (*yaSSL_send_func_t) (void *, const void *, size_t, int);
#endif

View File

@ -1,5 +1,5 @@
/* /*
Copyright (C) 2000-2007 MySQL AB Copyright (c) 2005, 2011, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -54,7 +54,9 @@ typedef unsigned int uint;
const int SOCKET_ERROR = -1; const int SOCKET_ERROR = -1;
#endif #endif
extern "C" {
#include "openssl/transport_types.h"
}
typedef unsigned char byte; typedef unsigned char byte;
@ -64,6 +66,9 @@ class Socket {
socket_t socket_; // underlying socket descriptor socket_t socket_; // underlying socket descriptor
bool wouldBlock_; // if non-blocking data, for last read bool wouldBlock_; // if non-blocking data, for last read
bool nonBlocking_; // is option set bool nonBlocking_; // is option set
void *ptr_; // Argument to transport function
yaSSL_send_func_t send_func_; // Function to send data
yaSSL_recv_func_t recv_func_; // Function to receive data
public: public:
explicit Socket(socket_t s = INVALID_SOCKET); explicit Socket(socket_t s = INVALID_SOCKET);
~Socket(); ~Socket();
@ -72,11 +77,15 @@ public:
uint get_ready() const; uint get_ready() const;
socket_t get_fd() const; socket_t get_fd() const;
void set_transport_ptr(void *ptr);
void set_transport_recv_function(yaSSL_recv_func_t recv_func);
void set_transport_send_function(yaSSL_send_func_t send_func);
uint send(const byte* buf, unsigned int len, unsigned int& sent, uint send(const byte* buf, unsigned int len, unsigned int& sent,
int flags = 0); int flags = 0);
uint receive(byte* buf, unsigned int len, int flags = 0); uint receive(byte* buf, unsigned int len, int flags = 0);
bool wait(); bool wait();
bool WouldBlock() const; bool WouldBlock() const;
bool IsNonBlocking() const; bool IsNonBlocking() const;

View File

@ -187,7 +187,7 @@ private:
class StringHolder { class StringHolder {
ASN1_STRING asnString_; ASN1_STRING asnString_;
public: public:
StringHolder(const char* str, int sz); StringHolder(const char* str, int sz, byte type= 0);
~StringHolder(); ~StringHolder();
ASN1_STRING* GetString(); ASN1_STRING* GetString();
@ -205,7 +205,7 @@ class X509 {
StringHolder afterDate_; // not valid after StringHolder afterDate_; // not valid after
public: public:
X509(const char* i, size_t, const char* s, size_t, X509(const char* i, size_t, const char* s, size_t,
const char* b, int, const char* a, int); ASN1_STRING *b, ASN1_STRING *a);
~X509() {} ~X509() {}
X509_NAME* GetIssuer(); X509_NAME* GetIssuer();

View File

@ -91,7 +91,7 @@ opaque* x509::use_buffer()
//CertManager //CertManager
CertManager::CertManager() CertManager::CertManager()
: peerX509_(0), verifyPeer_(false), verifyNone_(false), failNoCert_(false), : peerX509_(0), selfX509_(0), verifyPeer_(false), verifyNone_(false), failNoCert_(false),
sendVerify_(false), verifyCallback_(0) sendVerify_(false), verifyCallback_(0)
{} {}
@ -99,6 +99,7 @@ CertManager::CertManager()
CertManager::~CertManager() CertManager::~CertManager()
{ {
ysDelete(peerX509_); ysDelete(peerX509_);
ysDelete(selfX509_);
STL::for_each(signers_.begin(), signers_.end(), del_ptr_zero()) ; STL::for_each(signers_.begin(), signers_.end(), del_ptr_zero()) ;
@ -210,6 +211,12 @@ X509* CertManager::get_peerX509() const
} }
X509* CertManager::get_selfX509() const
{
return selfX509_;
}
SignatureAlgorithm CertManager::get_peerKeyType() const SignatureAlgorithm CertManager::get_peerKeyType() const
{ {
return peerKeyType_; return peerKeyType_;
@ -281,11 +288,15 @@ int CertManager::Validate()
size_t iSz = strlen(cert.GetIssuer()) + 1; size_t iSz = strlen(cert.GetIssuer()) + 1;
size_t sSz = strlen(cert.GetCommonName()) + 1; size_t sSz = strlen(cert.GetCommonName()) + 1;
int bSz = (int)strlen(cert.GetBeforeDate()) + 1; ASN1_STRING beforeDate, afterDate;
int aSz = (int)strlen(cert.GetAfterDate()) + 1; beforeDate.data= (unsigned char *) cert.GetBeforeDate();
beforeDate.type= cert.GetBeforeDateType();
beforeDate.length= strlen((char *) beforeDate.data) + 1;
afterDate.data= (unsigned char *) cert.GetAfterDate();
afterDate.type= cert.GetAfterDateType();
afterDate.length= strlen((char *) afterDate.data) + 1;
peerX509_ = NEW_YS X509(cert.GetIssuer(), iSz, cert.GetCommonName(), peerX509_ = NEW_YS X509(cert.GetIssuer(), iSz, cert.GetCommonName(),
sSz, cert.GetBeforeDate(), bSz, sSz, &beforeDate, &afterDate);
cert.GetAfterDate(), aSz);
if (err == TaoCrypt::SIG_OTHER_E && verifyCallback_) { if (err == TaoCrypt::SIG_OTHER_E && verifyCallback_) {
X509_STORE_CTX store; X509_STORE_CTX store;
@ -320,6 +331,18 @@ int CertManager::SetPrivateKey(const x509& key)
keyType_ = rsa_sa_algo; keyType_ = rsa_sa_algo;
else else
keyType_ = dsa_sa_algo; keyType_ = dsa_sa_algo;
size_t iSz = strlen(cd.GetIssuer()) + 1;
size_t sSz = strlen(cd.GetCommonName()) + 1;
ASN1_STRING beforeDate, afterDate;
beforeDate.data= (unsigned char *) cd.GetBeforeDate();
beforeDate.type= cd.GetBeforeDateType();
beforeDate.length= strlen((char *) beforeDate.data) + 1;
afterDate.data= (unsigned char *) cd.GetAfterDate();
afterDate.type= cd.GetAfterDateType();
afterDate.length= strlen((char *) afterDate.data) + 1;
selfX509_ = NEW_YS X509(cd.GetIssuer(), iSz, cd.GetCommonName(),
sSz, &beforeDate, &afterDate);
} }
return 0; return 0;
} }
@ -336,8 +359,7 @@ void CertManager::setPeerX509(X509* x)
ASN1_STRING* after = x->GetAfter(); ASN1_STRING* after = x->GetAfter();
peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(), peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(),
subject->GetName(), subject->GetLength(), (const char*) before->data, subject->GetName(), subject->GetLength(), before, after);
before->length, (const char*) after->data, after->length);
} }

View File

@ -1,6 +1,5 @@
/* /*
Copyright (c) 2005-2008 MySQL AB, 2009 Sun Microsystems, Inc. Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -712,7 +711,8 @@ int DoProcessReply(SSL& ssl)
return 0; return 0;
} }
uint ready = ssl.getSocket().get_ready(); uint ready = ssl.getSocket().get_ready();
if (!ready) return 1; if (!ready)
ready= 64;
// add buffered data if its there // add buffered data if its there
input_buffer* buffered = ssl.useBuffers().TakeRawInput(); input_buffer* buffered = ssl.useBuffers().TakeRawInput();

View File

@ -1,5 +1,5 @@
/* /*
Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -52,11 +52,33 @@
#endif // _WIN32 #endif // _WIN32
namespace {
extern "C" long system_recv(void *ptr, void *buf, size_t count, int flags)
{
yaSSL::socket_t *socket = (yaSSL::socket_t *) ptr;
return ::recv(*socket, reinterpret_cast<char *>(buf), count, flags);
}
extern "C" long system_send(void *ptr, const void *buf, size_t count,
int flags)
{
yaSSL::socket_t *socket = (yaSSL::socket_t *) ptr;
return ::send(*socket, reinterpret_cast<const char *>(buf), count, flags);
}
}
namespace yaSSL { namespace yaSSL {
Socket::Socket(socket_t s) Socket::Socket(socket_t s)
: socket_(s), wouldBlock_(false), nonBlocking_(false) : socket_(s), wouldBlock_(false), nonBlocking_(false),
ptr_(&socket_), send_func_(system_send), recv_func_(system_recv)
{} {}
@ -108,8 +130,25 @@ uint Socket::get_ready() const
return ready; return ready;
} }
void Socket::set_transport_ptr(void *ptr)
{
ptr_ = ptr;
}
uint Socket::send(const byte* buf, unsigned int sz, unsigned int& written,
void Socket::set_transport_recv_function(yaSSL_recv_func_t recv_func)
{
recv_func_ = recv_func;
}
void Socket::set_transport_send_function(yaSSL_send_func_t send_func)
{
send_func_ = send_func;
}
uint Socket::send(const byte* buf, unsigned int sz, unsigned int &written,
int flags) int flags)
{ {
const byte* pos = buf; const byte* pos = buf;
@ -117,12 +156,14 @@ uint Socket::send(const byte* buf, unsigned int sz, unsigned int& written,
wouldBlock_ = false; wouldBlock_ = false;
while (pos != end) { while (pos != end)
int sent = ::send(socket_, reinterpret_cast<const char *>(pos), {
static_cast<int>(end - pos), flags); int sent = send_func_(ptr_, pos, static_cast<int>(end - pos), flags);
if (sent == -1) { if (sent == -1)
{
if (get_lastError() == SOCKET_EWOULDBLOCK || if (get_lastError() == SOCKET_EWOULDBLOCK ||
get_lastError() == SOCKET_EAGAIN) { get_lastError() == SOCKET_EAGAIN)
{
wouldBlock_ = true; // would have blocked this time only wouldBlock_ = true; // would have blocked this time only
nonBlocking_ = true; // nonblocking, win32 only way to tell nonBlocking_ = true; // nonblocking, win32 only way to tell
return 0; return 0;
@ -132,7 +173,6 @@ uint Socket::send(const byte* buf, unsigned int sz, unsigned int& written,
pos += sent; pos += sent;
written += sent; written += sent;
} }
return sz; return sz;
} }
@ -141,7 +181,7 @@ uint Socket::receive(byte* buf, unsigned int sz, int flags)
{ {
wouldBlock_ = false; wouldBlock_ = false;
int recvd = ::recv(socket_, reinterpret_cast<char *>(buf), sz, flags); int recvd = recv_func_(ptr_, buf, sz, flags);
// idea to seperate error from would block by arnetheduck@gmail.com // idea to seperate error from would block by arnetheduck@gmail.com
if (recvd == -1) { if (recvd == -1) {

View File

@ -1,6 +1,5 @@
/* /*
Copyright (c) 2005-2007 MySQL AB, 2008-2010 Sun Microsystems, Inc. Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -40,6 +39,7 @@
#include "coding.hpp" // HexDecoder #include "coding.hpp" // HexDecoder
#include "helpers.hpp" // for placement new hack #include "helpers.hpp" // for placement new hack
#include <stdio.h> #include <stdio.h>
#include <time.h>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> // FindFirstFile etc.. #include <windows.h> // FindFirstFile etc..
@ -1196,8 +1196,7 @@ void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX* ctx, void* userdata)
X509* SSL_get_certificate(SSL* ssl) X509* SSL_get_certificate(SSL* ssl)
{ {
// only used to pass to get_privatekey which isn't used return ssl->getCrypto().get_certManager().get_selfX509();
return 0;
} }
@ -1671,7 +1670,6 @@ unsigned long ERR_get_error()
// TODO: // TODO:
} }
SSL_CIPHER* SSL_get_current_cipher(SSL*) SSL_CIPHER* SSL_get_current_cipher(SSL*)
{ {
// TODO: // TODO:
@ -1685,10 +1683,41 @@ unsigned long ERR_get_error()
return 0; return 0;
} }
// end stunnel needs // end stunnel needs
char *yaSSL_ASN1_TIME_to_string(ASN1_TIME *time, char *buf, size_t len)
{
tm t;
static const char *month_names[12]=
{
"Jan","Feb","Mar","Apr","May","Jun",
"Jul","Aug","Sep","Oct","Nov","Dec"
};
TaoCrypt::ASN1_TIME_extract(time->data, time->type, &t);
snprintf(buf, len, "%s %2d %02d:%02d:%02d %d GMT",
month_names[t.tm_mon], t.tm_mday, t.tm_hour, t.tm_min,
t.tm_sec, t.tm_year + 1900);
return buf;
}
void yaSSL_transport_set_ptr(SSL *ssl, void *ptr)
{
ssl->useSocket().set_transport_ptr(ptr);
}
void yaSSL_transport_set_recv_function(SSL *ssl, yaSSL_recv_func_t func)
{
ssl->useSocket().set_transport_recv_function(func);
}
void yaSSL_transport_set_send_function(SSL *ssl, yaSSL_send_func_t func)
{
ssl->useSocket().set_transport_send_function(func);
}
} // extern "C" } // extern "C"
} // namespace } // namespace

View File

@ -1459,12 +1459,12 @@ void SSL_SESSION::CopyX509(X509* x)
X509_NAME* issuer = x->GetIssuer(); X509_NAME* issuer = x->GetIssuer();
X509_NAME* subject = x->GetSubject(); X509_NAME* subject = x->GetSubject();
ASN1_STRING* before = x->GetBefore(); ASN1_TIME* before = x->GetBefore();
ASN1_STRING* after = x->GetAfter(); ASN1_TIME* after = x->GetAfter();
peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(), peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(),
subject->GetName(), subject->GetLength(), (const char*) before->data, subject->GetName(), subject->GetLength(),
before->length, (const char*) after->data, after->length); before, after);
} }
@ -2412,9 +2412,10 @@ size_t X509_NAME::GetLength() const
X509::X509(const char* i, size_t iSz, const char* s, size_t sSz, X509::X509(const char* i, size_t iSz, const char* s, size_t sSz,
const char* b, int bSz, const char* a, int aSz) ASN1_STRING *b, ASN1_STRING *a)
: issuer_(i, iSz), subject_(s, sSz), : issuer_(i, iSz), subject_(s, sSz),
beforeDate_(b, bSz), afterDate_(a, aSz) beforeDate_((char *) b->data, b->length, b->type),
afterDate_((char *) a->data, a->length, a->type)
{} {}
@ -2430,13 +2431,13 @@ X509_NAME* X509::GetSubject()
} }
ASN1_STRING* X509::GetBefore() ASN1_TIME* X509::GetBefore()
{ {
return beforeDate_.GetString(); return beforeDate_.GetString();
} }
ASN1_STRING* X509::GetAfter() ASN1_TIME* X509::GetAfter()
{ {
return afterDate_.GetString(); return afterDate_.GetString();
} }
@ -2464,12 +2465,12 @@ ASN1_STRING* X509_NAME::GetEntry(int i)
} }
StringHolder::StringHolder(const char* str, int sz) StringHolder::StringHolder(const char* str, int sz, byte type)
{ {
asnString_.length = sz; asnString_.length = sz;
asnString_.data = NEW_YS byte[sz + 1]; asnString_.data = NEW_YS byte[sz + 1];
memcpy(asnString_.data, str, sz); memcpy(asnString_.data, str, sz);
asnString_.type = 0; // not used for now asnString_.type = type;
} }

View File

@ -33,7 +33,7 @@
#else #else
#include "list.hpp" #include "list.hpp"
#endif #endif
#include <time.h>
namespace STL = STL_NAMESPACE; namespace STL = STL_NAMESPACE;
@ -280,7 +280,9 @@ public:
const char* GetCommonName() const { return subject_; } const char* GetCommonName() const { return subject_; }
const byte* GetHash() const { return subjectHash_; } const byte* GetHash() const { return subjectHash_; }
const char* GetBeforeDate() const { return beforeDate_; } const char* GetBeforeDate() const { return beforeDate_; }
byte GetBeforeDateType() const { return beforeDateType_; }
const char* GetAfterDate() const { return afterDate_; } const char* GetAfterDate() const { return afterDate_; }
byte GetAfterDateType() const { return afterDateType_; }
void DecodeToKey(); void DecodeToKey();
private: private:
@ -296,7 +298,9 @@ private:
char issuer_[ASN_NAME_MAX]; // Names char issuer_[ASN_NAME_MAX]; // Names
char subject_[ASN_NAME_MAX]; // Names char subject_[ASN_NAME_MAX]; // Names
char beforeDate_[MAX_DATE_SZ]; // valid before date char beforeDate_[MAX_DATE_SZ]; // valid before date
byte beforeDateType_; // beforeDate time type
char afterDate_[MAX_DATE_SZ]; // valid after date char afterDate_[MAX_DATE_SZ]; // valid after date
byte afterDateType_; // afterDate time type
bool verify_; // Default to yes, but could be off bool verify_; // Default to yes, but could be off
void ReadHeader(); void ReadHeader();
@ -369,6 +373,9 @@ int GetCert(Source&);
// Get Cert in PEM format from pkcs12 file // Get Cert in PEM format from pkcs12 file
int GetPKCS_Cert(const char* password, Source&); int GetPKCS_Cert(const char* password, Source&);
void ASN1_TIME_extract(const unsigned char* date, unsigned char format,
tm *parsed_time);
} // namespace } // namespace

View File

@ -33,10 +33,55 @@
#include "coding.hpp" #include "coding.hpp"
#include <time.h> // gmtime(); #include <time.h> // gmtime();
#include "memory.hpp" // some auto_ptr don't have reset, also need auto_array #include "memory.hpp" // some auto_ptr don't have reset, also need auto_array
#include <assert.h>
namespace TaoCrypt { namespace TaoCrypt {
// like atoi but only use first byte
word32 btoi(byte b)
{
return b - 0x30;
}
// two byte date/time, add to value
void GetTime(int *value, const byte* date, int& i)
{
*value += btoi(date[i++]) * 10;
*value += btoi(date[i++]);
}
void ASN1_TIME_extract(const unsigned char* date, unsigned char format,
tm *t)
{
int i = 0;
memset(t, 0, sizeof (tm));
assert(format == UTC_TIME || format == GENERALIZED_TIME);
if (format == UTC_TIME) {
if (btoi(date[0]) >= 5)
t->tm_year = 1900;
else
t->tm_year = 2000;
}
else { // format == GENERALIZED_TIME
t->tm_year += btoi(date[i++]) * 1000;
t->tm_year += btoi(date[i++]) * 100;
}
GetTime(&t->tm_year, date, i); t->tm_year -= 1900; // adjust
GetTime(&t->tm_mon, date, i); t->tm_mon -= 1; // adjust
GetTime(&t->tm_mday, date, i);
GetTime(&t->tm_hour, date, i);
GetTime(&t->tm_min, date, i);
GetTime(&t->tm_sec, date, i);
assert(date[i] == 'Z'); // only Zulu supported for this profile
}
namespace { // locals namespace { // locals
@ -71,52 +116,15 @@ bool operator<(tm& a, tm&b)
} }
// like atoi but only use first byte
word32 btoi(byte b)
{
return b - 0x30;
}
// two byte date/time, add to value
void GetTime(int& value, const byte* date, int& i)
{
value += btoi(date[i++]) * 10;
value += btoi(date[i++]);
}
// Make sure before and after dates are valid // Make sure before and after dates are valid
bool ValidateDate(const byte* date, byte format, CertDecoder::DateType dt) bool ValidateDate(const byte* date, byte format, CertDecoder::DateType dt)
{ {
tm certTime; tm certTime;
memset(&certTime, 0, sizeof(certTime));
int i = 0;
if (format == UTC_TIME) {
if (btoi(date[0]) >= 5)
certTime.tm_year = 1900;
else
certTime.tm_year = 2000;
}
else { // format == GENERALIZED_TIME
certTime.tm_year += btoi(date[i++]) * 1000;
certTime.tm_year += btoi(date[i++]) * 100;
}
GetTime(certTime.tm_year, date, i); certTime.tm_year -= 1900; // adjust
GetTime(certTime.tm_mon, date, i); certTime.tm_mon -= 1; // adjust
GetTime(certTime.tm_mday, date, i);
GetTime(certTime.tm_hour, date, i);
GetTime(certTime.tm_min, date, i);
GetTime(certTime.tm_sec, date, i);
if (date[i] != 'Z') // only Zulu supported for this profile
return false;
time_t ltime = time(0); time_t ltime = time(0);
tm* localTime = gmtime(&ltime); tm* localTime = gmtime(&ltime);
ASN1_TIME_extract(date, format, &certTime);
if (dt == CertDecoder::BEFORE) { if (dt == CertDecoder::BEFORE) {
if (*localTime < certTime) if (*localTime < certTime)
return false; return false;
@ -879,10 +887,12 @@ void CertDecoder::GetDate(DateType dt)
if (dt == BEFORE) { if (dt == BEFORE) {
memcpy(beforeDate_, date, length); memcpy(beforeDate_, date, length);
beforeDate_[length] = 0; beforeDate_[length] = 0;
beforeDateType_= b;
} }
else { // after else { // after
memcpy(afterDate_, date, length); memcpy(afterDate_, date, length);
afterDate_[length] = 0; afterDate_[length] = 0;
afterDateType_= b;
} }
} }

View File

@ -24,6 +24,7 @@ SET(HEADERS_GEN_CONFIGURE
SET(HEADERS SET(HEADERS
mysql.h mysql.h
mysql_com.h mysql_com.h
mysql_com_server.h
mysql_time.h mysql_time.h
ma_dyncol.h ma_dyncol.h
my_list.h my_list.h

View File

@ -90,17 +90,6 @@
#define IF_WIN(A,B) B #define IF_WIN(A,B) B
#endif #endif
#ifndef EMBEDDED_LIBRARY
#ifdef WITH_NDB_BINLOG
#define HAVE_NDB_BINLOG 1
#endif
#endif /* !EMBEDDED_LIBRARY */
#ifndef EMBEDDED_LIBRARY
#define HAVE_REPLICATION
#define HAVE_EXTERNAL_CLIENT
#endif
#if defined (_WIN32) #if defined (_WIN32)
/* /*
off_t is 32 bit long. We do not use C runtime functions off_t is 32 bit long. We do not use C runtime functions
@ -1018,6 +1007,7 @@ typedef struct st_mysql_lex_string LEX_STRING;
#define SOCKET_ETIMEDOUT WSAETIMEDOUT #define SOCKET_ETIMEDOUT WSAETIMEDOUT
#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK #define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
#define SOCKET_EADDRINUSE WSAEADDRINUSE #define SOCKET_EADDRINUSE WSAEADDRINUSE
#define SOCKET_ECONNRESET WSAECONNRESET
#define SOCKET_ENFILE ENFILE #define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE #define SOCKET_EMFILE EMFILE
#else /* Unix */ #else /* Unix */
@ -1028,6 +1018,7 @@ typedef struct st_mysql_lex_string LEX_STRING;
#define SOCKET_ETIMEDOUT SOCKET_EINTR #define SOCKET_ETIMEDOUT SOCKET_EINTR
#define SOCKET_EWOULDBLOCK EWOULDBLOCK #define SOCKET_EWOULDBLOCK EWOULDBLOCK
#define SOCKET_EADDRINUSE EADDRINUSE #define SOCKET_EADDRINUSE EADDRINUSE
#define SOCKET_ECONNRESET ECONNRESET
#define SOCKET_ENFILE ENFILE #define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE #define SOCKET_EMFILE EMFILE
#endif #endif
@ -1541,6 +1532,12 @@ static inline double rint(double x)
#undef HAVE_SMEM /* No shared memory */ #undef HAVE_SMEM /* No shared memory */
#else
#ifdef WITH_NDB_BINLOG
#define HAVE_NDB_BINLOG 1
#endif
#define HAVE_REPLICATION
#define HAVE_EXTERNAL_CLIENT
#endif /* EMBEDDED_LIBRARY */ #endif /* EMBEDDED_LIBRARY */
#endif /* my_global_h */ #endif /* my_global_h */

View File

@ -61,13 +61,15 @@ C_MODE_START
#define SD_BOTH 0x02 #define SD_BOTH 0x02
*/ */
#define SHUT_RDWR 0x02 #define SHUT_RDWR 0x02
#else
#include <netdb.h> /* getaddrinfo() & co */
#endif #endif
/* /*
On OSes which don't have the in_addr_t, we guess that using uint32 is the best On OSes which don't have the in_addr_t, we guess that using uint32
possible choice. We guess this from the fact that on HP-UX64bit & FreeBSD64bit is the best possible choice. We guess this from the fact that on
& Solaris64bit, in_addr_t is equivalent to uint32. And on Linux32bit too. HP-UX64bit & FreeBSD64bit & Solaris64bit, in_addr_t is equivalent to
uint32. And on Linux32bit too.
*/ */
#ifndef HAVE_IN_ADDR_T #ifndef HAVE_IN_ADDR_T
#define in_addr_t uint32 #define in_addr_t uint32

View File

@ -490,6 +490,11 @@ typedef struct st_io_cache /* Used when cacheing files */
typedef int (*qsort2_cmp)(const void *, const void *, const void *); typedef int (*qsort2_cmp)(const void *, const void *, const void *);
typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...)
ATTRIBUTE_FORMAT_FPTR(printf, 2, 3);
extern my_error_reporter my_charset_error_reporter;
/* defines for mf_iocache */ /* defines for mf_iocache */
/* Test if buffer is inited */ /* Test if buffer is inited */
@ -1000,6 +1005,7 @@ char* my_cgets(char *string, size_t clen, size_t* plen);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
extern MYSQL_PLUGIN_IMPORT struct PSI_bootstrap *PSI_hook; extern MYSQL_PLUGIN_IMPORT struct PSI_bootstrap *PSI_hook;
extern void set_psi_server(PSI *psi);
void my_init_mysys_psi_keys(void); void my_init_mysys_psi_keys(void);
#endif #endif

View File

@ -168,9 +168,13 @@ enum mysql_option
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH, MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH,
MYSQL_PROGRESS_CALLBACK, MYSQL_OPT_BIND,
MYSQL_OPT_SSL_KEY, MYSQL_OPT_SSL_CERT,
MYSQL_OPT_SSL_CA, MYSQL_OPT_SSL_CAPATH, MYSQL_OPT_SSL_CIPHER,
MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH,
/* MariaDB options */ /* MariaDB options */
MYSQL_OPT_NONBLOCK=6000 MYSQL_OPT_NONBLOCK=6000,
MYSQL_PROGRESS_CALLBACK
}; };
/** /**

View File

@ -262,8 +262,12 @@ enum mysql_option
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH, MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH,
MYSQL_PROGRESS_CALLBACK, MYSQL_OPT_BIND,
MYSQL_OPT_NONBLOCK=6000 MYSQL_OPT_SSL_KEY, MYSQL_OPT_SSL_CERT,
MYSQL_OPT_SSL_CA, MYSQL_OPT_SSL_CAPATH, MYSQL_OPT_SSL_CIPHER,
MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH,
MYSQL_OPT_NONBLOCK=6000,
MYSQL_PROGRESS_CALLBACK
}; };
struct st_mysql_options_extention; struct st_mysql_options_extention;
struct st_mysql_options { struct st_mysql_options {

View File

@ -0,0 +1,41 @@
/* Copyright (c) 2011, 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
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Definitions private to the server,
used in the networking layer to notify specific events.
*/
#ifndef _mysql_com_server_h
#define _mysql_com_server_h
struct st_net_server;
typedef void (*before_header_callback_fn)
(struct st_net *net, void *user_data, size_t count);
typedef void (*after_header_callback_fn)
(struct st_net *net, void *user_data, size_t count, my_bool rc);
struct st_net_server
{
before_header_callback_fn m_before_header;
after_header_callback_fn m_after_header;
void *m_user_data;
};
typedef struct st_net_server NET_SERVER;
#endif

View File

@ -32,6 +32,8 @@ struct mysql_async_context;
struct st_mysql_options_extention { struct st_mysql_options_extention {
char *plugin_dir; char *plugin_dir;
char *default_auth; char *default_auth;
char *ssl_crl; /* PEM CRL file */
char *ssl_crlpath; /* PEM directory of CRL-s? */
void (*report_progress)(const MYSQL *mysql, void (*report_progress)(const MYSQL *mysql,
unsigned int stage, unsigned int stage,
unsigned int max_stage, unsigned int max_stage,

View File

@ -22,11 +22,18 @@
case OPT_SSL_CA: case OPT_SSL_CA:
case OPT_SSL_CAPATH: case OPT_SSL_CAPATH:
case OPT_SSL_CIPHER: case OPT_SSL_CIPHER:
case OPT_SSL_CRL:
case OPT_SSL_CRLPATH:
/* /*
Enable use of SSL if we are using any ssl option Enable use of SSL if we are using any ssl option
One can disable SSL later by using --skip-ssl or --ssl=0 One can disable SSL later by using --skip-ssl or --ssl=0
*/ */
opt_use_ssl= 1; opt_use_ssl= 1;
/* crl has no effect in yaSSL */
#ifdef HAVE_YASSL
opt_ssl_crl= NULL;
opt_ssl_crlpath= NULL;
#endif
break; break;
#endif #endif
#endif /* SSLOPT_CASE_INCLUDED */ #endif /* SSLOPT_CASE_INCLUDED */

View File

@ -39,6 +39,13 @@
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).", {"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
&opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG, &opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"ssl-crl", OPT_SSL_KEY, "Certificate revocation list (implies --ssl).",
&opt_ssl_crl, &opt_ssl_crl, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-crlpath", OPT_SSL_KEY,
"Certificate revocation list path (implies --ssl).",
&opt_ssl_crlpath, &opt_ssl_crlpath, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifdef MYSQL_CLIENT #ifdef MYSQL_CLIENT
{"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT, {"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT,
"Verify server's \"Common Name\" in its cert against hostname used " "Verify server's \"Common Name\" in its cert against hostname used "

View File

@ -28,6 +28,8 @@ SSL_STATIC char *opt_ssl_capath = 0;
SSL_STATIC char *opt_ssl_cert = 0; SSL_STATIC char *opt_ssl_cert = 0;
SSL_STATIC char *opt_ssl_cipher = 0; SSL_STATIC char *opt_ssl_cipher = 0;
SSL_STATIC char *opt_ssl_key = 0; SSL_STATIC char *opt_ssl_key = 0;
SSL_STATIC char *opt_ssl_crl = 0;
SSL_STATIC char *opt_ssl_crlpath = 0;
#ifdef MYSQL_CLIENT #ifdef MYSQL_CLIENT
SSL_STATIC my_bool opt_ssl_verify_server_cert= 0; SSL_STATIC my_bool opt_ssl_verify_server_cert= 0;
#endif #endif

View File

@ -1,4 +1,5 @@
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. /* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Copyright (c) 2012 Monty Program Ab
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -10,8 +11,8 @@
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation, Inc., along with this program; if not, write to the Free Software
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* /*
* Vio Lite. * Vio Lite.
@ -22,7 +23,7 @@
#define vio_violite_h_ #define vio_violite_h_
#include "my_net.h" /* needed because of struct in_addr */ #include "my_net.h" /* needed because of struct in_addr */
#include <mysql/psi/mysql_socket.h>
/* Simple vio interface in C; The functions are implemented in violite.c */ /* Simple vio interface in C; The functions are implemented in violite.c */
@ -40,12 +41,23 @@ enum enum_vio_type
VIO_TYPE_SSL, VIO_TYPE_SHARED_MEMORY VIO_TYPE_SSL, VIO_TYPE_SHARED_MEMORY
}; };
/**
VIO I/O events.
*/
enum enum_vio_io_event
{
VIO_IO_EVENT_READ,
VIO_IO_EVENT_WRITE,
VIO_IO_EVENT_CONNECT
};
#define VIO_LOCALHOST 1 /* a localhost connection */ #define VIO_LOCALHOST 1 /* a localhost connection */
#define VIO_BUFFERED_READ 2 /* use buffered read */ #define VIO_BUFFERED_READ 2 /* use buffered read */
#define VIO_READ_BUFFER_SIZE 16384 /* size of read buffer */ #define VIO_READ_BUFFER_SIZE 16384 /* size of read buffer */
#define VIO_DESCRIPTION_SIZE 30 /* size of description */
Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags); Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
Vio* mysql_socket_vio_new(MYSQL_SOCKET mysql_socket, enum enum_vio_type type, uint flags);
#ifdef __WIN__ #ifdef __WIN__
Vio* vio_new_win32pipe(HANDLE hPipe); Vio* vio_new_win32pipe(HANDLE hPipe);
Vio* vio_new_win32shared_memory(HANDLE handle_file_map, Vio* vio_new_win32shared_memory(HANDLE handle_file_map,
@ -59,13 +71,10 @@ Vio* vio_new_win32shared_memory(HANDLE handle_file_map,
#define HANDLE void * #define HANDLE void *
#endif /* __WIN__ */ #endif /* __WIN__ */
/* backport from 5.6 where it is part of PSI, not vio_*() */
int mysql_socket_shutdown(my_socket mysql_socket, int how);
void vio_delete(Vio* vio); void vio_delete(Vio* vio);
int vio_close(Vio* vio); int vio_close(Vio* vio);
void vio_reset(Vio* vio, enum enum_vio_type type, my_bool vio_reset(Vio* vio, enum enum_vio_type type,
my_socket sd, HANDLE hPipe, uint flags); my_socket sd, void *ssl, uint flags);
size_t vio_read(Vio *vio, uchar * buf, size_t size); size_t vio_read(Vio *vio, uchar * buf, size_t size);
size_t vio_read_buff(Vio *vio, uchar * buf, size_t size); size_t vio_read_buff(Vio *vio, uchar * buf, size_t size);
size_t vio_write(Vio *vio, const uchar * buf, size_t size); size_t vio_write(Vio *vio, const uchar * buf, size_t size);
@ -78,6 +87,7 @@ int vio_keepalive(Vio *vio, my_bool onoff);
/* Whenever we should retry the last read/write operation. */ /* Whenever we should retry the last read/write operation. */
my_bool vio_should_retry(Vio *vio); my_bool vio_should_retry(Vio *vio);
/* Check that operation was timed out */ /* Check that operation was timed out */
my_bool vio_was_timeout(Vio *vio);
my_bool vio_was_interrupted(Vio *vio); my_bool vio_was_interrupted(Vio *vio);
/* Short text description of the socket for those, who are curious.. */ /* Short text description of the socket for those, who are curious.. */
const char* vio_description(Vio *vio); const char* vio_description(Vio *vio);
@ -89,9 +99,17 @@ int vio_errno(Vio*vio);
my_socket vio_fd(Vio*vio); my_socket vio_fd(Vio*vio);
/* Remote peer's address and name in text form */ /* Remote peer's address and name in text form */
my_bool vio_peer_addr(Vio *vio, char *buf, uint16 *port, size_t buflen); my_bool vio_peer_addr(Vio *vio, char *buf, uint16 *port, size_t buflen);
my_bool vio_poll_read(Vio *vio, uint timeout); /* Wait for an I/O event notification. */
int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout);
my_bool vio_is_connected(Vio *vio); my_bool vio_is_connected(Vio *vio);
#ifndef DBUG_OFF
ssize_t vio_pending(Vio *vio); ssize_t vio_pending(Vio *vio);
#endif
/* Set timeout for a network operation. */
int vio_timeout(Vio *vio, uint which, int timeout_sec);
/* Connect to a peer. */
my_bool vio_socket_connect(Vio *vio, struct sockaddr *addr, socklen_t len,
int timeout);
my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, int addr_length, my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, int addr_length,
char *ip_string, size_t ip_string_size); char *ip_string, size_t ip_string_size);
@ -111,6 +129,10 @@ int vio_getnameinfo(const struct sockaddr *sa,
#define DES_set_key_unchecked(k,ks) des_set_key_unchecked((k),*(ks)) #define DES_set_key_unchecked(k,ks) des_set_key_unchecked((k),*(ks))
#define DES_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e) des_ede3_cbc_encrypt((i),(o),(l),*(k1),*(k2),*(k3),(iv),(e)) #define DES_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e) des_ede3_cbc_encrypt((i),(o),(l),*(k1),*(k2),*(k3),(iv),(e))
#endif #endif
/* apple deprecated openssl in MacOSX Lion */
#ifdef __APPLE__
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#define HEADER_DES_LOCL_H dummy_something #define HEADER_DES_LOCL_H dummy_something
#define YASSL_MYSQL_COMPATIBLE #define YASSL_MYSQL_COMPATIBLE
@ -142,11 +164,13 @@ int sslconnect(struct st_VioSSLFd*, Vio *, long timeout, unsigned long *errptr);
struct st_VioSSLFd struct st_VioSSLFd
*new_VioSSLConnectorFd(const char *key_file, const char *cert_file, *new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
const char *ca_file, const char *ca_path, const char *ca_file, const char *ca_path,
const char *cipher, enum enum_ssl_init_error* error); const char *cipher, enum enum_ssl_init_error *error,
const char *crl_file, const char *crl_path);
struct st_VioSSLFd struct st_VioSSLFd
*new_VioSSLAcceptorFd(const char *key_file, const char *cert_file, *new_VioSSLAcceptorFd(const char *key_file, const char *cert_file,
const char *ca_file,const char *ca_path, const char *ca_file,const char *ca_path,
const char *cipher, enum enum_ssl_init_error* error); const char *cipher, enum enum_ssl_init_error *error,
const char *crl_file, const char *crl_path);
void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd); void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd);
#endif /* HAVE_OPENSSL */ #endif /* HAVE_OPENSSL */
@ -167,12 +191,13 @@ void vio_end(void);
#define vio_fastsend(vio) (vio)->fastsend(vio) #define vio_fastsend(vio) (vio)->fastsend(vio)
#define vio_keepalive(vio, set_keep_alive) (vio)->viokeepalive(vio, set_keep_alive) #define vio_keepalive(vio, set_keep_alive) (vio)->viokeepalive(vio, set_keep_alive)
#define vio_should_retry(vio) (vio)->should_retry(vio) #define vio_should_retry(vio) (vio)->should_retry(vio)
#define vio_was_timeout(vio) (vio)->was_timeout(vio)
#define vio_was_interrupted(vio) (vio)->was_interrupted(vio) #define vio_was_interrupted(vio) (vio)->was_interrupted(vio)
#define vio_close(vio) ((vio)->vioclose)(vio) #define vio_close(vio) ((vio)->vioclose)(vio)
#define vio_shutdown(vio,how) ((vio)->shutdown)(vio,how) #define vio_shutdown(vio,how) ((vio)->shutdown)(vio,how)
#define vio_peer_addr(vio, buf, prt, buflen) (vio)->peer_addr(vio, buf, prt, buflen) #define vio_peer_addr(vio, buf, prt, buflen) (vio)->peer_addr(vio, buf, prt, buflen)
#define vio_io_wait(vio, event, timeout) (vio)->io_wait(vio, event, timeout)
#define vio_timeout(vio, which, seconds) (vio)->timeout(vio, which, seconds) #define vio_timeout(vio, which, seconds) (vio)->timeout(vio, which, seconds)
#define vio_poll_read(vio, timeout) (vio)->poll_read(vio, timeout)
#define vio_is_connected(vio) (vio)->is_connected(vio) #define vio_is_connected(vio) (vio)->is_connected(vio)
#endif /* !defined(DONT_MAP_VIO) */ #endif /* !defined(DONT_MAP_VIO) */
@ -202,26 +227,31 @@ enum SSL_type
/* This structure is for every connection on both sides */ /* This structure is for every connection on both sides */
struct st_vio struct st_vio
{ {
my_socket sd; /* my_socket - real or imaginary */ MYSQL_SOCKET mysql_socket; /* Instrumented socket */
HANDLE hPipe;
my_bool localhost; /* Are we from localhost? */ my_bool localhost; /* Are we from localhost? */
int fcntl_mode; /* Buffered fcntl(sd,F_GETFL) */ int fcntl_mode; /* Buffered fcntl(sd,F_GETFL) */
struct sockaddr_storage local; /* Local internet address */ struct sockaddr_storage local; /* Local internet address */
struct sockaddr_storage remote; /* Remote internet address */ struct sockaddr_storage remote; /* Remote internet address */
int addrLen; /* Length of remote address */ int addrLen; /* Length of remote address */
enum enum_vio_type type; /* Type of connection */ enum enum_vio_type type; /* Type of connection */
char desc[30]; /* String description */ /*
Description string. This member MUST NOT be used directly, but only
via function "vio_description"
*/
char desc[VIO_DESCRIPTION_SIZE];
char *read_buffer; /* buffer for vio_read_buff */ char *read_buffer; /* buffer for vio_read_buff */
char *read_pos; /* start of unfetched data in the char *read_pos; /* start of unfetched data in the
read buffer */ read buffer */
char *read_end; /* end of unfetched data */ char *read_end; /* end of unfetched data */
struct mysql_async_context *async_context; /* For non-blocking API */ struct mysql_async_context *async_context; /* For non-blocking API */
uint read_timeout, write_timeout; int read_timeout; /* Timeout value (ms) for read ops. */
int write_timeout; /* Timeout value (ms) for write ops. */
/* function pointers. They are similar for socket/SSL/whatever */ /* function pointers. They are similar for socket/SSL/whatever */
void (*viodelete)(Vio*); void (*viodelete)(Vio*);
int (*vioerrno)(Vio*); int (*vioerrno)(Vio*);
size_t (*read)(Vio*, uchar *, size_t); size_t (*read)(Vio*, uchar *, size_t);
size_t (*write)(Vio*, const uchar *, size_t); size_t (*write)(Vio*, const uchar *, size_t);
int (*timeout)(Vio*, uint, my_bool);
int (*vioblocking)(Vio*, my_bool, my_bool *); int (*vioblocking)(Vio*, my_bool, my_bool *);
my_bool (*is_blocking)(Vio*); my_bool (*is_blocking)(Vio*);
int (*viokeepalive)(Vio*, my_bool); int (*viokeepalive)(Vio*, my_bool);
@ -229,13 +259,19 @@ struct st_vio
my_bool (*peer_addr)(Vio*, char *, uint16*, size_t); my_bool (*peer_addr)(Vio*, char *, uint16*, size_t);
void (*in_addr)(Vio*, struct sockaddr_storage*); void (*in_addr)(Vio*, struct sockaddr_storage*);
my_bool (*should_retry)(Vio*); my_bool (*should_retry)(Vio*);
my_bool (*was_timeout)(Vio*);
my_bool (*was_interrupted)(Vio*); my_bool (*was_interrupted)(Vio*);
int (*vioclose)(Vio*); int (*vioclose)(Vio*);
void (*timeout)(Vio*, unsigned int which, unsigned int timeout);
my_bool (*poll_read)(Vio *vio, uint timeout);
my_bool (*is_connected)(Vio*); my_bool (*is_connected)(Vio*);
int (*shutdown)(Vio *, int); int (*shutdown)(Vio *, int);
my_bool (*has_data) (Vio*); my_bool (*has_data) (Vio*);
int (*io_wait)(Vio*, enum enum_vio_io_event, int);
my_bool (*connect)(Vio*, struct sockaddr *, socklen_t, int);
#ifdef _WIN32
HANDLE hPipe;
DWORD thread_id; /* Used on XP only by vio_shutdown() */
OVERLAPPED overlapped;
#endif
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
void *ssl_arg; void *ssl_arg;
#endif #endif
@ -250,11 +286,5 @@ struct st_vio
size_t shared_memory_remain; size_t shared_memory_remain;
char *shared_memory_pos; char *shared_memory_pos;
#endif /* HAVE_SMEM */ #endif /* HAVE_SMEM */
#ifdef _WIN32
DWORD thread_id; /* Used on XP only by vio_shutdown() */
OVERLAPPED pipe_overlapped;
DWORD read_timeout_ms;
DWORD write_timeout_ms;
#endif
}; };
#endif /* vio_violite_h_ */ #endif /* vio_violite_h_ */

View File

@ -60,10 +60,12 @@ if ($tmp)
--echo Last_SQL_Error --echo Last_SQL_Error
--echo Replicate_Ignore_Server_Ids --echo Replicate_Ignore_Server_Ids
--echo Master_Server_Id # --echo Master_Server_Id #
--echo Master_SSL_Crl
--echo Master_SSL_Crlpath
} }
if (!$tmp) { if (!$tmp) {
# Note: after WL#5177, fields 13-18 shall not be filtered-out. # Note: after WL#5177, fields 13-18 shall not be filtered-out.
--replace_column 4 # 5 # 6 # 7 # 8 # 9 # 10 # 13 # 14 # 15 # 16 # 17 # 18 # 22 # 23 # 24 # 25 # 26 # 40 # --replace_column 4 # 5 # 6 # 7 # 8 # 9 # 10 # 13 # 14 # 15 # 16 # 17 # 18 # 22 # 23 # 24 # 25 # 26 # 40 # 41 # 42 #
query_vertical query_vertical
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
} }

View File

@ -0,0 +1,4 @@
-- require r/openssl.require
disable_query_log;
show variables like "have_openssl";
enable_query_log;

View File

@ -0,0 +1,2 @@
Variable_name Value
have_openssl YES

View File

@ -0,0 +1 @@
# try logging in with a certificate in the server's --ssl-crl : should fail

View File

@ -1,6 +1,12 @@
SHOW STATUS LIKE 'Ssl_cipher'; SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA Ssl_cipher DHE-RSA-AES256-SHA
SHOW STATUS LIKE 'Ssl_server_not_before';
Variable_name Value
Ssl_server_not_before Jan 29 11:56:49 2010 GMT
SHOW STATUS LIKE 'Ssl_server_not_after';
Variable_name Value
Ssl_server_not_after Jan 28 11:56:49 2015 GMT
drop table if exists t1,t2,t3,t4; drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 ( CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,

View File

@ -0,0 +1,23 @@
# test --crl for the client : should connect
Variable_name Value
have_openssl YES
have_ssl YES
ssl_ca MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
ssl_capath
ssl_cert MYSQL_TEST_DIR/std_data/crl-server-cert.pem
ssl_cipher
ssl_crl MYSQL_TEST_DIR/std_data/crl-client-revoked.crl
ssl_crlpath
ssl_key MYSQL_TEST_DIR/std_data/crl-server-key.pem
# test --crlpath for the client : should connect
Variable_name Value
have_openssl YES
have_ssl YES
ssl_ca MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
ssl_capath
ssl_cert MYSQL_TEST_DIR/std_data/crl-server-cert.pem
ssl_cipher
ssl_crl MYSQL_TEST_DIR/std_data/crl-client-revoked.crl
ssl_crlpath
ssl_key MYSQL_TEST_DIR/std_data/crl-server-key.pem
# try logging in with a certificate in the server's --ssl-crl : should fail

View File

@ -0,0 +1,24 @@
# Test clients with and without CRL lists
############ Test mysql ##############
# Test mysql connecting to a server with an empty crl
Variable_name Value
have_openssl YES
have_ssl YES
ssl_ca MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
ssl_capath
ssl_cert MYSQL_TEST_DIR/std_data/crl-client-cert.pem
ssl_cipher
ssl_crl
ssl_crlpath
ssl_key MYSQL_TEST_DIR/std_data/crl-client-key.pem
# Test mysql connecting to a server with a certificate revoked by -crl
# Test mysql connecting to a server with a certificate revoked by -crlpath
############ Test mysqladmin ##############
# Test mysqladmin connecting to a server with an empty crl
mysqld is alive
# Test mysqladmin connecting to a server with a certificate revoked by -crl
mysqladmin: connect to server at 'localhost' failed
error: 'SSL connection error: Failed to set ciphers to use'
# Test mysqladmin connecting to a server with a certificate revoked by -crlpath
mysqladmin: connect to server at 'localhost' failed
error: 'SSL connection error: error:00000005:lib(0):func(0):DH lib'

View File

@ -0,0 +1,7 @@
# Test clients with and without CRL lists
############ Test mysql ##############
# Test mysql connecting to a server with a certificate revoked by -crl
# Test mysql connecting to a server with a certificate revoked by -crlpath
############ Test mysqladmin ##############
# Test mysqladmin connecting to a server with a certificate revoked by -crl
# Test mysqladmin connecting to a server with a certificate revoked by -crlpath

View File

@ -0,0 +1,16 @@
# Test clients with and without CRL lists
############ Test mysql ##############
# Test mysql connecting to a server with an empty crl
Variable_name Value
have_openssl YES
have_ssl YES
ssl_ca MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
ssl_capath
ssl_cert MYSQL_TEST_DIR/std_data/crl-client-valid-cert.pem
ssl_cipher
ssl_crl MYSQL_TEST_DIR/std_data/crl-client-revoked.crl
ssl_crlpath
ssl_key MYSQL_TEST_DIR/std_data/crl-client-valid-key.pem
############ Test mysqladmin ##############
# Test mysqladmin connecting to a server with an empty crl
mysqld is alive

View File

@ -0,0 +1,23 @@
# test --crl for the client : should connect
Variable_name Value
have_openssl YES
have_ssl YES
ssl_ca MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
ssl_capath
ssl_cert MYSQL_TEST_DIR/std_data/crl-server-cert.pem
ssl_cipher
ssl_crl
ssl_crlpath MYSQL_TEST_DIR/std_data/crldir
ssl_key MYSQL_TEST_DIR/std_data/crl-server-key.pem
# test --crlpath for the client : should connect
Variable_name Value
have_openssl YES
have_ssl YES
ssl_ca MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
ssl_capath
ssl_cert MYSQL_TEST_DIR/std_data/crl-server-cert.pem
ssl_cipher
ssl_crl
ssl_crlpath MYSQL_TEST_DIR/std_data/crldir
ssl_key MYSQL_TEST_DIR/std_data/crl-server-key.pem
# try logging in with a certificate in the server's --ssl-crlpath : should fail

View File

@ -982,6 +982,8 @@ ssl_ca #
ssl_capath # ssl_capath #
ssl_cert # ssl_cert #
ssl_cipher # ssl_cipher #
ssl_crl #
ssl_crlpath #
ssl_key # ssl_key #
select * from information_schema.session_variables where variable_name like 'ssl%' order by 1; select * from information_schema.session_variables where variable_name like 'ssl%' order by 1;
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
@ -989,6 +991,8 @@ SSL_CA #
SSL_CAPATH # SSL_CAPATH #
SSL_CERT # SSL_CERT #
SSL_CIPHER # SSL_CIPHER #
SSL_CRL #
SSL_CRLPATH #
SSL_KEY # SSL_KEY #
select @@log_queries_not_using_indexes; select @@log_queries_not_using_indexes;
@@log_queries_not_using_indexes @@log_queries_not_using_indexes

View File

@ -0,0 +1,10 @@
-----BEGIN X509 CRL-----
MIIBbDCB1gIBATANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJCRzEQMA4GA1UE
CBMHUGxvdmRpdjEPMA0GA1UEChMGT3JhY2xlMQ4wDAYDVQQLEwVNeVNRTDEmMCQG
A1UEAxMdTXlTUUwgQ1JMIHRlc3QgQ0EgY2VydGlmaWNhdGUXDTExMDgxOTEwMDQ1
MFoXDTE3MDIwODEwMDQ1MFowKjAoAgkApYXsYLFoRCQXDTExMDYxNzA3Mzc1OVow
DDAKBgNVHRUEAwoBBaAOMAwwCgYDVR0UBAMCAQMwDQYJKoZIhvcNAQEFBQADgYEA
BXAwYBjHUHG6MQ22/+1hvOaRtSYfj/E5bhKbBB8JlKSRFO+xIOF2i2H1AigunWpC
R10NicSS7qjsr6yDyBaywZmi0TCNGksR7b3m1m97RnhrxkVRlr/i7L+o04ZwWo/b
z9zoTX6RTj8rHgQtEdIOi/EArCvDv+wqYmkI+XMScGI=
-----END X509 CRL-----

View File

@ -0,0 +1,10 @@
-----BEGIN X509 CRL-----
MIIBbDCB1gIBATANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJCRzEQMA4GA1UE
CBMHUGxvdmRpdjEPMA0GA1UEChMGT3JhY2xlMQ4wDAYDVQQLEwVNeVNRTDEmMCQG
A1UEAxMdTXlTUUwgQ1JMIHRlc3QgQ0EgY2VydGlmaWNhdGUXDTExMDgxOTEwMDQ1
MFoXDTE3MDIwODEwMDQ1MFowKjAoAgkApYXsYLFoRCQXDTExMDYxNzA3Mzc1OVow
DDAKBgNVHRUEAwoBBaAOMAwwCgYDVR0UBAMCAQMwDQYJKoZIhvcNAQEFBQADgYEA
BXAwYBjHUHG6MQ22/+1hvOaRtSYfj/E5bhKbBB8JlKSRFO+xIOF2i2H1AigunWpC
R10NicSS7qjsr6yDyBaywZmi0TCNGksR7b3m1m97RnhrxkVRlr/i7L+o04ZwWo/b
z9zoTX6RTj8rHgQtEdIOi/EArCvDv+wqYmkI+XMScGI=
-----END X509 CRL-----

View File

@ -10,3 +10,22 @@
# #
############################################################################## ##############################################################################
hostcache_ipv6_addrinfo_again_allow: Need --bind-addr
hostcache_ipv6_addrinfo_again_deny: Need --bind-addr
hostcache_ipv6_addrinfo_bad_allow: Need --bind-addr
hostcache_ipv6_addrinfo_bad_deny: Need --bind-addr
hostcache_ipv6_addrinfo_good_allow: Need --bind-addr
hostcache_ipv6_addrinfo_good_deny: Need --bind-addr
hostcache_ipv6_addrinfo_noname_allow: Need --bind-addr
hostcache_ipv6_addrinfo_noname_deny: Need --bind-addr
hostcache_ipv6_auth_plugin: Need --bind-addr
hostcache_ipv6_blocked: Need --bind-addr
hostcache_ipv6_max_con: Need --bind-addr
hostcache_ipv6_nameinfo_again_allow: Need --bind-addr
hostcache_ipv6_nameinfo_again_deny: Need --bind-addr
hostcache_ipv6_nameinfo_noname_allow: Need --bind-addr
hostcache_ipv6_nameinfo_noname_deny: Need --bind-addr
hostcache_ipv6_passwd: Need --bind-addr
hostcache_ipv6_ssl: Need --bind-addr
hostcache_ipv4_auth_plugin: need hostcache
hostcache_ipv6_auth_plugin: need hostcache

View File

@ -0,0 +1,27 @@
# Tests for the performance schema
# =====================================
# HELPER include/connection_cleanup.inc
# =====================================
--disable_query_log
revoke all privileges, grant option from user1@localhost;
revoke all privileges, grant option from user2@localhost;
revoke all privileges, grant option from user3@localhost;
revoke all privileges, grant option from user4@localhost;
revoke all privileges, grant option from user5@localhost;
drop user user1@localhost;
drop user user2@localhost;
drop user user3@localhost;
drop user user4@localhost;
drop user user5@localhost;
flush privileges;
drop procedure dump_all;
truncate table performance_schema.accounts;
truncate table performance_schema.users;
truncate table performance_schema.hosts;
--enable_query_log

View File

@ -0,0 +1,210 @@
# Tests for the performance schema
# =======================================
# HELPER include/connection_load.inc
# =======================================
call dump_all();
connect (con1a, localhost, user1, , );
select "user1 in con1a" as status;
call dump_all();
connect (con1b, localhost, user1, , );
select "user1 in con1b" as status;
call dump_all();
connect (con1c, localhost, user1, , );
select "user1 in con1c" as status;
call dump_all();
connect (con2a, localhost, user2, , );
select "user2 in con2a" as status;
call dump_all();
connect (con2b, localhost, user2, , );
select "user2 in con2b" as status;
call dump_all();
connect (con2c, localhost, user2, , );
select "user2 in con2c" as status;
call dump_all();
connect (con3a, localhost, user3, , );
select "user3 in con3a" as status;
call dump_all();
connect (con3b, localhost, user3, , );
select "user3 in con3b" as status;
call dump_all();
connect (con3c, localhost, user3, , );
select "user3 in con3c" as status;
call dump_all();
--connection default
--disconnect con1a
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 8 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc
select "con1a disconnected" as status;
call dump_all();
--disconnect con2a
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 7 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc
select "con2a disconnected" as status;
call dump_all();
--disconnect con3a
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 6 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc
select "con3a disconnected" as status;
call dump_all();
truncate table performance_schema.accounts;
call dump_all();
truncate table performance_schema.users;
call dump_all();
truncate table performance_schema.hosts;
call dump_all();
connect (con4a, localhost, user4, , );
select "user4 in con4a" as status;
call dump_all();
connect (con4b, localhost, user4, , );
select "user4 in con4b" as status;
call dump_all();
connect (con4c, localhost, user4, , );
select "user4 in con4c" as status;
call dump_all();
--connection default
--disconnect con1b
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 8 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc
select "con1b disconnected" as status;
call dump_all();
--disconnect con2b
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 7 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc
select "con2b disconnected" as status;
call dump_all();
--disconnect con3b
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 6 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc
select "con3b disconnected" as status;
call dump_all();
--disconnect con1c
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 5 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc
select "con1c disconnected" as status;
call dump_all();
--disconnect con2c
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 4 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc
select "con2c disconnected" as status;
call dump_all();
--disconnect con3c
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 3 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc
select "con3c disconnected" as status;
call dump_all();
truncate table performance_schema.accounts;
call dump_all();
truncate table performance_schema.users;
call dump_all();
truncate table performance_schema.hosts;
call dump_all();
connect (con5a, localhost, user5, , );
select "user5 in con5a" as status;
call dump_all();
connect (con5b, localhost, user5, , );
select "user5 in con5b" as status;
call dump_all();
connect (con5c, localhost, user5, , );
select "user5 in con5c" as status;
call dump_all();
--connection default
--disconnect con4a
--disconnect con4b
--disconnect con4c
--disconnect con5a
--disconnect con5b
--disconnect con5c
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 0 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER like 'user%';
--source include/wait_condition.inc
select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
call dump_all();
truncate table performance_schema.hosts;
call dump_all();
truncate table performance_schema.users;
call dump_all();
truncate table performance_schema.accounts;
call dump_all();

View File

@ -0,0 +1,109 @@
# Tests for the performance schema
# =============
# DOCUMENTATION
# =============
# Verify how connections are counted into various tables:
# - accounts
# - users
# - hosts
#
# The tests are written with the following helpers:
# - include/connection_setup.inc
# - include/connection_load.inc
# - include/connection_cleanup.inc
#
# Helpers are intended to be used as follows.
#
# A Typical test t/connection_xxx.test will consist of:
# --source ../include/connection_setup.inc
# --source ../include/connection_load.inc
# --source ../include/connection_cleanup.inc
# and a t/connection_xxx-master.opt file
#
# Naming conventions for t/connection_xxx.test are as follows:
# t/connection_<account><user><host>
#
# <account> corresponds to different sizing settings for
# the variable performance-schema-accounts-size
# - (blank): accounts-size sufficient to represent all records
# - 3a: accounts-size set to 3
# - no_a: accounts-size set to 0
#
# <user> corresponds to different sizing settings for
# the variable performance-schema-users-size
# - (blank): users-size sufficient to represent all records
# - 3u: users-size set to 3
# - no_u: users-size set to 0
#
# <host> corresponds to different sizing settings for
# the variable performance-schema-hosts-size
# - (blank): hosts-size sufficient to represent all records
# - no_h: hosts-size set to 0
# ========================================
# HELPER include/event_aggregate_setup.inc
# ========================================
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source ../include/no_protocol.inc
--source ../include/wait_for_pfs_thread_count.inc
--disable_query_log
grant ALL on *.* to user1@localhost;
grant ALL on *.* to user2@localhost;
grant ALL on *.* to user3@localhost;
grant ALL on *.* to user4@localhost;
grant ALL on *.* to user5@localhost;
flush privileges;
# Purge old users, hosts, user/host from previous tests
truncate table performance_schema.accounts;
truncate table performance_schema.users;
truncate table performance_schema.hosts;
# Save the setup
# Start from a known clean state, to avoid noise from previous tests
flush tables;
flush status;
--disable_warnings
drop procedure if exists dump_all;
--enable_warnings
delimiter $$;
create procedure dump_all()
begin
select processlist_user, processlist_host
from performance_schema.threads
where (processlist_user is not null) and (processlist_host is not null)
order by processlist_user;
select * from performance_schema.accounts
where (user is not null) and (host is not null)
order by user, host;
select * from performance_schema.users
where user is not null
order by user;
select * from performance_schema.hosts
where host is not null
order by host;
select variable_name, variable_value from information_schema.global_status
where variable_name in ('PERFORMANCE_SCHEMA_ACCOUNTS_LOST',
'PERFORMANCE_SCHEMA_USERS_LOST',
'PERFORMANCE_SCHEMA_HOSTS_LOST');
end
$$
delimiter ;$$
--enable_query_log

View File

@ -0,0 +1,11 @@
--echo ####################################
--echo # CLEANUP
--echo ####################################
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
DROP TABLE IF EXISTS t4;
DROP TABLE IF EXISTS t5;
DROP DATABASE IF EXISTS statements_digest;
--enable_warnings

View File

@ -0,0 +1,86 @@
--echo ####################################
--echo # EXECUTION
--echo ####################################
# -----------------------------------
# SQL Queries to test normalizations.
# -----------------------------------
SELECT 1 FROM t1;
SELECT 1 FROM `t1`;
SELECT 1,2 FROM t1;
SELECT 1, 2, 3, 4 FROM t1;
SELECT 1 FROM t2;
SELECT 1,2 FROM t2;
SELECT 1, 2, 3, 4 FROM t2;
# (NUM) => (#)
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
# (NUM,NUM) => (#,#)
INSERT INTO t3 VALUES (1, 2);
INSERT INTO t4 VALUES (1, 2);
# (NUM,NUM,NUM) => (#,#)
INSERT INTO t5 VALUES (1, 2, 3);
# (NUM),(NUM) => (#),(#)
INSERT INTO t1 VALUES (1), (2), (3);
# (NUM),(NUM),(NUM) => (#),(#)
INSERT INTO t1 VALUES (1), (2), (3), (4);
# (NUM,NUM),(NUM,NUM) => (#,#),(#,#)
INSERT INTO t3 VALUES (1, 2), (3, 4), (5, 6);
# (NUM,NUM,NUM),(NUM,NUM,NUM),(NUM,NUM,NUM) => (#,#),(#,#)
INSERT INTO t5 VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);
# -----------------------------------------------------------------------
# Test case for handling spaces in statement.
# -----------------------------------------------------------------------
SELECT 1 + 1;
# -----------------------------------------------------------------------
# Test case for handling comments.
# -----------------------------------------------------------------------
# comment starting with "--"
# TODO : SELECT 1; -- This comment continues to the end of line
# comment starting from "#"
SELECT 1; # This comment continues to the end of line
# Inline comment
SELECT 1 /* This is an inline comment */ + 1;
# Multiple line comments
SELECT 1+
/*
this is a
multiple-line comment
*/
1;
# -----------------------------------------------------------------------
# Tests to show how the digest behaves with tokens that can have multiple
# names (such as DATABASE = "DATABASE" or "SCHEMA", SUBSTRING, STD_SYM,
# VARIANCE_SYM ... )
# -----------------------------------------------------------------------
--disable_warnings
CREATE SCHEMA statements_digest_temp;
DROP SCHEMA statements_digest_temp;
CREATE DATABASE statements_digest_temp;
DROP DATABASE statements_digest_temp;
# TODO : add more
--enable_warnings
# -----------------------------------------------------------------------
# Test case to show stats for statements giving ERRORS/WARNINGS, are also
# captured.
# -----------------------------------------------------------------------
--ERROR ER_NO_SUCH_TABLE
SELECT 1 from t11;
create table t11 (c char(4));
--ERROR ER_TABLE_EXISTS_ERROR
create table t11 (c char(4));
insert into t11 values("MySQL");

View File

@ -0,0 +1,21 @@
# Making sure not to run when ps-protocol is set.
--source ../include/no_protocol.inc
--echo ####################################
--echo # SETUP
--echo ####################################
# Database setup
--disable_warnings
CREATE DATABASE statements_digest;
--enable_warnings
USE statements_digest;
# Table set up for queries
--disable_warnings
CREATE TABLE t1(a int);
CREATE TABLE t2(a int);
CREATE TABLE t3(a int, b int);
CREATE TABLE t4(a int, b int);
CREATE TABLE t5(a int, b int, c int);
--enable_warnings

View File

@ -0,0 +1,57 @@
# Tests for the performance schema
# ==========================================
# HELPER include/event_aggregate_cleanup.inc
# ==========================================
--disable_query_log
revoke all privileges, grant option from user1@localhost;
revoke all privileges, grant option from user2@localhost;
revoke all privileges, grant option from user3@localhost;
revoke all privileges, grant option from user4@localhost;
drop user user1@localhost;
drop user user2@localhost;
drop user user3@localhost;
drop user user4@localhost;
flush privileges;
drop procedure dump_thread;
drop procedure dump_one_thread;
drop prepare dump_waits_account;
drop prepare dump_waits_user;
drop prepare dump_waits_host;
drop prepare dump_waits_history;
drop prepare dump_waits_global;
drop prepare dump_stages_account;
drop prepare dump_stages_user;
drop prepare dump_stages_host;
drop prepare dump_stages_history;
drop prepare dump_stages_global;
drop prepare dump_statements_account;
drop prepare dump_statements_user;
drop prepare dump_statements_host;
drop prepare dump_statements_history;
drop prepare dump_statements_global;
drop prepare dump_users;
drop prepare dump_hosts;
drop prepare dump_accounts;
truncate table performance_schema.accounts;
truncate table performance_schema.users;
truncate table performance_schema.hosts;
truncate table performance_schema.setup_actors;
insert into performance_schema.setup_actors
select * from test.setup_actors;
drop table test.setup_actors;
drop table test.t1;
update performance_schema.threads set instrumented='YES';
update performance_schema.setup_instruments set enabled='YES', timed='YES';
--enable_query_log

View File

@ -0,0 +1,883 @@
# Tests for the performance schema
# =======================================
# HELPER include/event_aggregate_load.inc
# =======================================
echo "================== Step 1 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
# Notes about this test
#
# Each connect causes 2 wait/synch/mutex/sql/LOCK_connection_count events:
# - 1 in mysqld.cc, create_new_thread(), for the main thread
# - 1 in sql_connect.cc, check_user(), for the connected thread
# The main thread does not count for BY_ACCOUNT / BY_HOST.
# The user thread does count for BY_ACCOUNT, BY_HOST
#
# Each get_lock() causes 1 wait/synch/mutex/sql/LOCK_user_locks
#
# To avoid noise from main, the background threads are disabled.
connect (con1, localhost, user1, , );
echo "================== con1 connected ==================";
--connection default
# Wait for the connect to complete
let $wait_condition=
select count(*) = 1 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user1';
--source include/wait_condition.inc
echo "================== Step 2 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
--connection con1
select get_lock("marker", 10);
select release_lock("marker");
insert into test.t1 values ("marker");
echo "================== con1 marker ==================";
--connection default
echo "================== Step 3 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
# Debugging helpers
# select * from performance_schema.events_waits_history_long;
# select PROCESSLIST_USER, PROCESSLIST_HOST, INSTRUMENTED from performance_schema.threads;
connect (con2, localhost, user2, , );
echo "================== con2 connected ==================";
--connection default
# Wait for the connect to complete
let $wait_condition=
select count(*) = 1 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user2';
--source include/wait_condition.inc
echo "================== Step 4 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
--connection con2
select get_lock("marker", 10);
select release_lock("marker");
insert into test.t1 values ("marker");
echo "================== con2 marker ==================";
--connection default
echo "================== Step 5 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
connect (con3, localhost, user3, , );
echo "================== con3 connected ==================";
--connection default
# Wait for the connect to complete
let $wait_condition=
select count(*) = 1 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user3';
--source include/wait_condition.inc
echo "================== Step 6 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
--connection con3
select get_lock("marker", 10);
select release_lock("marker");
insert into test.t1 values ("marker");
echo "================== con3 marker ==================";
--connection default
echo "================== Step 7 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
connect (con4, localhost, user4, , );
echo "================== con4 connected ==================";
--connection default
# Wait for the connect to complete
let $wait_condition=
select count(*) = 1 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user4';
--source include/wait_condition.inc
echo "================== Step 8 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
--connection con4
select get_lock("marker", 10);
select release_lock("marker");
insert into test.t1 values ("marker");
echo "================== con4 marker ==================";
--connection default
echo "================== Step 9 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
--disconnect con1
--connection default
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 0 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user1';
--source include/wait_condition.inc
echo "================== con1 disconnected ==================";
echo "================== Step 10 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
--disconnect con2
--connection default
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 0 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user2';
--source include/wait_condition.inc
echo "================== con2 disconnected ==================";
echo "================== Step 11 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
--disconnect con3
--connection default
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 0 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user3';
--source include/wait_condition.inc
echo "================== con3 disconnected ==================";
echo "================== Step 12 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
--disconnect con4
--connection default
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 0 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user4';
--source include/wait_condition.inc
echo "================== con4 disconnected ==================";
echo "================== Step 13 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
--connection default
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
echo "================== WAITS_BY_THREAD truncated ==================";
echo "================== Step 14 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_waits_summary_by_account_by_event_name;
echo "================== WAITS_BY_ACCOUNT truncated ==================";
echo "================== Step 15 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_waits_summary_by_user_by_event_name;
echo "================== WAITS_BY_USER truncated ==================";
echo "================== Step 16 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
echo "================== WAITS_BY_HOST truncated ==================";
echo "================== Step 17 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_waits_summary_global_by_event_name;
echo "================== WAITS_GLOBAL truncated ==================";
echo "================== Step 18 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_stages_summary_by_thread_by_event_name;
echo "================== STAGES_BY_THREAD truncated ==================";
echo "================== Step 19 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_stages_summary_by_account_by_event_name;
echo "================== STAGES_BY_ACCOUNT truncated ==================";
echo "================== Step 20 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_stages_summary_by_user_by_event_name;
echo "================== STAGES_BY_USER truncated ==================";
echo "================== Step 21 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_stages_summary_by_host_by_event_name;
echo "================== STAGES_BY_HOST truncated ==================";
echo "================== Step 22 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_stages_summary_global_by_event_name;
echo "================== STAGES_GLOBAL truncated ==================";
echo "================== Step 23 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_statements_summary_by_thread_by_event_name;
echo "================== STATEMENTS_BY_THREAD truncated ==================";
echo "================== Step 24 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_statements_summary_by_account_by_event_name;
echo "================== STATEMENTS_BY_ACCOUNT truncated ==================";
echo "================== Step 25 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_statements_summary_by_user_by_event_name;
echo "================== STATEMENTS_BY_USER truncated ==================";
echo "================== Step 26 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_statements_summary_by_host_by_event_name;
echo "================== STATEMENTS_BY_HOST truncated ==================";
echo "================== Step 27 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.events_statements_summary_global_by_event_name;
echo "================== STATEMENTS_GLOBAL truncated ==================";
echo "================== Step 28 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.accounts;
echo "================== ACCOUNTS truncated ==================";
echo "================== Step 29 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.users;
echo "================== USERS truncated ==================";
echo "================== Step 30 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;
truncate performance_schema.hosts;
echo "================== HOSTS truncated ==================";
echo "================== Step 31 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_stages_account;
execute dump_stages_user;
execute dump_stages_host;
execute dump_stages_global;
execute dump_stages_history;
execute dump_statements_account;
execute dump_statements_user;
execute dump_statements_host;
execute dump_statements_global;
execute dump_statements_history;
execute dump_accounts;
execute dump_users;
execute dump_hosts;

View File

@ -0,0 +1,347 @@
# Tests for the performance schema
# =============
# DOCUMENTATION
# =============
# Verify how events are aggregated into various tables
#
# In the thread dimension:
# - events_waits_summary_by_thread_by_event_name
# - events_waits_summary_by_account_by_event_name
# - events_waits_summary_by_user_by_event_name
# - events_waits_summary_by_host_by_event_name
# - events_stages_summary_by_thread_by_event_name
# - events_stages_summary_by_account_by_event_name
# - events_stages_summary_by_user_by_event_name
# - events_stages_summary_by_host_by_event_name
# - events_statements_summary_by_thread_by_event_name
# - events_statements_summary_by_account_by_event_name
# - events_statements_summary_by_user_by_event_name
# - events_statements_summary_by_host_by_event_name
#
# Globally:
# - events_waits_summary_global_by_event_name
# - events_stages_summary_global_by_event_name
# - events_statements_summary_global_by_event_name
#
# The tests are written with the following helpers:
# - include/event_aggregate_setup.inc
# - include/event_aggregate_load.inc
# - include/event_aggregate_cleanup.inc
#
# Helpers are intended to be used as follows.
#
# A Typical test t/event_aggregate_xxx.test will consist of:
# --source ../include/event_aggregate_setup.inc
# --source ../include/event_aggregate_load.inc
# --source ../include/event_aggregate_cleanup.inc
# and a t/event_aggregate_xxx-master.opt file
#
# Naming conventions for t/event_aggregate_xxx.test are as follows:
# t/event_aggregate_<account><user><host>
#
# <account> corresponds to different sizing settings for
# the variable performance-schema-accounts-size
# - (blank): accounts-size sufficient to represent all records
# - no_a: accounts-size set to 0
#
# <user> corresponds to different sizing settings for
# the variable performance-schema-users-size
# - (blank): users-size sufficient to represent all records
# - no_u: users-size set to 0
#
# <host> corresponds to different sizing settings for
# the variable performance-schema-hosts-size
# - (blank): hosts-size sufficient to represent all records
# - no_h: hosts-size set to 0
# ========================================
# HELPER include/event_aggregate_setup.inc
# ========================================
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source ../include/no_protocol.inc
--source ../include/wait_for_pfs_thread_count.inc
--disable_query_log
grant ALL on *.* to user1@localhost;
grant ALL on *.* to user2@localhost;
grant ALL on *.* to user3@localhost;
grant ALL on *.* to user4@localhost;
flush privileges;
# Purge old users, hosts, user/host from previous tests
truncate table performance_schema.accounts;
truncate table performance_schema.users;
truncate table performance_schema.hosts;
# Save the setup
--disable_warnings
drop table if exists test.setup_actors;
drop table if exists test.t1;
--enable_warnings
create table test.t1(a varchar(64));
create table test.setup_actors as
select * from performance_schema.setup_actors;
# Only instrument the user connections
truncate table performance_schema.setup_actors;
insert into performance_schema.setup_actors
set host= 'localhost', user= 'user1', role= '%';
insert into performance_schema.setup_actors
set host= 'localhost', user= 'user2', role= '%';
insert into performance_schema.setup_actors
set host= 'localhost', user= 'user3', role= '%';
insert into performance_schema.setup_actors
set host= 'localhost', user= 'user4', role= '%';
update performance_schema.threads set instrumented='NO';
# Only instrument a few events of each kind
update performance_schema.setup_instruments set enabled='NO', timed='NO';
update performance_schema.setup_instruments set enabled='YES', timed='YES'
where name in ('wait/synch/mutex/sql/LOCK_connection_count',
'wait/synch/mutex/sql/LOCK_user_locks',
'wait/synch/rwlock/sql/LOCK_grant',
'wait/io/file/sql/query_log');
update performance_schema.setup_instruments set enabled='YES', timed='YES'
where name in ('stage/sql/init',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables');
update performance_schema.setup_instruments set enabled='YES', timed='YES'
where name in ('statement/sql/select',
'statement/sql/insert',
'statement/com/',
'statement/com/Query',
'statement/com/Quit',
'statement/com/error');
# Start from a known clean state, to avoid noise from previous tests
flush tables;
flush status;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
truncate performance_schema.events_waits_summary_by_account_by_event_name;
truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
truncate performance_schema.events_stages_summary_by_thread_by_event_name;
truncate performance_schema.events_stages_summary_by_account_by_event_name;
truncate performance_schema.events_stages_summary_by_user_by_event_name;
truncate performance_schema.events_stages_summary_by_host_by_event_name;
truncate performance_schema.events_stages_summary_global_by_event_name;
truncate performance_schema.events_stages_history_long;
truncate performance_schema.events_statements_summary_by_thread_by_event_name;
truncate performance_schema.events_statements_summary_by_account_by_event_name;
truncate performance_schema.events_statements_summary_by_user_by_event_name;
truncate performance_schema.events_statements_summary_by_host_by_event_name;
truncate performance_schema.events_statements_summary_global_by_event_name;
truncate performance_schema.events_statements_history_long;
--disable_warnings
drop procedure if exists dump_thread;
drop procedure if exists dump_one_thread;
--enable_warnings
delimiter $$;
create procedure dump_thread()
begin
call dump_one_thread('user1');
call dump_one_thread('user2');
call dump_one_thread('user3');
call dump_one_thread('user4');
end
$$
create procedure dump_one_thread(in username varchar(64))
begin
declare my_thread_id int;
set my_thread_id = (select thread_id from performance_schema.threads
where processlist_user=username);
if (my_thread_id is not null) then
select username, event_name, count_star
from performance_schema.events_waits_summary_by_thread_by_event_name
where event_name in ('wait/synch/mutex/sql/LOCK_connection_count',
'wait/synch/mutex/sql/LOCK_user_locks',
'wait/synch/rwlock/sql/LOCK_grant',
'wait/io/file/sql/query_log')
and thread_id = my_thread_id
order by event_name;
else
select username, "not found" as status;
end if;
end
$$
delimiter ;$$
prepare dump_waits_account from
"select user, host, event_name, count_star
from performance_schema.events_waits_summary_by_account_by_event_name
where user like \'user%\'
and event_name in ('wait/synch/mutex/sql/LOCK_connection_count',
'wait/synch/mutex/sql/LOCK_user_locks',
'wait/synch/rwlock/sql/LOCK_grant',
'wait/io/file/sql/query_log')
order by user, host, event_name;";
prepare dump_waits_user from
"select user, event_name, count_star
from performance_schema.events_waits_summary_by_user_by_event_name
where user like \'user%\'
and event_name in ('wait/synch/mutex/sql/LOCK_connection_count',
'wait/synch/mutex/sql/LOCK_user_locks',
'wait/synch/rwlock/sql/LOCK_grant',
'wait/io/file/sql/query_log')
order by user, event_name;";
prepare dump_waits_host from
"select host, event_name, count_star
from performance_schema.events_waits_summary_by_host_by_event_name
where host=\'localhost\'
and event_name in ('wait/synch/mutex/sql/LOCK_connection_count',
'wait/synch/mutex/sql/LOCK_user_locks',
'wait/synch/rwlock/sql/LOCK_grant',
'wait/io/file/sql/query_log')
order by host, event_name;";
prepare dump_waits_global from
"select event_name, count_star
from performance_schema.events_waits_summary_global_by_event_name
where event_name in ('wait/synch/mutex/sql/LOCK_connection_count',
'wait/synch/mutex/sql/LOCK_user_locks',
'wait/synch/rwlock/sql/LOCK_grant',
'wait/io/file/sql/query_log')
order by event_name;";
prepare dump_waits_history from
"select event_name, count(event_name)
from performance_schema.events_waits_history_long
where event_name in ('wait/synch/mutex/sql/LOCK_connection_count',
'wait/synch/mutex/sql/LOCK_user_locks',
'wait/synch/rwlock/sql/LOCK_grant',
'wait/io/file/sql/query_log')
group by event_name order by event_name;";
prepare dump_stages_account from
"select user, host, event_name, count_star
from performance_schema.events_stages_summary_by_account_by_event_name
where user like \'user%\'
and event_name in ('stage/sql/init',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
order by user, host, event_name;";
prepare dump_stages_user from
"select user, event_name, count_star
from performance_schema.events_stages_summary_by_user_by_event_name
where user like \'user%\'
and event_name in ('stage/sql/init',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
order by user, event_name;";
prepare dump_stages_host from
"select host, event_name, count_star
from performance_schema.events_stages_summary_by_host_by_event_name
where host=\'localhost\'
and event_name in ('stage/sql/init',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
order by host, event_name;";
prepare dump_stages_global from
"select event_name, count_star
from performance_schema.events_stages_summary_global_by_event_name
where event_name in ('stage/sql/init',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
order by event_name;";
prepare dump_stages_history from
"select event_name, count(event_name)
from performance_schema.events_stages_history_long
where event_name in ('stage/sql/init',
'stage/sql/checking permissions',
'stage/sql/Opening tables',
'stage/sql/closing tables')
group by event_name order by event_name;";
prepare dump_statements_account from
"select user, host, event_name, count_star
from performance_schema.events_statements_summary_by_account_by_event_name
where user like \'user%\'
and event_name in ('statement/sql/select',
'statement/sql/insert',
'statement/com/Quit',
'statement/com/error')
order by user, host, event_name;";
prepare dump_statements_user from
"select user, event_name, count_star
from performance_schema.events_statements_summary_by_user_by_event_name
where user like \'user%\'
and event_name in ('statement/sql/select',
'statement/sql/insert',
'statement/com/Quit',
'statement/com/error')
order by user, event_name;";
prepare dump_statements_host from
"select host, event_name, count_star
from performance_schema.events_statements_summary_by_host_by_event_name
where host=\'localhost\'
and event_name in ('statement/sql/select',
'statement/sql/insert',
'statement/com/Quit',
'statement/com/error')
order by host, event_name;";
prepare dump_statements_global from
"select event_name, count_star
from performance_schema.events_statements_summary_global_by_event_name
where event_name in ('statement/sql/select',
'statement/sql/insert',
'statement/com/Quit',
'statement/com/error')
order by event_name;";
prepare dump_statements_history from
"select event_name, count(event_name)
from performance_schema.events_statements_history_long
where event_name in ('statement/sql/select',
'statement/sql/insert',
'statement/com/Quit',
'statement/com/error')
group by event_name order by event_name;";
prepare dump_users from
"select * from performance_schema.users where user is not null order by user;";
prepare dump_hosts from
"select * from performance_schema.hosts where host is not null order by host;";
prepare dump_accounts from
"select * from performance_schema.accounts where (user is not null) and (host is not null) order by user, host;";
--enable_query_log

View File

@ -0,0 +1,39 @@
# Helper for hostcache_*.test
--echo "Dumping performance_schema.host_cache"
--disable_query_log
--vertical_results
select
IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
COUNT_HOST_BLOCKED_ERRORS,
COUNT_NAMEINFO_TRANSIENT_ERRORS,
COUNT_NAMEINFO_PERMANENT_ERRORS,
COUNT_FORMAT_ERRORS,
COUNT_ADDRINFO_TRANSIENT_ERRORS,
COUNT_ADDRINFO_PERMANENT_ERRORS,
COUNT_FCRDNS_ERRORS,
COUNT_HOST_ACL_ERRORS,
COUNT_NO_AUTH_PLUGIN_ERRORS,
COUNT_AUTH_PLUGIN_ERRORS,
COUNT_HANDSHAKE_ERRORS,
COUNT_PROXY_USER_ERRORS,
COUNT_PROXY_USER_ACL_ERRORS,
COUNT_AUTHENTICATION_ERRORS,
COUNT_SSL_ERRORS,
COUNT_MAX_USER_CONNECTIONS_ERRORS,
COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS,
COUNT_DEFAULT_DATABASE_ERRORS,
COUNT_INIT_CONNECT_ERRORS,
COUNT_LOCAL_ERRORS,
COUNT_UNKNOWN_ERRORS,
if (FIRST_ERROR_SEEN is not null,
if (FIRST_ERROR_SEEN > date("2012-01-01"), "set", "wrong epoch"),
"null") as FIRST_ERROR_SEEN,
if (LAST_ERROR_SEEN is not null,
if (FIRST_ERROR_SEEN > date("2012-01-01"), "set", "wrong epoch"),
"null") as LAST_ERROR_SEEN
from performance_schema.host_cache;
--horizontal_results
--enable_query_log

View File

@ -0,0 +1,10 @@
# Tests for the performance schema
# The file with expected results fits only to a run without
# ps-protocol/sp-protocol/cursor-protocol/view-protocol.
if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL
+ $VIEW_PROTOCOL > 0`)
{
--skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
}

View File

@ -0,0 +1,112 @@
# Tests for PERFORMANCE_SCHEMA
# Make sure mysql_upgrade does not destroy data in a 'performance_schema'
# database.
#
# Some initial settings + Preemptive cleanup
let $MYSQLD_DATADIR= `SELECT @@datadir`;
let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade.err;
let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade.out;
--error 0,1
--remove_file $out_file
--error 0,1
--remove_file $err_file
--disable_warnings
drop table if exists test.user_table;
drop procedure if exists test.user_proc;
drop function if exists test.user_func;
drop event if exists test.user_event;
--enable_warnings
--echo "Testing mysql_upgrade with TABLE performance_schema.user_table"
create table test.user_table(a int);
--error 0,1
--remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
--copy_file $MYSQLD_DATADIR/test/user_table.frm $MYSQLD_DATADIR/performance_schema/user_table.frm
# Make sure the table is visible
use performance_schema;
show tables like "user_table";
--source suite/perfschema/include/upgrade_check.inc
# Make sure the table is still visible
show tables like "user_table";
use test;
--remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm
drop table test.user_table;
--echo "Testing mysql_upgrade with VIEW performance_schema.user_view"
create view test.user_view as select "Not supposed to be here";
--error 0,1
--remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
--copy_file $MYSQLD_DATADIR/test/user_view.frm $MYSQLD_DATADIR/performance_schema/user_view.frm
# Make sure the view is visible
use performance_schema;
show tables like "user_view";
--source suite/perfschema/include/upgrade_check.inc
# Make sure the view is still visible
show tables like "user_view";
use test;
--remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm
drop view test.user_view;
--echo "Testing mysql_upgrade with PROCEDURE performance_schema.user_proc"
create procedure test.user_proc()
select "Not supposed to be here";
update mysql.proc set db='performance_schema' where name='user_proc';
--source suite/perfschema/include/upgrade_check.inc
select name from mysql.proc where db='performance_schema';
update mysql.proc set db='test' where name='user_proc';
drop procedure test.user_proc;
--echo "Testing mysql_upgrade with FUNCTION performance_schema.user_func"
create function test.user_func() returns integer
return 0;
update mysql.proc set db='performance_schema' where name='user_func';
--source suite/perfschema/include/upgrade_check.inc
select name from mysql.proc where db='performance_schema';
update mysql.proc set db='test' where name='user_func';
drop function test.user_func;
--echo "Testing mysql_upgrade with EVENT performance_schema.user_event"
create event test.user_event on schedule every 1 day do
select "not supposed to be here";
update mysql.event set db='performance_schema' where name='user_event';
--source suite/perfschema/include/upgrade_check.inc
select name from mysql.event where db='performance_schema';
update mysql.event set db='test' where name='user_event';
drop event test.user_event;

View File

@ -0,0 +1,60 @@
# Tests for PERFORMANCE_SCHEMA
# Show existing objects and information about their structure
show databases like 'performance_schema';
show create database performance_schema;
use performance_schema;
show tables;
show create table accounts;
show create table cond_instances;
show create table events_stages_current;
show create table events_stages_history;
show create table events_stages_history_long;
show create table events_stages_summary_by_host_by_event_name;
show create table events_stages_summary_by_thread_by_event_name;
show create table events_stages_summary_by_user_by_event_name;
show create table events_stages_summary_by_account_by_event_name;
show create table events_stages_summary_global_by_event_name;
show create table events_statements_current;
show create table events_statements_history;
show create table events_statements_history_long;
show create table events_statements_summary_by_host_by_event_name;
show create table events_statements_summary_by_thread_by_event_name;
show create table events_statements_summary_by_user_by_event_name;
show create table events_statements_summary_by_account_by_event_name;
show create table events_statements_summary_global_by_event_name;
show create table events_waits_current;
show create table events_waits_history;
show create table events_waits_history_long;
show create table events_waits_summary_by_host_by_event_name;
show create table events_waits_summary_by_instance;
show create table events_waits_summary_by_thread_by_event_name;
show create table events_waits_summary_by_user_by_event_name;
show create table events_waits_summary_by_account_by_event_name;
show create table events_waits_summary_global_by_event_name;
show create table file_instances;
show create table file_summary_by_event_name;
show create table file_summary_by_instance;
show create table host_cache;
show create table hosts;
show create table mutex_instances;
show create table objects_summary_global_by_type;
show create table performance_timers;
show create table rwlock_instances;
show create table setup_actors;
show create table setup_consumers;
show create table setup_instruments;
show create table setup_objects;
show create table setup_timers;
show create table socket_instances;
show create table socket_summary_by_instance;
show create table socket_summary_by_event_name;
show create table table_io_waits_summary_by_index_usage;
show create table table_io_waits_summary_by_table;
show create table table_lock_waits_summary_by_table;
show create table threads;
show create table users;

View File

@ -0,0 +1,129 @@
# Example how to use this auxiliary script
#-----------------------------------------
#
### The table/tables used in $part must have the right content.
### $title_prefix is used for the generation of titles
#
# let $title_prefix= 4.3;
### $check_num is used for the generation of titles and gets incremented after
### every call of the current script.
# let $check_num= 1;
### $diff_column_list is used for the generation of error information and valid for
### every sub test.
# let $diff_column_list=
# t2.COUNT_READ - t1.COUNT_READ AS D_COUNT_READ,
# t2.COUNT_READ AS S2_COUNT_READ,
# t1.COUNT_READ AS S1_COUNT_READ,
# t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ AS D_SUM_NUMBER_OF_BYTES_READ,
# t2.SUM_NUMBER_OF_BYTES_READ AS S2_SUM_NUMBER_OF_BYTES_READ,
# t1.SUM_NUMBER_OF_BYTES_READ AS S1_SUM_NUMBER_OF_BYTES_READ,
# t2.COUNT_WRITE - t1.COUNT_WRITE AS D_COUNT_WRITE,
# t2.COUNT_WRITE AS S2_COUNT_WRITE,
# t1.COUNT_WRITE AS S1_COUNT_WRITE,
# t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE AS D_UM_NUMBER_OF_BYTES_WRITE,
# t2.SUM_NUMBER_OF_BYTES_WRITE AS S2_SUM_NUMBER_OF_BYTES_WRITE,
# t1.SUM_NUMBER_OF_BYTES_WRITE AS S1_SUM_NUMBER_OF_BYTES_WRITE,
# t2.COUNT_MISC - t1.COUNT_MISC AS D_COUNT_MISC,
# t2.COUNT_MISC AS S2_COUNT_MISC,
# t1.COUNT_MISC AS S1_COUNT_MISC;
### $part is used for the generation of "check" statements + error information
### and valid for every sub test.
# let $part=
# FROM mysqltest.socket_summary_by_instance_detail t1
# JOIN mysqltest.socket_summary_by_instance_detail t2
# USING (EVENT_NAME, OBJECT_INSTANCE_BEGIN, run)
# WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
# AND EVENT_NAME LIKE ('%client_connection')
# AND run = 1;
#
# --echo # $title_prefix Check the differences caused by SQL statement
#
# let stmt1= SELECT col2 FROM does_not_exist;
# let stmt2= SELECT col2 FROM does_not_exist WHERE col1 = 0;
### $msg is used to generate some explanation of what we compare.
# let $msg=
# # One statement is longer than the other.
# # Both statements fail with the same error message (table does not exist);
# let $my_rules=
# t2.COUNT_READ - t1.COUNT_READ = 0 AND
# t2.SUM_NUMBER_OF_BYTES_READ - t1.SUM_NUMBER_OF_BYTES_READ = LENGTH('$stmt2') - LENGTH('$stmt1') AND
# t2.COUNT_WRITE - t1.COUNT_WRITE = 0 AND
# t2.SUM_NUMBER_OF_BYTES_WRITE - t1.SUM_NUMBER_OF_BYTES_WRITE = 0 AND
# t2.COUNT_MISC - t1.COUNT_MISC = 0;
# --source ../include/socket_check1.inc
#
# let stmt1= ....
# let stmt2= ....
# let $my_rules= ...
# --source ../include/socket_check1.inc
#
# ...
#
--echo # $title_prefix.$check_num Compare impact of statements
--echo # $stmt2
--echo # $stmt1
--echo $msg
# Enable this when extending the checks for SQL statements.
if(0)
{
if (`SELECT CONCAT("$stmt1","$stmt2","$my_rules") LIKE '%_not_set%'`)
{
--echo # INTERNAL ERROR:
--echo # At least one of the variables has no value (is like '%_not_set')
--echo # stmt1 : $stmt1
--echo # stmt2 : $stmt2
--echo # my_rules : $my_rules
--echo # Sorry, have to abort
exit;
}
}
if(`SELECT NOT ( $my_rules )
$part
AND t2.statement = '$stmt2' AND t1.statement = '$stmt1'`)
{
--enable_query_log
--enable_result_log
--echo # The compared statistics looks suspicious
--echo # We expect
--echo $my_rules
--echo
--horizontal_results
eval
SELECT $my_rules AS Expect_1
$part
AND t2.statement = '$stmt2' AND t1.statement = '$stmt1';
--echo
--vertical_results
eval
SELECT $diff_column_list
$part
AND t1.statement = '$stmt1' AND t2.statement = '$stmt2';
--echo
--horizontal_results
eval
SELECT
LPAD(COUNT_READ, 8, ' ') AS CNT_READ,
LPAD(SUM_NUMBER_OF_BYTES_READ, 10,' ') AS BYTES_READ,
LPAD(COUNT_WRITE,9, ' ') AS CNT_WRITE,
LPAD(SUM_NUMBER_OF_BYTES_WRITE, 11,' ') AS BYTES_WRITE,
LPAD(COUNT_MISC, 8, ' ') AS CNT_MISC, statement
FROM mysqltest.socket_summary_by_instance_detail
WHERE OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin
AND EVENT_NAME LIKE ('%client_connection')
AND run = 1
AND statement IN('$stmt2','$stmt1');
let $print_details= 1;
}
# Initialize all variables which depend on the statements to be checked.
# This prevents that we run with wrong data.
let $stmt1= stmt1_not_set;
let $stmt2= stmt2_not_set;
let $my_rules= my_rules_not_set;
let $msg= msg_not_set;
inc $check_num;

View File

@ -0,0 +1,236 @@
# include/socket_event.inc
#
# Auxiliary routine running
# - some statement in connection con1
# or
# - connect/disconnect
# $loop_rounds times and checking if the changes to values caused by the action
# are reasonable.
#
# Requirements:
# 1. Have socket_summary_by_instance_func running
# 2a. Have a connection con1
# @con1_object_instance_begin needs to be the OBJECT_INSTANCE_BEGIN
# value of the "client_connction" entry belonging to con1 within
# socket_summary_by_instance.
# $statement needs to contain the statement to be executed by con1.
# or
# 2b. Have assigned values to the following variables
# $connect_host $connect_db $connect_user
#
let $my_errno= 0;
let $loop_round= 1;
while($loop_round <= $loop_rounds)
{
--disable_query_log
# Collect the current state
#==========================
eval $truncate;
eval $insert_before;
# Run the operation
#==================
if($is_connect)
{
let $statement= Connect (con*,$connect_host,$connect_user,,$connect_db,,);
# Some statements fail with ER_ACCESS_DENIED_ERROR
--disable_abort_on_error
--connect (con$loop_round,$connect_host,$connect_user,,$connect_db,,)
--enable_abort_on_error
let $my_errno= $mysql_errno;
if(!$my_errno)
{
# Note(mleich):
# We are aware that this additional statement is overhead.
# But it ensures that SUM_NUMBER_OF_BYTES_READ and
# SUM_NUMBER_OF_BYTES_WRITE are updated.
# And this avoids the instabilities found when running
# the connect without this additional statement.
DO 1;
}
--connection default
}
if(!$is_connect)
{
--connection con1
# Print the statement outcome once.
if($loop_round == 1)
{
--enable_query_log
--enable_result_log
--horizontal_results
}
# One of the statements to be checked is expected to fail with ER_NO_SUCH_TABLE.
--disable_abort_on_error
eval $statement;
--connection default
--enable_abort_on_error
--disable_query_log
--disable_result_log
}
# Wait till the operation is really finished. We expect that there will be no
# changes to the statistics of the additional connection after this point of time.
#=================================================================================
--connection default
# Variants:
#----------
# 1. Connect failed ($my_errno <> 0)
# no entry in performance_schema.threads -> wait_till_sleep.inc cannot be used
# short life entry in socket_summary_by_instance -> wait till it doesn't exist
# 2. Connect with success ($my_errno = 0)
# entry in performance_schema.threads -> wait_till_sleep.inc can be used
# entry in socket_summary_by_instance -> wait till it does exist
# 3. SQL command failed ($my_errno <> 0)
# entry in performance_schema.threads -> wait_till_sleep.inc can be used
if($is_connect)
{
let $part=
FROM performance_schema.socket_summary_by_instance
WHERE EVENT_NAME LIKE '%client_connection'
AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin;
if(!$my_errno)
{
# Wait till the new connection is visible in performance_schema.threads
# and processlist_command is 'Sleep'.
--source ../include/wait_till_sleep.inc
# A successful connect causes that a new second row in
# performance_schema.socket_summary_by_instance shows up.
# Wait till this row is there.
let $wait_timeout= 10;
let $wait_condition=
SELECT COUNT(*) = 1
$part;
--source include/wait_condition.inc
if (!$success)
{
--echo # Error: We did not reach the expected state where a new
--echo # row in socket_summary_by_instance is visible
eval
SELECT *
$part;
--echo # abort
exit;
}
}
if($my_errno)
{
# Experiments with high parallel load showed that there is a very
# period of time where a "client_connection" entry for a failing
# Connect is visible.
# We hope that sleep 1 is long enough so that PERFORMANCE_SCHEMA
# can remove this row before we collect the after action state.
let $wait_timeou= 5;
let $wait_condition=
SELECT COUNT(*) = 0
$part;
--source include/wait_condition.inc
if(!$success)
{
--echo # Error: We did not reach the expected state.
--echo # A failing connect causes a "client_connection" entry
--echo # within socket_summary_by_instance having an extreme
--echo # short lifetime.
--echo # This entry must have now disappeared.
eval
SELECT *
$part;
--echo # abort
exit;
}
}
# --sleep 3
}
if(!$is_connect)
{
--source ../include/wait_till_sleep.inc
}
# Various checks
#===============
# 1. Check statistics in general
#-------------------------------
# ../include/socket_summary_check.inc also inserts the 'After' state into
# mysqltest.my_socket_summary_by_instance.
--source ../include/socket_summary_check.inc
--disable_query_log
--disable_result_log
if($is_connect)
{
eval $get_object_instance_begin;
eval $insert_pseudo_before;
}
eval $insert_delta;
# Correct the values of the columns statement and run
eval
UPDATE mysqltest.socket_summary_by_instance_detail
SET statement = '$statement'
WHERE statement IS NULL;
eval
UPDATE mysqltest.socket_summary_by_instance_detail
SET run = $loop_round
WHERE run IS NULL;
if($is_connect)
{
# Only in case the connect was successful ($my_errno = 0) than we have to disconnect.
if(!$my_errno)
{
--disconnect con$loop_round
# Wait till the connection using the DB = 'mysqltest' or
# 'mysqlsupertest' has disappeared from performance_schema.threads
let $part=
FROM performance_schema.threads
WHERE processlist_db IN ('mysqltest','mysqlsupertest');
let $wait_timeout= 10;
let $wait_condition=
SELECT COUNT(*) = 0
$part;
--source include/wait_condition.inc
if (!$success)
{
--echo # Error: The disconnect of the connection with processlist_db
--echo # IN ('mysqltest','mysqlsupertest') failed
SELECT *
$part;
--echo # abort
exit;
}
# Wait in addition till the corresponding 'client_connection' entry of
# the connection using the DB = 'mysqltest' or 'mysqlsupertest' has disappeared.
let $part=
FROM performance_schema.socket_summary_by_instance
WHERE EVENT_NAME LIKE '%client_connection'
AND OBJECT_INSTANCE_BEGIN <> @default_object_instance_begin;
let $wait_timeout= 10;
let $wait_condition=
SELECT COUNT(*) = 0
$part;
--source include/wait_condition.inc
if (!$success)
{
--echo # Error: The entry of the disconnectd connection with processlist_db
--echo # IN ('mysqltest','mysqlsupertest') did not disappear
SELECT *
$part;
--echo # abort
exit;
}
}
# --sleep 3
}
inc $loop_round;
}
--enable_query_log
--enable_result_log

View File

@ -0,0 +1,130 @@
# include/socket_event.inc
#
# Auxiliary routine
# - running some statement in connection con1
# and checking the changes for the client_connction" entry belonging to con1
# within socket_summary_by_instance and
# - checking if the changes to values caused by the statement execution are
# reasonable and stable
#
# Requirements:
# 1. Have socket_summary_by_instance_func running
# 2. Have a connection con1
# @con1_object_instance_begin needs to be the OBJECT_INSTANCE_BEGIN
# value of the "client_connction" entry belonging to con1 within
# socket_summary_by_instance.
# 3. $statement needs to contain the statement to be executed by con1.
#
let $my_errno= 0;
let $loop_round= 1;
while($loop_round <= $loop_rounds)
{
if (!$my_socket_debug)
{
--disable_query_log
}
# Collect the current state
#==========================
eval $truncate;
eval $insert_before;
# Run the operation
#==================
if($is_connect)
{
let $statement= Connect (con1,$connect_host,$connect_user,,$connect_db,,);
# Some statements fail with ER_ACCESS_DENIED_ERROR
--disable_abort_on_error
--connect (con1,$connect_host,$connect_user,,$connect_db,,)
--enable_abort_on_error
let $my_errno= $mysql_errno;
}
if(!$is_connect)
{
--connection con1
# Print the statement outcome once.
if($loop_round == 1)
{
--enable_query_log
--enable_result_log
--horizontal_results
}
# One of the statements to be checked is expected to fail with ER_NO_SUCH_TABLE.
--disable_abort_on_error
eval $statement;
--enable_abort_on_error
if (!$my_socket_debug)
{
--disable_query_log
--disable_result_log
}
}
# Wait till the operation is really finished. We expect that there will be no
# changes to the statistics of the additional connection after this point of time.
#=================================================================================
--connection default
if($my_errno)
{
# Wait a bit and hope that the counter maintenence is finished.
--sleep 3
}
if(!$my_errno)
{
--source ../include/wait_till_sleep.inc
}
# Various checks
#===============
# 1. Check statistics in general
#-------------------------------
# ../include/socket_summary_check.inc also inserts the 'After' state into
# mysqltest.my_socket_summary_by_instance.
--source ../include/socket_summary_check_dbg.inc
if (!$my_socket_debug)
{
--disable_query_log
--disable_result_log
}
if($is_connect)
{
eval $get_object_instance_begin;
eval $insert_pseudo_before;
}
eval $insert_delta;
# Correct the values of the columns statement and run
eval
UPDATE mysqltest.socket_summary_by_instance_detail
SET statement = '$statement'
WHERE statement IS NULL;
eval
UPDATE mysqltest.socket_summary_by_instance_detail
SET run = $loop_round
WHERE run IS NULL;
if($is_connect)
{
if(!$my_errno)
{
--connection con1
--disconnect con1
--source include/wait_until_disconnected.inc
--connection default
}
}
inc $loop_round;
}
--enable_query_log
--enable_result_log

View File

@ -0,0 +1,113 @@
#==============================================================================
# Set IP address defaults with respect to IPV6 support
#
# This file determines the level of support for IPV4, IPV4 mapped or IPV6, then
# sets the appropriate localhost IP format to use for 'connect()' commands.
#
# Input: $my_socket_debug - Print results of IP version check (optional)
# Output: $my_localhost - Default localhost IP
#==============================================================================
let $check_ipv6_just_check= 1;
#--source include/check_ipv6.inc
#==============================================================================
# Determine if IPV6 supported
#
# Parameters:
# $check_ipv6_just_check - Don't skip the test if IPv6 is unsupported,
# just set the variable $check_ipv6_supported
#==============================================================================
--disable_query_log
--disable_result_log
--disable_abort_on_error
let $check_ipv6_supported= 1;
connect (checkcon123456789,::1,root,,test);
if($mysql_errno)
{
let $check_ipv6_supported=0;
if(!$check_ipv6_just_check)
{
skip No IPv6 support;
}
}
if(!$mysql_errno)
{
disconnect checkcon123456789;
--source include/wait_until_disconnected.inc
}
connection default;
--enable_abort_on_error
--enable_result_log
--enable_query_log
#==============================================================================
#
# Determine if IPV4 mapped to IPV6 supported
#
let $check_ipv4_mapped_just_check= 1;
#--source include/check_ipv4_mapped.inc
#==============================================================================
# Check if ipv4 mapped to ipv6 is available.
#
# Parameters:
# $check_ipv4_mapped_just_check - Don't skip the test if IPv4 mapped is unsupported,
# just set the variable $check_ipv4_mapped_supported
#==============================================================================
--disable_query_log
--disable_result_log
--disable_abort_on_error
let $check_ipv4_mapped_supported= 1;
connect (checkcon123456789a,::FFFF:127.0.0.1,root,,test);
if($mysql_errno)
{
let $check_ipv4_mapped_supported=0;
if(!$check_ipv4_mapped_just_check)
{
skip No mapped IPv4 support;
}
}
if(!$mysql_errno)
{
disconnect checkcon123456789a;
--source include/wait_until_disconnected.inc
}
connection default;
--enable_abort_on_error
--enable_result_log
--enable_query_log
#==============================================================================
# Set the localhost IP default to use when establishing connections
#
#==============================================================================
let $my_localhost=127.0.0.1;
if($check_ipv6_supported)
{
let $my_localhost=::1;
}
if($check_ipv4_mapped_supported)
{
let $my_localhost=::ffff:127.0.0.1;
}
if($my_socket_debug)
{
--echo IPV6=$check_ipv6_supported, IPV4_MAPPED=$check_ipv4_mapped_supported, LOCALHOST=$my_localhost
}
#==============================================================================

View File

@ -0,0 +1,227 @@
# include/socket_summary_check.inc
#
# Auxiliary routine to be sourced by socket_summary_by_instance_func.test
# or other routines sourced within this script.
#
# Purpose
# Various checks for the content of the table socket_summary_by_instance.
#
# It is intentional that we do not try to cram as much checks as possible into
# one single SQL statement.
# Reasons:
# - We check performance_schema here and NOT something like optimizer.
# - This test should work even if some other feature has become buggy.
# - In case some check gives unexpected results than we print the
# relevant content of the table and the values which we expect.
# In case of all checks in one statement such a printout would be too huge.
#
# IMPORTANT:
# The maximum number of rows which the table socket_summary_by_instance
# can keep is limited via the system variables max_socket_classes and
# max_socket_instances. We are running with the default values here.
# They are sufficient high so that these limits cannot harm the current test.
# FIXME: Check at the beginning of the test that the limits are sufficient
# for the current test.
#
--disable_query_log
# Insert the current state into mysqltest.my_socket_summary_by_instance.
eval $insert_after;
--enable_query_log
--enable_result_log
# 1. The content of socket_summary_by_instance must be consistent to the
# content of socket_instances
#=======================================================================
let $part1=
FROM performance_schema.socket_summary_by_instance
WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN)
NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN
FROM performance_schema.socket_instances);
if(`SELECT COUNT(*) $part1`)
{
--echo # There is an inconsistency between the content of the tables
--echo # socket_instances and socket_summary_by_instance
--echo #
eval
SELECT 'not in socket_instances' AS state, EVENT_NAME, OBJECT_INSTANCE_BEGIN
$part1;
}
--vertical_results
# 2. The computation of statistics must be roughly correct.
#
# If we run this check sufficient frequent than AVG_TIMER_* can be removed from other checks.
#===============================================================================================
let $my_lo= 0.98;
let $my_hi= 1.02;
let $my_rules=
COUNT_STAR * AVG_TIMER_WAIT BETWEEN SUM_TIMER_WAIT * $my_lo AND SUM_TIMER_WAIT * $my_hi AND
COUNT_READ * AVG_TIMER_READ BETWEEN SUM_TIMER_READ * $my_lo AND SUM_TIMER_READ * $my_hi AND
COUNT_WRITE * AVG_TIMER_WRITE BETWEEN SUM_TIMER_WRITE * $my_lo AND SUM_TIMER_WRITE * $my_hi AND
COUNT_MISC * AVG_TIMER_MISC BETWEEN SUM_TIMER_MISC * $my_lo AND SUM_TIMER_MISC * $my_hi;
let $part=
SUM_TIMER_WAIT * $my_lo, COUNT_STAR * AVG_TIMER_WAIT, SUM_TIMER_WAIT * $my_hi,
COUNT_STAR, SUM_TIMER_WAIT, AVG_TIMER_WAIT,
SUM_TIMER_READ * $my_lo, COUNT_READ * AVG_TIMER_READ, SUM_TIMER_READ * $my_hi,
COUNT_READ, SUM_TIMER_READ, AVG_TIMER_READ,
SUM_TIMER_WRITE * $my_lo, COUNT_WRITE * AVG_TIMER_WRITE, SUM_TIMER_WRITE * $my_hi,
COUNT_WRITE, SUM_TIMER_WRITE, AVG_TIMER_WRITE,
SUM_TIMER_MISC * $my_lo, COUNT_MISC * AVG_TIMER_MISC, SUM_TIMER_MISC * $my_hi,
COUNT_MISC, SUM_TIMER_MISC, AVG_TIMER_MISC;
if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'`)
{
--echo # The statistics looks suspicious.
--echo # We expect
--echo # $my_rules
eval
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
$part
FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After' AND NOT ($my_rules)
ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
let $print_details= 1;
}
# 3. Check the relation between AVG_*, MIN_TIMER_* and MAX_TIMER_*
#
# If we run this check sufficient frequent than only the following
# additional checks are required:
# a) If (SUM_TIMER_*(new) - SUM_TIMER_*(old) < MIN_TIMER_*(old))
# than MIN_TIMER_*(new) = SUM_TIMER_*(new) - SUM_TIMER_*(old).
# b) If (SUM_TIMER_*(new) - SUM_TIMER_*(old) > MAX_TIMER_*(old))
# than MAX_TIMER_*(new) = SUM_TIMER_*(new) - SUM_TIMER_*(old).
# in order to remove MIN_TIMER_* and MAX_TIMER_* from other checks
# Between the states "new" and "old" must be exact one statement.
#-----------------------------------------------------------------------------------------------
let $my_rules=
AVG_TIMER_WAIT >= MIN_TIMER_WAIT AND MAX_TIMER_WAIT >= AVG_TIMER_WAIT AND
AVG_TIMER_READ >= MIN_TIMER_READ AND MAX_TIMER_READ >= AVG_TIMER_READ AND
AVG_TIMER_WRITE >= MIN_TIMER_WRITE AND MAX_TIMER_WRITE >= AVG_TIMER_WRITE AND
AVG_TIMER_MISC >= MIN_TIMER_MISC AND MAX_TIMER_MISC >= AVG_TIMER_MISC;
let $part=
MIN_TIMER_WAIT, AVG_TIMER_WAIT, MAX_TIMER_WAIT,
MIN_TIMER_READ, AVG_TIMER_READ, MAX_TIMER_READ,
MIN_TIMER_WRITE, AVG_TIMER_WRITE, MAX_TIMER_WRITE,
MIN_TIMER_MISC, AVG_TIMER_MISC, MAX_TIMER_MISC;
if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'`)
{
--echo # The statistics looks suspicious.
--echo # We expect
--echo # $my_rules
eval
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
$part
FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After' AND NOT ($my_rules)
ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
let $print_details= 1;
}
# 4. Check the aggregate columns COUNT_STAR and SUM_TIMER_WAIT
#
# The specification says:
# The columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT aggregates all operations.
#
# If we run this check sufficient frequent than COUNT_STAR and SUM_TIMER_WAIT
# can be removed from other checks.
#---------------------------------------------------------------------------------
let $my_rules=
COUNT_STAR = COUNT_READ + COUNT_WRITE + COUNT_MISC AND
SUM_TIMER_WAIT = SUM_TIMER_READ + SUM_TIMER_WRITE + SUM_TIMER_MISC;
let $part=
COUNT_STAR, COUNT_READ + COUNT_WRITE + COUNT_MISC, COUNT_READ, COUNT_WRITE, COUNT_MISC,
SUM_TIMER_WAIT, SUM_TIMER_READ + SUM_TIMER_WRITE + SUM_TIMER_MISC, SUM_TIMER_READ,
SUM_TIMER_WRITE, SUM_TIMER_MISC;
if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'`)
{
--echo # The statistics looks suspicious.
--echo # We expect
--echo # $my_rules
--echo #
eval
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
$part
FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'
ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
let $print_details= 1;
}
# 5. Check the aggregate column MIN_TIMER_WAIT
#
# If we run this check sufficient frequent than MIN_TIMER_WAIT
# can be removed from other checks.
#---------------------------------------------------------------------------------
let $my_rules=
MIN_TIMER_WAIT >= mysqltest.min_of_triple(MIN_TIMER_READ,MIN_TIMER_WRITE,MIN_TIMER_MISC);
let $part=
MIN_TIMER_WAIT,
mysqltest.min_of_triple(MIN_TIMER_READ, MIN_TIMER_WRITE, MIN_TIMER_MISC) AS "Min_of_Triple",
MIN_TIMER_READ, MIN_TIMER_WRITE, MIN_TIMER_MISC;
if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'`)
{
--echo # The statistics looks suspicious.
--echo # We expect
--echo # $my_rules
--echo #
eval
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
$part
FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'
ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
let $print_details= 1;
}
# 6. Check the aggregate column MAX_TIMER_WAIT
#
# If we run this check sufficient frequent than MAX_TIMER_WAIT
# can be removed from other checks.
#---------------------------------------------------------------------------------
let $my_rules=
MAX_TIMER_WAIT >= mysqltest.max_of_triple(MAX_TIMER_READ,MAX_TIMER_WRITE,MAX_TIMER_MISC);
let $part=
MAX_TIMER_WAIT,
mysqltest.max_of_triple(MAX_TIMER_READ, MAX_TIMER_WRITE, MAX_TIMER_MISC) AS "Max_of_Triple",
MAX_TIMER_READ, MAX_TIMER_WRITE, MAX_TIMER_MISC;
if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'`)
{
--echo # The statistics looks suspicious.
--echo # We expect
--echo # $my_rules
--echo #
eval
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
$part
FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'
ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
let $print_details= 1;
}
--horizontal_results

View File

@ -0,0 +1,236 @@
# include/socket_summary_check.inc
#
# Auxiliary routine to be sourced by socket_summary_by_instance_func.test
# or other routines sourced within this script.
#
# Purpose
# Various checks for the content of the table socket_summary_by_instance.
#
# It is intentional that we do not try to cram as much checks as possible into
# one single SQL statement.
# Reasons:
# - We check performance_schema here and NOT something like optimizer.
# - This test should work even if some other feature has become buggy.
# - In case some check gives unexpected results than we print the
# relevant content of the table and the values which we expect.
# In case of all checks in one statement such a printout would be too huge.
#
# IMPORTANT:
# The maximum number of rows which the table socket_summary_by_instance
# can keep is limited via the system variables max_socket_classes and
# max_socket_instances. We are running with the default values here.
# They are sufficient high so that these limits cannot harm the current test.
# FIXME: Check at the beginning of the test that the limits are sufficient
# for the current test.
#
--disable_query_log
# Insert the current state into mysqltest.my_socket_summary_by_instance.
eval $insert_after;
--enable_query_log
# 1. The content of socket_summary_by_instance must be consistent to the
# content of socket_instances
#-----------------------------------------------------------------------
let $part1=
FROM performance_schema.socket_summary_by_instance
WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN)
NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN
FROM performance_schema.socket_instances);
if(`SELECT COUNT(*) $part1`)
{
--echo # There is an inconsistency between the content of the tables
--echo # socket_instances and socket_summary_by_instance
--echo #
eval
SELECT 'not in socket_instances' AS state, EVENT_NAME, OBJECT_INSTANCE_BEGIN
$part1;
--echo # abort 1
# exit;
}
--vertical_results
# 2. The computation of statistics must be roughly correct.
#
# If we run this check sufficient frequent than AVG_TIMER_* can be removed from other checks.
#-----------------------------------------------------------------------------------------------
let $my_lo= 0.99;
let $my_hi= 1.01;
let $my_rules=
COUNT_STAR * AVG_TIMER_WAIT BETWEEN SUM_TIMER_WAIT * $my_lo AND SUM_TIMER_WAIT * $my_hi AND
COUNT_READ * AVG_TIMER_READ BETWEEN SUM_TIMER_READ * $my_lo AND SUM_TIMER_READ * $my_hi AND
COUNT_WRITE * AVG_TIMER_WRITE BETWEEN SUM_TIMER_WRITE * $my_lo AND SUM_TIMER_WRITE * $my_hi AND
COUNT_MISC * AVG_TIMER_MISC BETWEEN SUM_TIMER_MISC * $my_lo AND SUM_TIMER_MISC * $my_hi;
let $part=
SUM_TIMER_WAIT * $my_lo, COUNT_STAR * AVG_TIMER_WAIT, SUM_TIMER_WAIT * $my_hi, COUNT_STAR, SUM_TIMER_WAIT, AVG_TIMER_WAIT,
SUM_TIMER_READ * $my_lo, COUNT_READ * AVG_TIMER_READ, SUM_TIMER_READ * $my_hi, COUNT_READ, SUM_TIMER_READ, AVG_TIMER_READ,
SUM_TIMER_WRITE * $my_lo, COUNT_WRITE * AVG_TIMER_WRITE, SUM_TIMER_WRITE * $my_hi, COUNT_WRITE, SUM_TIMER_WRITE, AVG_TIMER_WRITE,
SUM_TIMER_MISC * $my_lo, COUNT_MISC * AVG_TIMER_MISC, SUM_TIMER_MISC * $my_hi, COUNT_MISC, SUM_TIMER_MISC, AVG_TIMER_MISC;
if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'`)
{
--echo # The statistics looks suspicious.
--echo # We expect
--echo # $my_rules
eval
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
$part
FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'
ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
-- echo # Debug 2a: Dump socket_summary_by_instance
eval
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
$part
FROM performance_schema.socket_summary_by_instance
ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
--echo # abort 2
# exit;
}
# 3. Check the relation between AVG_*, MIN_TIMER_* and MAX_TIMER_*
#
# If we run this check sufficient frequent than only the following
# additional checks are required:
# a) If (SUM_TIMER_*(new) - SUM_TIMER_*(old) < MIN_TIMER_*(old))
# than MIN_TIMER_*(new) = SUM_TIMER_*(new) - SUM_TIMER_*(old).
# b) If (SUM_TIMER_*(new) - SUM_TIMER_*(old) > MAX_TIMER_*(old))
# than MAX_TIMER_*(new) = SUM_TIMER_*(new) - SUM_TIMER_*(old).
# in order to remove MIN_TIMER_* and MAX_TIMER_* from other checks
# Between the states "new" and "old" must be exact one statement.
#-----------------------------------------------------------------------------------------------
let $my_rules=
AVG_TIMER_WAIT >= MIN_TIMER_WAIT AND MAX_TIMER_WAIT >= AVG_TIMER_WAIT AND
AVG_TIMER_READ >= MIN_TIMER_READ AND MAX_TIMER_READ >= AVG_TIMER_READ AND
AVG_TIMER_WRITE >= MIN_TIMER_WRITE AND MAX_TIMER_WRITE >= AVG_TIMER_WRITE AND
AVG_TIMER_MISC >= MIN_TIMER_MISC AND MAX_TIMER_MISC >= AVG_TIMER_MISC;
let $part=
MIN_TIMER_WAIT, AVG_TIMER_WAIT, MAX_TIMER_WAIT,
MIN_TIMER_READ, AVG_TIMER_READ, MAX_TIMER_READ,
MIN_TIMER_WRITE, AVG_TIMER_WRITE, MAX_TIMER_WRITE,
MIN_TIMER_MISC, AVG_TIMER_MISC, MAX_TIMER_MISC;
if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'`)
{
--echo # The statistics looks suspicious.
--echo # We expect
--echo # $my_rules
eval
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
$part
FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'
ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
--echo # abort 3
# exit;
}
# 4. Check the aggregate columns COUNT_STAR and SUM_TIMER_WAIT
#
# The specification says:
# The columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT aggregates all operations.
#
# If we run this check sufficient frequent than COUNT_STAR and SUM_TIMER_WAIT
# can be removed from other checks.
#---------------------------------------------------------------------------------
let $my_rules=
COUNT_STAR = COUNT_READ + COUNT_WRITE + COUNT_MISC AND
SUM_TIMER_WAIT = SUM_TIMER_READ + SUM_TIMER_WRITE + SUM_TIMER_MISC;
let $part=
COUNT_STAR, COUNT_READ + COUNT_WRITE + COUNT_MISC, COUNT_READ, COUNT_WRITE, COUNT_MISC,
SUM_TIMER_WAIT, SUM_TIMER_READ + SUM_TIMER_WRITE + SUM_TIMER_MISC, SUM_TIMER_READ,
SUM_TIMER_WRITE, SUM_TIMER_MISC;
if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'`)
{
--echo # The statistics looks suspicious.
--echo # We expect
--echo # $my_rules
--echo #
eval
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
$part
FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'
ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
--echo # abort 4
# exit;
}
# 5. Check the aggregate column MIN_TIMER_WAIT
#
# If we run this check sufficient frequent than MIN_TIMER_WAIT
# can be removed from other checks.
#---------------------------------------------------------------------------------
let $my_rules=
MIN_TIMER_WAIT >= mysqltest.min_of_triple(MIN_TIMER_READ,MIN_TIMER_WRITE,MIN_TIMER_MISC);
let $part=
MIN_TIMER_WAIT,
mysqltest.min_of_triple(MIN_TIMER_READ, MIN_TIMER_WRITE, MIN_TIMER_MISC) AS "Min_of_Triple",
MIN_TIMER_READ, MIN_TIMER_WRITE, MIN_TIMER_MISC;
if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'`)
{
--echo # The statistics looks suspicious.
--echo # We expect
--echo # $my_rules
--echo #
eval
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
$part
FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'
ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
--echo # abort 5
# exit;
}
# 6. Check the aggregate column MAX_TIMER_WAIT
#
# If we run this check sufficient frequent than MAX_TIMER_WAIT
# can be removed from other checks.
#---------------------------------------------------------------------------------
let $my_rules=
MAX_TIMER_WAIT >= mysqltest.max_of_triple(MAX_TIMER_READ,MAX_TIMER_WRITE,MAX_TIMER_MISC);
let $part=
MAX_TIMER_WAIT,
mysqltest.max_of_triple(MAX_TIMER_READ, MAX_TIMER_WRITE, MAX_TIMER_MISC) AS "Max_of_Triple",
MAX_TIMER_READ, MAX_TIMER_WRITE, MAX_TIMER_MISC;
if(`SELECT SUM($my_rules) <> COUNT(*) FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'`)
{
--echo # The statistics looks suspicious.
--echo # We expect
--echo # $my_rules
--echo #
eval
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
$part
FROM mysqltest.my_socket_summary_by_instance
WHERE pk = 'After'
ORDER BY EVENT_NAME, OBJECT_INSTANCE_BEGIN;
--echo # abort 6
# exit;
}
--horizontal_results

View File

@ -0,0 +1,31 @@
# Tests for the performance schema
# ================================
# HELPER include/stage_cleanup.inc
# ================================
--disable_query_log
revoke all privileges, grant option from user1@localhost;
revoke all privileges, grant option from user2@localhost;
revoke all privileges, grant option from user3@localhost;
revoke all privileges, grant option from user4@localhost;
drop user user1@localhost;
drop user user2@localhost;
drop user user3@localhost;
drop user user4@localhost;
flush privileges;
drop procedure dump_thread;
drop procedure dump_one_thread;
truncate table performance_schema.setup_actors;
insert into performance_schema.setup_actors
select * from test.setup_actors;
drop table test.setup_actors;
drop table test.t1;
update performance_schema.threads set instrumented='YES';
update performance_schema.setup_instruments set enabled='YES', timed='YES';
--enable_query_log

View File

@ -0,0 +1,134 @@
# Tests for the performance schema
# =============
# DOCUMENTATION
# =============
# Verify critical stages of a statement
#
# The tests are written with the following helpers:
# - include/stage_setup.inc
# - include/stage_cleanup.inc
#
# Helpers are intended to be used as follows.
#
# A Typical test t/stage_xxx.test will consist of:
# --source ../include/stage_setup.inc
# ... test specific payload ...
# --source ../include/stage_cleanup.inc
# and a t/stage_xxx-master.opt file
#
# ==============================
# HELPER include/stage_setup.inc
# ==============================
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source ../include/no_protocol.inc
--disable_query_log
grant ALL on *.* to user1@localhost;
grant ALL on *.* to user2@localhost;
grant ALL on *.* to user3@localhost;
grant ALL on *.* to user4@localhost;
flush privileges;
# Save the setup
--disable_warnings
drop table if exists test.setup_actors;
drop table if exists test.t1;
--enable_warnings
create table test.t1(a varchar(64));
create table test.setup_actors as
select * from performance_schema.setup_actors;
# Only instrument the user connections
truncate table performance_schema.setup_actors;
insert into performance_schema.setup_actors
set host= 'localhost', user= 'user1', role= '%';
insert into performance_schema.setup_actors
set host= 'localhost', user= 'user2', role= '%';
insert into performance_schema.setup_actors
set host= 'localhost', user= 'user3', role= '%';
insert into performance_schema.setup_actors
set host= 'localhost', user= 'user4', role= '%';
update performance_schema.threads set instrumented='NO';
# Only instrument a few events of each kind
update performance_schema.setup_instruments set enabled='YES', timed='YES';
# Start from a known clean state, to avoid noise from previous tests
flush tables;
flush status;
truncate performance_schema.events_stages_summary_by_thread_by_event_name;
truncate performance_schema.events_stages_summary_global_by_event_name;
truncate performance_schema.events_stages_history;
truncate performance_schema.events_stages_history_long;
truncate performance_schema.events_statements_summary_by_thread_by_event_name;
truncate performance_schema.events_statements_summary_global_by_event_name;
truncate performance_schema.events_statements_history;
truncate performance_schema.events_statements_history_long;
--disable_warnings
drop procedure if exists dump_thread;
drop procedure if exists dump_one_thread;
--enable_warnings
delimiter $$;
create procedure dump_thread()
begin
call dump_one_thread('user1');
call dump_one_thread('user2');
call dump_one_thread('user3');
call dump_one_thread('user4');
end
$$
create procedure dump_one_thread(in username varchar(64))
begin
declare my_thread_id int;
declare my_statement_id int;
set my_thread_id = (select thread_id from performance_schema.threads
where processlist_user=username);
if (my_thread_id is not null) then
begin
# Dump the current statement for this thread
select username, event_name, sql_text
from performance_schema.events_statements_current
where thread_id = my_thread_id;
# Get the current statement
set my_statement_id = (select event_id from
performance_schema.events_statements_current
where thread_id = my_thread_id);
# Dump the stages for this statement
select username, event_name, nesting_event_type
from performance_schema.events_stages_current
where thread_id = my_thread_id
and nesting_event_id = my_statement_id
order by event_id asc;
select username, event_name, nesting_event_type
from performance_schema.events_stages_history
where thread_id = my_thread_id
and nesting_event_id = my_statement_id
order by event_id asc;
end;
else
select username, "not found" as status;
end if;
end
$$
delimiter ;$$
--enable_query_log

View File

@ -4,29 +4,64 @@ show databases;
select count(*) from performance_schema.performance_timers; select count(*) from performance_schema.performance_timers;
select count(*) from performance_schema.setup_consumers; select count(*) from performance_schema.setup_consumers;
select count(*) > 0 from performance_schema.setup_instruments; # wait/io/table/sql/handler is a native instrument
# wait/lock/table/sql/handler is a native instrument
# idle/io/socket is a native instrument
select count(*) > 3 from performance_schema.setup_instruments;
select count(*) from performance_schema.setup_timers; select count(*) from performance_schema.setup_timers;
# Make sure we don't crash, no matter what the starting parameters are # Make sure we don't crash, no matter what the starting parameters are
--disable_result_log --disable_result_log
select * from performance_schema.accounts;
select * from performance_schema.cond_instances; select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
select * from performance_schema.events_stages_history;
select * from performance_schema.events_stages_history_long;
select * from performance_schema.events_stages_summary_by_account_by_event_name;
select * from performance_schema.events_stages_summary_by_host_by_event_name;
select * from performance_schema.events_stages_summary_by_thread_by_event_name;
select * from performance_schema.events_stages_summary_by_user_by_event_name;
select * from performance_schema.events_stages_summary_global_by_event_name;
select * from performance_schema.events_statements_current;
select * from performance_schema.events_statements_history;
select * from performance_schema.events_statements_history_long;
select * from performance_schema.events_statements_summary_by_account_by_event_name;
select * from performance_schema.events_statements_summary_by_host_by_event_name;
select * from performance_schema.events_statements_summary_by_thread_by_event_name;
select * from performance_schema.events_statements_summary_by_user_by_event_name;
select * from performance_schema.events_statements_summary_global_by_event_name;
select * from performance_schema.events_waits_current; select * from performance_schema.events_waits_current;
select * from performance_schema.events_waits_history; select * from performance_schema.events_waits_history;
select * from performance_schema.events_waits_history_long; select * from performance_schema.events_waits_history_long;
select * from performance_schema.events_waits_summary_by_account_by_event_name;
select * from performance_schema.events_waits_summary_by_host_by_event_name;
select * from performance_schema.events_waits_summary_by_instance; select * from performance_schema.events_waits_summary_by_instance;
select * from performance_schema.events_waits_summary_by_thread_by_event_name; select * from performance_schema.events_waits_summary_by_thread_by_event_name;
select * from performance_schema.events_waits_summary_by_user_by_event_name;
select * from performance_schema.events_waits_summary_global_by_event_name; select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances; select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name; select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance; select * from performance_schema.file_summary_by_instance;
select * from performance_schema.host_cache;
select * from performance_schema.socket_instances;
select * from performance_schema.socket_summary_by_instance;
select * from performance_schema.socket_summary_by_event_name;
select * from performance_schema.hosts;
select * from performance_schema.mutex_instances; select * from performance_schema.mutex_instances;
select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers; select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances; select * from performance_schema.rwlock_instances;
select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers; select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments; select * from performance_schema.setup_instruments;
select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers; select * from performance_schema.setup_timers;
select * from performance_schema.table_io_waits_summary_by_index_usage;
select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;
select * from performance_schema.threads; select * from performance_schema.threads;
select * from performance_schema.users;
--enable_result_log --enable_result_log
# This has a stable output, printing the result: # This has a stable output, printing the result:

View File

@ -0,0 +1,53 @@
# Tests for the performance schema
#
# See comments in include/table_aggregate_setup.inc
--disable_query_log
revoke all privileges, grant option from user1@localhost;
revoke all privileges, grant option from user2@localhost;
revoke all privileges, grant option from user3@localhost;
revoke all privileges, grant option from user4@localhost;
drop user user1@localhost;
drop user user2@localhost;
drop user user3@localhost;
drop user user4@localhost;
flush privileges;
drop procedure dump_thread;
drop procedure dump_one_thread;
drop prepare dump_waits_account;
drop prepare dump_waits_user;
drop prepare dump_waits_host;
drop prepare dump_waits_global;
drop prepare dump_waits_history;
drop prepare dump_waits_index_io;
drop prepare dump_waits_table_io;
drop prepare dump_waits_table_lock;
drop prepare dump_objects_summary;
truncate table performance_schema.accounts;
truncate table performance_schema.users;
truncate table performance_schema.hosts;
truncate table performance_schema.setup_actors;
insert into performance_schema.setup_actors
select * from test.setup_actors;
drop table test.setup_actors;
truncate table performance_schema.setup_objects;
insert into performance_schema.setup_objects
select * from test.setup_objects;
drop table test.setup_objects;
drop table test.t1;
drop table test.t2;
drop table test.t3;
update performance_schema.threads set instrumented='YES';
update performance_schema.setup_instruments set enabled='YES', timed='YES';
update performance_schema.setup_consumers set enabled='YES';
--enable_query_log

View File

@ -0,0 +1,540 @@
# Tests for the performance schema
#
# See comments in include/table_aggregate_setup.inc
# Display the current setup used
select * from performance_schema.setup_actors
order by USER, HOST, ROLE;
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
select * from performance_schema.setup_consumers;
# General cleanup
flush tables;
truncate performance_schema.objects_summary_global_by_type;
truncate performance_schema.table_io_waits_summary_by_index_usage;
truncate performance_schema.table_io_waits_summary_by_table;
truncate performance_schema.table_lock_waits_summary_by_table;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
truncate performance_schema.events_waits_summary_by_account_by_event_name;
truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
truncate performance_schema.events_waits_history_long;
# Check the configuration is ok
show variables like "performance_schema%";
show status like "performance_schema%";
echo "================== Step 1 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
# Notes about this test
#
connect (con1, localhost, user1, , );
echo "================== con1 connected ==================";
--connection default
# Wait for the connect to complete
let $wait_condition=
select count(*) = 1 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user1';
--source include/wait_condition.inc
echo "================== Step 2 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
--connection con1
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
insert into test.t3 set a=104, b=4, c=4;
insert into test.t3 set a=105, b=5, c=5;
insert into test.t3 set a=106, b=6, c=6;
select * from test.t1;
select * from test.t2;
select * from test.t3;
# Full table scan
update test.t1 set d=d+1;
update test.t2 set d=d+1;
update test.t3 set d=d+1;
# Update with PK
update test.t1 set d=d+1 where a=101;
update test.t2 set d=d+1 where a=101;
update test.t3 set d=d+1 where a=101;
# select with index
select * from test.t1 where b=5;
select * from test.t2 where b=5;
select * from test.t3 where b=5;
echo "================== con1 marker ==================";
--connection default
echo "================== Step 3 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
# Debugging helpers
# select * from performance_schema.events_waits_history_long;
# select PROCESSLIST_USER, PROCESSLIST_HOST, INSTRUMENTED from performance_schema.threads;
connect (con2, localhost, user2, , );
echo "================== con2 connected ==================";
--connection default
# Wait for the connect to complete
let $wait_condition=
select count(*) = 1 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user2';
--source include/wait_condition.inc
echo "================== Step 4 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
--connection con2
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
insert into test.t3 set a=204, b=4, c=4;
insert into test.t3 set a=205, b=5, c=5;
insert into test.t3 set a=206, b=6, c=6;
select * from test.t1;
select * from test.t2;
select * from test.t3;
# Full table scan
update test.t1 set d=d+1;
update test.t2 set d=d+1;
update test.t3 set d=d+1;
# Update with PK
update test.t1 set d=d+1 where a=201;
update test.t2 set d=d+1 where a=201;
update test.t3 set d=d+1 where a=201;
# select with index
select * from test.t1 where b=5;
select * from test.t2 where b=5;
select * from test.t3 where b=5;
echo "================== con2 marker ==================";
--connection default
echo "================== Step 5 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
connect (con3, localhost, user3, , );
echo "================== con3 connected ==================";
--connection default
# Wait for the connect to complete
let $wait_condition=
select count(*) = 1 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user3';
--source include/wait_condition.inc
echo "================== Step 6 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
--connection con3
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
insert into test.t3 set a=304, b=4, c=4;
insert into test.t3 set a=305, b=5, c=5;
insert into test.t3 set a=306, b=6, c=6;
select * from test.t1;
select * from test.t2;
select * from test.t3;
# Full table scan
update test.t1 set d=d+1;
update test.t2 set d=d+1;
update test.t3 set d=d+1;
# Update with PK
update test.t1 set d=d+1 where a=301;
update test.t2 set d=d+1 where a=301;
update test.t3 set d=d+1 where a=301;
# select with index
select * from test.t1 where b=5;
select * from test.t2 where b=5;
select * from test.t3 where b=5;
echo "================== con3 marker ==================";
--connection default
echo "================== Step 7 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
connect (con4, localhost, user4, , );
echo "================== con4 connected ==================";
--connection default
# Wait for the connect to complete
let $wait_condition=
select count(*) = 1 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user4';
--source include/wait_condition.inc
echo "================== Step 8 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
--connection con4
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
insert into test.t3 set a=404, b=4, c=4;
insert into test.t3 set a=405, b=5, c=5;
insert into test.t3 set a=406, b=6, c=6;
select * from test.t1;
select * from test.t2;
select * from test.t3;
# Full table scan
update test.t1 set d=d+1;
update test.t2 set d=d+1;
update test.t3 set d=d+1;
# Update with PK
update test.t1 set d=d+1 where a=401;
update test.t2 set d=d+1 where a=401;
update test.t3 set d=d+1 where a=401;
# select with index
select * from test.t1 where b=5;
select * from test.t2 where b=5;
select * from test.t3 where b=5;
echo "================== con4 marker ==================";
--connection default
echo "================== Step 9 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
--connection con1
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
echo "================== con1 marker ==================";
--connection default
echo "================== Step 10 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
--connection default
flush tables;
echo "================== flush marker ==================";
echo "================== Step 11 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
set global read_only=1;
set global read_only=0;
echo "================== global read_only marker ==================";
echo "================== Step 12 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
--disconnect con1
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 0 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user1';
--source include/wait_condition.inc
echo "================== con1 disconnected ==================";
echo "================== Step 13 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
--disconnect con2
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 0 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user2';
--source include/wait_condition.inc
echo "================== con2 disconnected ==================";
echo "================== Step 14 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
--disconnect con3
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 0 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user3';
--source include/wait_condition.inc
echo "================== con3 disconnected ==================";
echo "================== Step 15 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
--disconnect con4
# Wait for the disconnect to complete
let $wait_condition=
select count(*) = 0 from performance_schema.threads
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user4';
--source include/wait_condition.inc
echo "================== con4 disconnected ==================";
echo "================== Step 16 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
--connection default
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
echo "================== BY_THREAD truncated ==================";
echo "================== Step 17 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
truncate performance_schema.events_waits_summary_by_account_by_event_name;
echo "================== BY_ACCOUNT truncated ==================";
echo "================== Step 18 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
truncate performance_schema.events_waits_summary_by_user_by_event_name;
echo "================== BY_USER truncated ==================";
echo "================== Step 19 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
echo "================== BY_HOST truncated ==================";
echo "================== Step 21 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
truncate performance_schema.events_waits_summary_global_by_event_name;
echo "================== GLOBAL truncated ==================";
echo "================== Step 21 ==================";
call dump_thread();
execute dump_waits_account;
execute dump_waits_user;
execute dump_waits_host;
execute dump_waits_global;
execute dump_waits_history;
execute dump_waits_index_io;
execute dump_waits_table_io;
execute dump_waits_table_lock;
execute dump_objects_summary;
# On test failures, may help to track the root cause
show status like "performance_schema%";

View File

@ -0,0 +1,267 @@
# Tests for the performance schema
# =============
# DOCUMENTATION
# =============
# Verify how table io is aggregated into various tables
#
# In the instance dimension:
# - table_io_waits_summary_by_index_usage
# - table_io_waits_summary_by_table
# - table_lock_waits_summary_by_table
# - objects_summary_global_by_type
#
# In the thread dimension:
# - events_waits_summary_by_thread_by_event_name
# - events_waits_summary_by_account_by_event_name
# - events_waits_summary_by_user_by_event_name
# - events_waits_summary_by_host_by_event_name
#
# Globally:
# - events_waits_summary_global_by_event_name
#
# The tests are written with the following helpers:
# - include/table_aggregate_setup.inc
# - include/table_aggregate_load.inc
# - include/table_aggregate_cleanup.inc
#
# Helpers are intended to be used as follows.
#
# A Typical test t/table_aggregate_xxx.test will consist of:
# --source ../include/table_aggregate_setup.inc
#
# ... statements to modify the default configuration ...
#
# --source ../include/table_aggregate_load.inc
# --source ../include/table_aggregate_cleanup.inc
#
# Naming conventions for t/table_aggregate_xxx.test are as follows:
# t/<instrument>aggregate_<mode><actors><objects>
#
# <instrument> corresponds to different instruments settings
# - table: both table io and table lock are instrumented
# - table_io: only table io is instrumented
# - table_lock: only table lock is instrumented
#
# <mode> corresponds to different consumers settings
# - off: global_instrumentation OFF
# - global: global_instrumentation ON, thread_instrumentation OFF
# - thread: global_instrumentation ON, thread_instrumentation ON,
# events_* consumers OFF
# - history: global_instrumentation ON, thread_instrumentation ON,
# events_* consumers ON
#
# <actors> corresponds to different setup_actors settings
# - 4u: every test user (user1, user2, user3, user4) is ON
# - 2u: (user1, user3) are ON, (user2, user4) are OFF
#
# <objects> corresponds to different setup_objects settings
# - 3t: tables t1, t2 and t3 are ON
# - 2t: tables t1 and t3 are ON, table t2 is OFF
#
# ========================================
# HELPER include/table_aggregate_setup.inc
# ========================================
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source ../include/no_protocol.inc
--source ../include/wait_for_pfs_thread_count.inc
--disable_query_log
grant ALL on *.* to user1@localhost;
grant ALL on *.* to user2@localhost;
grant ALL on *.* to user3@localhost;
grant ALL on *.* to user4@localhost;
flush privileges;
# Purge old users, hosts, user/host from previous tests
truncate table performance_schema.accounts;
truncate table performance_schema.users;
truncate table performance_schema.hosts;
# Save the setup
--disable_warnings
drop table if exists test.setup_actors;
drop table if exists test.setup_objects;
--enable_warnings
create table test.setup_actors as
select * from performance_schema.setup_actors;
create table test.setup_objects as
select * from performance_schema.setup_objects;
# Only instrument the user connections (by default)
truncate table performance_schema.setup_actors;
insert into performance_schema.setup_actors
set host= 'localhost', user= 'user1', role= '%';
insert into performance_schema.setup_actors
set host= 'localhost', user= 'user2', role= '%';
insert into performance_schema.setup_actors
set host= 'localhost', user= 'user3', role= '%';
insert into performance_schema.setup_actors
set host= 'localhost', user= 'user4', role= '%';
# Only instrument test.t% tables (by default)
truncate table performance_schema.setup_objects;
insert into performance_schema.setup_objects
set object_type='TABLE', object_schema='test', object_name='t1', timed='YES';
insert into performance_schema.setup_objects
set object_type='TABLE', object_schema='test', object_name='t2', timed='NO';
insert into performance_schema.setup_objects
set object_type='TABLE', object_schema='test', object_name='t3', timed='NO';
update performance_schema.threads set instrumented='NO';
# Only instrument table io and lock (by default)
update performance_schema.setup_instruments set enabled='NO', timed='NO';
update performance_schema.setup_instruments set enabled='YES', timed='YES'
where name in ('wait/io/table/sql/handler',
'wait/lock/table/sql/handler');
# Enable all consumers (by default)
update performance_schema.setup_consumers set enabled='YES';
# Start from a known clean state, to avoid noise from previous tests
flush tables;
flush status;
create table test.t1(a int, b int, c int, d int default 0,
primary key(a),
index index_b(b),
index index_cb(c, b));
create table test.t2 like test.t1;
create table test.t3 like test.t1;
#
# Note:
# For test robustness and to avoid picking up noise from other tests scripts,
# it is better to use:
# in ('t1', 't2', 't3)
# explicitly instead of:
# like 't%'
--disable_warnings
drop procedure if exists dump_thread;
drop procedure if exists dump_one_thread;
--enable_warnings
delimiter $$;
create procedure dump_thread()
begin
call dump_one_thread('user1');
call dump_one_thread('user2');
call dump_one_thread('user3');
call dump_one_thread('user4');
end
$$
create procedure dump_one_thread(in username varchar(64))
begin
declare my_thread_id int;
set my_thread_id = (select thread_id from performance_schema.threads
where processlist_user=username);
if (my_thread_id is not null) then
select username, event_name, count_star
from performance_schema.events_waits_summary_by_thread_by_event_name
where event_name in
('wait/io/table/sql/handler',
'wait/lock/table/sql/handler')
and thread_id = my_thread_id
order by event_name;
else
select username, "not found" as status;
end if;
end
$$
delimiter ;$$
prepare dump_waits_user from
"select user, event_name, count_star
from performance_schema.events_waits_summary_by_user_by_event_name
where user like \'user%\' and event_name in
(\'wait/io/table/sql/handler\',
\'wait/lock/table/sql/handler\')
order by user, event_name;";
prepare dump_waits_account from
"select user, host, event_name, count_star
from performance_schema.events_waits_summary_by_account_by_event_name
where user like \'user%\' and event_name in
(\'wait/io/table/sql/handler\',
\'wait/lock/table/sql/handler\')
order by user, host, event_name;";
prepare dump_waits_host from
"select host, event_name, count_star
from performance_schema.events_waits_summary_by_host_by_event_name
where host=\'localhost\' and event_name in
(\'wait/io/table/sql/handler\',
\'wait/lock/table/sql/handler\')
order by host, event_name;";
prepare dump_waits_global from
"select event_name, count_star
from performance_schema.events_waits_summary_global_by_event_name
where event_name in
(\'wait/io/table/sql/handler\',
\'wait/lock/table/sql/handler\')
order by event_name;";
prepare dump_waits_history from
"select event_name, count(event_name), object_type, object_schema, object_name
from performance_schema.events_waits_history_long
where event_name in
(\'wait/io/table/sql/handler\',
\'wait/lock/table/sql/handler\')
group by object_type, object_schema, object_name, event_name
order by object_type, object_schema, object_name, event_name;";
prepare dump_waits_index_io from
"select object_type, object_schema, object_name, index_name,
count_star, count_read, count_write,
count_fetch, count_insert, count_update, count_delete
from performance_schema.table_io_waits_summary_by_index_usage
where object_type='TABLE' and object_schema='test'
and object_name in ('t1', 't2', 't3')
order by object_type, object_schema, object_name, index_name;";
prepare dump_waits_table_io from
"select object_type, object_schema, object_name,
count_star, count_read, count_write,
count_fetch, count_insert, count_update, count_delete
from performance_schema.table_io_waits_summary_by_table
where object_type='TABLE' and object_schema='test'
and object_name in ('t1', 't2', 't3')
order by object_type, object_schema, object_name";
prepare dump_waits_table_lock from
"select object_type, object_schema, object_name,
count_star, count_read, count_write,
count_read_normal, count_read_with_shared_locks,
count_read_high_priority, count_read_no_insert,
count_read_external,
count_write_delayed, count_write_low_priority,
count_write_external
from performance_schema.table_lock_waits_summary_by_table
where object_type='TABLE' and object_schema='test'
and object_name in ('t1', 't2', 't3')
order by object_type, object_schema, object_name";
prepare dump_objects_summary from
"select object_type, object_schema, object_name, count_star
from performance_schema.objects_summary_global_by_type
where object_type='TABLE' and object_schema='test'
and object_name in ('t1', 't2', 't3')
order by object_type, object_schema, object_name";
--enable_query_log

View File

@ -0,0 +1,36 @@
# Tests for PERFORMANCE_SCHEMA table io
#
# Payload fragment to test table io for basic DML.
#
# $table_item = <schema>.<tablename> must be set before sourcing this script.
#
insert into marker set a = 1;
eval insert into $table_item set a = 'foo', b = 1;
insert into marker set a = 1;
eval insert into $table_item set a = 'foo', b = 2;
insert into marker set a = 1;
eval insert into $table_item set a = 'foo', b = 3;
insert into marker set a = 1;
eval select * from $table_item;
insert into marker set a = 1;
eval update $table_item set a = 'bar';
insert into marker set a = 1;
eval select * from $table_item limit 2;
insert into marker set a = 1;
eval delete from $table_item where b = 3;
insert into marker set a = 1;
# This may record a fetch for "deleted" records
eval select * from $table_item;
insert into marker set a = 1;
eval optimize table $table_item;
insert into marker set a = 1;
# Same data after optimize
eval select * from $table_item;
insert into marker set a = 1;
# truncate will fail for views
--disable_abort_on_error
eval truncate table $table_item;
--enable_abort_on_error
insert into marker set a = 1;

View File

@ -0,0 +1,10 @@
# See related script table_io_setup_helper.inc
# Cleanup
update performance_schema.setup_consumers set enabled='NO';
truncate performance_schema.events_waits_history_long;
drop table test.marker;
flush status;
update performance_schema.setup_instruments set enabled='YES';
update performance_schema.setup_consumers set enabled='YES';

View File

@ -0,0 +1,22 @@
# See related script table_io_setup_helper.inc
# Stop table io recording
update performance_schema.setup_consumers set enabled='NO';
eval select event_name,
left(source, locate(":", source)) as short_source,
object_type, object_schema,
if (locate("#sql-", object_name), "#sql-XXXX", object_name)
as pretty_name,
operation, number_of_bytes
from performance_schema.events_waits_history_long
where event_name like 'wait/io/table/%'
and object_schema in ($schema_to_dump)
order by thread_id, event_id;
# In case of failures, this will tell if table io are lost.
show status like 'performance_schema_%';
# Cleanup
truncate performance_schema.events_waits_history_long;
flush status;

View File

@ -0,0 +1,58 @@
# Performance schema test template
# How to use this script in a test case
# =====================================
#
# The general table io test template is as follows
#
# --source include/not_embedded.inc
# --source include/have_perfschema.inc
# --source ../include/table_io_setup_helper.inc
# ... more setup scripts as needed ...
# update performance_schema.setup_consumers set enabled='YES';
# ... test payload here ...
# ... optionally, add this insert between statements
# ... to make the final output more readable
# insert into test.marker set a=1;
# ... more test payload here ...
# ... optionaly, add the following line (by default, only "test" is dumped) ...
# let $schema_to_dump="db1", "db2", "db3";
# --source ../include/table_io_result_helper.inc
# Optional: Repeat several times
# update performance_schema.setup_consumers set enabled='YES';
# ... test payload here ...
# --source ../include/table_io_result_helper.inc
# ... cleanup
# --source ../include/table_io_cleanup_helper.inc
#
# (end of template)
# Setup
--disable_warnings
drop table if exists test.marker;
--enable_warnings
# To be used in the test payload,
# insert into marker makes the test output easier to read,
# to separate table io events between statements.
create table test.marker(a int);
update performance_schema.setup_consumers set enabled='NO';
update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES'
where name like "wait/io/table/%";
truncate table performance_schema.events_waits_history_long;
# Reset lost counters to a known state
flush status;
# Make sure there is room to instrument tables from this test.
flush tables;
# By default, dump table io only for test.
# A test can overide this
let $schema_to_dump="test";

View File

@ -0,0 +1,20 @@
# Tests for the performance schema
# This helper can be used to enforce that no threads from previous
# tests are still running, which can impact some test scripts.
# Wait until there is only one session left, this one.
let $wait_condition=
select count(*) = 1 from information_schema.processlist;
--source include/wait_condition.inc
# Threads are removed from information_schema.processlist
# very soon, but continue to execute in the server,
# before finally be removed from performance_schema.threads.
# Because instrumentation is optional, we use "<=" here.
let $wait_condition=
select count(*) <= 1 from performance_schema.threads
where `TYPE`='FOREGROUND';
--source include/wait_condition.inc

View File

@ -0,0 +1,19 @@
# Wait till the action of the connection using the DB = 'mysqltest' or
# 'mysqlsupertest' is finished ( Command = 'Sleep').
let $wait_timeout= 10;
let $wait_condition=
SELECT COUNT(*) = 1
FROM performance_schema.threads
WHERE processlist_db IN ('mysqltest','mysqlsupertest')
AND processlist_command = 'Sleep';
--source include/wait_condition.inc
if (!$success)
{
--echo # Error: We did not reach the expected state where processlist_command = 'Sleep'
SELECT * FROM performance_schema.threads
WHERE processlist_db IN ('mysqltest','mysqlsupertest');
--echo # abort
exit;
}

View File

@ -4,6 +4,8 @@ update performance_schema.setup_instruments set enabled = 'NO';
update performance_schema.setup_consumers set enabled = 'NO'; update performance_schema.setup_consumers set enabled = 'NO';
truncate table performance_schema.file_summary_by_event_name; truncate table performance_schema.file_summary_by_event_name;
truncate table performance_schema.file_summary_by_instance; truncate table performance_schema.file_summary_by_instance;
truncate table performance_schema.socket_summary_by_event_name;
truncate table performance_schema.socket_summary_by_instance;
truncate table performance_schema.events_waits_summary_global_by_event_name; truncate table performance_schema.events_waits_summary_global_by_event_name;
truncate table performance_schema.events_waits_summary_by_instance; truncate table performance_schema.events_waits_summary_by_instance;
truncate table performance_schema.events_waits_summary_by_thread_by_event_name; truncate table performance_schema.events_waits_summary_by_thread_by_event_name;
@ -33,6 +35,20 @@ GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE)) HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all; OR @dump_all;
EVENT_NAME COUNT_WRITE SUM(i.COUNT_WRITE) EVENT_NAME COUNT_WRITE SUM(i.COUNT_WRITE)
SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
FROM performance_schema.socket_summary_by_event_name AS e
JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
OR @dump_all;
EVENT_NAME COUNT_READ SUM(i.COUNT_READ)
SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
FROM performance_schema.socket_summary_by_event_name AS e
JOIN performance_schema.socket_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all;
EVENT_NAME COUNT_WRITE SUM(i.COUNT_WRITE)
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ) SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ)
FROM performance_schema.file_summary_by_event_name AS e FROM performance_schema.file_summary_by_event_name AS e
JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME) JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)

View File

@ -1,161 +0,0 @@
use performance_schema;
select name from mutex_instances
where name not rlike '/(DEBUG_SYNC::mutex)$'
and name != 'wait/synch/mutex/mysys/BITMAP::mutex'
group by name;
name
wait/synch/mutex/archive/archive_mutex
wait/synch/mutex/aria/LOCK_trn_list
wait/synch/mutex/aria/PAGECACHE::cache_lock
wait/synch/mutex/aria/SERVICE_THREAD_CONTROL::LOCK_control
wait/synch/mutex/aria/THR_LOCK_maria
wait/synch/mutex/aria/TRANSLOG_BUFFER::mutex
wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::dirty_buffer_mask_lock
wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::file_header_lock
wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::log_flush_lock
wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::purger_lock
wait/synch/mutex/aria/TRANSLOG_DESCRIPTOR::unfinished_files_lock
wait/synch/mutex/blackhole/blackhole
wait/synch/mutex/csv/tina
wait/synch/mutex/memory/HP_SHARE::intern_lock
wait/synch/mutex/myisam/MYISAM_SHARE::intern_lock
wait/synch/mutex/mysys/KEY_CACHE::cache_lock
wait/synch/mutex/mysys/LOCK_alarm
wait/synch/mutex/mysys/LOCK_uuid_generator
wait/synch/mutex/mysys/my_thread_var::mutex
wait/synch/mutex/mysys/THR_LOCK::mutex
wait/synch/mutex/mysys/THR_LOCK_charset
wait/synch/mutex/mysys/THR_LOCK_heap
wait/synch/mutex/mysys/THR_LOCK_isam
wait/synch/mutex/mysys/THR_LOCK_lock
wait/synch/mutex/mysys/THR_LOCK_malloc
wait/synch/mutex/mysys/THR_LOCK_myisam
wait/synch/mutex/mysys/THR_LOCK_myisam_mmap
wait/synch/mutex/mysys/THR_LOCK_net
wait/synch/mutex/mysys/THR_LOCK_open
wait/synch/mutex/mysys/THR_LOCK_threads
wait/synch/mutex/mysys/TMPDIR_mutex
wait/synch/mutex/sql/Cversion_lock
wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state
wait/synch/mutex/sql/hash_filo::lock
wait/synch/mutex/sql/LOCK_active_mi
wait/synch/mutex/sql/LOCK_audit_mask
wait/synch/mutex/sql/LOCK_commit_ordered
wait/synch/mutex/sql/LOCK_connection_count
wait/synch/mutex/sql/LOCK_crypt
wait/synch/mutex/sql/LOCK_delayed_create
wait/synch/mutex/sql/LOCK_delayed_insert
wait/synch/mutex/sql/LOCK_delayed_status
wait/synch/mutex/sql/LOCK_des_key_file
wait/synch/mutex/sql/LOCK_error_log
wait/synch/mutex/sql/LOCK_error_messages
wait/synch/mutex/sql/LOCK_event_queue
wait/synch/mutex/sql/LOCK_gdl
wait/synch/mutex/sql/LOCK_global_index_stats
wait/synch/mutex/sql/LOCK_global_system_variables
wait/synch/mutex/sql/LOCK_global_table_stats
wait/synch/mutex/sql/LOCK_global_user_client_stats
wait/synch/mutex/sql/LOCK_open
wait/synch/mutex/sql/LOCK_plugin
wait/synch/mutex/sql/LOCK_prepared_stmt_count
wait/synch/mutex/sql/LOCK_prepare_ordered
wait/synch/mutex/sql/LOCK_rpl_status
wait/synch/mutex/sql/LOCK_server_started
wait/synch/mutex/sql/LOCK_slave_list
wait/synch/mutex/sql/LOCK_stats
wait/synch/mutex/sql/LOCK_status
wait/synch/mutex/sql/LOCK_thread_count
wait/synch/mutex/sql/LOCK_user_conn
wait/synch/mutex/sql/LOCK_user_locks
wait/synch/mutex/sql/LOCK_uuid_short_generator
wait/synch/mutex/sql/LOCK_xid_cache
wait/synch/mutex/sql/LOG::LOCK_log
wait/synch/mutex/sql/LOG_INFO::lock
wait/synch/mutex/sql/Master_info::data_lock
wait/synch/mutex/sql/Master_info::run_lock
wait/synch/mutex/sql/Master_info::sleep_lock
wait/synch/mutex/sql/MDL_map::mutex
wait/synch/mutex/sql/MDL_wait::LOCK_wait_status
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index
wait/synch/mutex/sql/Query_cache::structure_guard_mutex
wait/synch/mutex/sql/Relay_log_info::data_lock
wait/synch/mutex/sql/Relay_log_info::log_space_lock
wait/synch/mutex/sql/Relay_log_info::run_lock
wait/synch/mutex/sql/Relay_log_info::sleep_lock
wait/synch/mutex/sql/Slave_reporting_capability::err_lock
wait/synch/mutex/sql/TABLE_SHARE::LOCK_ha_data
wait/synch/mutex/sql/THD::LOCK_thd_data
wait/synch/mutex/sql/THD::LOCK_wakeup_ready
wait/synch/mutex/sql/tz_LOCK
select name from rwlock_instances
where name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock")
group by name;
name
wait/synch/rwlock/aria/TRANSLOG_DESCRIPTOR::open_files_lock
wait/synch/rwlock/myisam/MYISAM_SHARE::key_root_lock
wait/synch/rwlock/myisam/MYISAM_SHARE::mmap_lock
wait/synch/rwlock/mysys/SAFE_HASH::mutex
wait/synch/rwlock/sql/LOCK_dboptions
wait/synch/rwlock/sql/LOCK_grant
wait/synch/rwlock/sql/LOCK_system_variables_hash
wait/synch/rwlock/sql/LOCK_sys_init_connect
wait/synch/rwlock/sql/LOCK_sys_init_slave
wait/synch/rwlock/sql/LOGGER::LOCK_logger
wait/synch/rwlock/sql/MDL_context::LOCK_waiting_for
wait/synch/rwlock/sql/MDL_lock::rwlock
wait/synch/rwlock/sql/THR_LOCK_servers
wait/synch/rwlock/sql/THR_LOCK_udf
select name from cond_instances where name not rlike '/(DEBUG_SYNC::cond)$' group by name;
name
wait/synch/cond/aria/SERVICE_THREAD_CONTROL::COND_control
wait/synch/cond/aria/TRANSLOG_BUFFER::prev_sent_to_disk_cond
wait/synch/cond/aria/TRANSLOG_BUFFER::waiting_filling_buffer
wait/synch/cond/aria/TRANSLOG_DESCRIPTOR::log_flush_cond
wait/synch/cond/aria/TRANSLOG_DESCRIPTOR::new_goal_cond
wait/synch/cond/mysys/COND_alarm
wait/synch/cond/mysys/my_thread_var::suspend
wait/synch/cond/mysys/THR_COND_threads
wait/synch/cond/sql/COND_flush_thread_cache
wait/synch/cond/sql/COND_queue_state
wait/synch/cond/sql/COND_rpl_status
wait/synch/cond/sql/COND_server_started
wait/synch/cond/sql/COND_thread_cache
wait/synch/cond/sql/COND_thread_count
wait/synch/cond/sql/Event_scheduler::COND_state
wait/synch/cond/sql/Master_info::data_cond
wait/synch/cond/sql/Master_info::sleep_cond
wait/synch/cond/sql/Master_info::start_cond
wait/synch/cond/sql/Master_info::stop_cond
wait/synch/cond/sql/MDL_context::COND_wait_status
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_queue_busy
wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond
wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_queue_busy
wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond
wait/synch/cond/sql/Query_cache::COND_cache_status_changed
wait/synch/cond/sql/Relay_log_info::data_cond
wait/synch/cond/sql/Relay_log_info::log_space_cond
wait/synch/cond/sql/Relay_log_info::sleep_cond
wait/synch/cond/sql/Relay_log_info::start_cond
wait/synch/cond/sql/Relay_log_info::stop_cond
wait/synch/cond/sql/THD::COND_wakeup_ready
select event_name from file_instances group by event_name;
event_name
wait/io/file/aria/control
wait/io/file/aria/translog
wait/io/file/myisam/dfile
wait/io/file/myisam/kfile
wait/io/file/mysys/charset
wait/io/file/sql/casetest
wait/io/file/sql/dbopt
wait/io/file/sql/ERRMSG
wait/io/file/sql/FRM
wait/io/file/sql/pid
wait/io/file/sql/query_log
wait/io/file/sql/slow_log
select name from threads group by name;
name
thread/aria/checkpoint_background
thread/sql/main
thread/sql/one_connection
thread/sql/signal_handler

View File

@ -0,0 +1,21 @@
drop table if exists t1;
drop table if exists t2;
create table t1 (test_name text);
create table t2 (test_name text);
load data infile "<MYSQLTEST_VARDIR>/tmp/perfschema-all_tests.txt" into table t1;
insert into t2 select concat('ddl_', table_name, '.test') from information_schema.tables
where table_schema='performance_schema';
insert into t2 select concat('dml_', table_name, '.test') from information_schema.tables
where table_schema='performance_schema';
update t2 set test_name= replace(test_name, "events_waits_summary_", "ews_");
update t2 set test_name= replace(test_name, "events_stages_summary_", "esgs_");
update t2 set test_name= replace(test_name, "events_statements_summary_", "esms_");
update t2 set test_name= replace(test_name, "file_summary_", "fs_");
update t2 set test_name= replace(test_name, "objects_summary_", "os_");
update t2 set test_name= replace(test_name, "table_io_waits_summary_", "tiws_");
update t2 set test_name= replace(test_name, "table_lock_waits_summary_", "tlws_");
delete from t2 where t2.test_name in (select t1.test_name from t1);
select test_name as `MISSING DDL/DML TESTS` from t2;
MISSING DDL/DML TESTS
drop table t1;
drop table t2;

View File

@ -24,8 +24,12 @@ drop table test.t2;
update performance_schema.setup_instruments set enabled='YES' update performance_schema.setup_instruments set enabled='YES'
where name like "wait/synch/rwlock/sql/%" where name like "wait/synch/rwlock/sql/%"
and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
show binlog events from <binlog_start>; include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */
master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer) master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer)
@ -40,3 +44,7 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT

View File

@ -24,8 +24,12 @@ drop table test.t2;
update performance_schema.setup_instruments set enabled='YES' update performance_schema.setup_instruments set enabled='YES'
where name like "wait/synch/rwlock/sql/%" where name like "wait/synch/rwlock/sql/%"
and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
show binlog events from <binlog_start>; include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */
master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer) master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer)
@ -40,3 +44,7 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT

View File

@ -20,14 +20,12 @@ insert into test.t1
select thread_id from performance_schema.events_waits_current; select thread_id from performance_schema.events_waits_current;
Warnings: Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Mixing self-logging and non-self-logging engines in a statement is unsafe.
insert into test.t2 insert into test.t2
select name from performance_schema.setup_instruments select name from performance_schema.setup_instruments
where name like "wait/synch/rwlock/sql/%" where name like "wait/synch/rwlock/sql/%"
and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
Warnings: Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Mixing self-logging and non-self-logging engines in a statement is unsafe.
drop table test.t1; drop table test.t1;
drop table test.t2; drop table test.t2;
update performance_schema.setup_instruments set enabled='YES' update performance_schema.setup_instruments set enabled='YES'
@ -35,7 +33,7 @@ update performance_schema.setup_instruments set enabled='YES'
and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
Warnings: Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
show binlog events from <binlog_start>; include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; update performance_schema.setup_instruments set enabled='NO' master-bin.000001 # Query # # use `test`; update performance_schema.setup_instruments set enabled='NO'

View File

@ -1,34 +1,90 @@
checksum table performance_schema.accounts;
checksum table performance_schema.cond_instances; checksum table performance_schema.cond_instances;
checksum table performance_schema.events_stages_current;
checksum table performance_schema.events_stages_history;
checksum table performance_schema.events_stages_history_long;
checksum table performance_schema.events_stages_summary_by_account_by_event_name;
checksum table performance_schema.events_stages_summary_by_host_by_event_name;
checksum table performance_schema.events_stages_summary_by_thread_by_event_name;
checksum table performance_schema.events_stages_summary_by_user_by_event_name;
checksum table performance_schema.events_stages_summary_global_by_event_name;
checksum table performance_schema.events_statements_current;
checksum table performance_schema.events_statements_history;
checksum table performance_schema.events_statements_history_long;
checksum table performance_schema.events_statements_summary_by_account_by_event_name;
checksum table performance_schema.events_statements_summary_by_host_by_event_name;
checksum table performance_schema.events_statements_summary_by_thread_by_event_name;
checksum table performance_schema.events_statements_summary_by_user_by_event_name;
checksum table performance_schema.events_statements_summary_global_by_event_name;
checksum table performance_schema.events_waits_current; checksum table performance_schema.events_waits_current;
checksum table performance_schema.events_waits_history; checksum table performance_schema.events_waits_history;
checksum table performance_schema.events_waits_history_long; checksum table performance_schema.events_waits_history_long;
checksum table performance_schema.events_waits_summary_by_account_by_event_name;
checksum table performance_schema.events_waits_summary_by_host_by_event_name;
checksum table performance_schema.events_waits_summary_by_instance; checksum table performance_schema.events_waits_summary_by_instance;
checksum table performance_schema.events_waits_summary_by_thread_by_event_name; checksum table performance_schema.events_waits_summary_by_thread_by_event_name;
checksum table performance_schema.events_waits_summary_by_user_by_event_name;
checksum table performance_schema.events_waits_summary_global_by_event_name; checksum table performance_schema.events_waits_summary_global_by_event_name;
checksum table performance_schema.file_instances; checksum table performance_schema.file_instances;
checksum table performance_schema.file_summary_by_event_name; checksum table performance_schema.file_summary_by_event_name;
checksum table performance_schema.file_summary_by_instance; checksum table performance_schema.file_summary_by_instance;
checksum table performance_schema.hosts;
checksum table performance_schema.mutex_instances; checksum table performance_schema.mutex_instances;
checksum table performance_schema.objects_summary_global_by_type;
checksum table performance_schema.performance_timers; checksum table performance_schema.performance_timers;
checksum table performance_schema.rwlock_instances; checksum table performance_schema.rwlock_instances;
checksum table performance_schema.setup_actors;
checksum table performance_schema.setup_consumers; checksum table performance_schema.setup_consumers;
checksum table performance_schema.setup_instruments; checksum table performance_schema.setup_instruments;
checksum table performance_schema.setup_objects;
checksum table performance_schema.setup_timers; checksum table performance_schema.setup_timers;
checksum table performance_schema.table_io_waits_summary_by_index_usage;
checksum table performance_schema.table_io_waits_summary_by_table;
checksum table performance_schema.table_lock_waits_summary_by_table;
checksum table performance_schema.threads; checksum table performance_schema.threads;
checksum table performance_schema.users;
checksum table performance_schema.accounts extended;
checksum table performance_schema.cond_instances extended; checksum table performance_schema.cond_instances extended;
checksum table performance_schema.events_stages_current extended;
checksum table performance_schema.events_stages_history extended;
checksum table performance_schema.events_stages_history_long extended;
checksum table performance_schema.events_stages_summary_by_account_by_event_name extended;
checksum table performance_schema.events_stages_summary_by_host_by_event_name extended;
checksum table performance_schema.events_stages_summary_by_thread_by_event_name extended;
checksum table performance_schema.events_stages_summary_by_user_by_event_name extended;
checksum table performance_schema.events_stages_summary_global_by_event_name extended;
checksum table performance_schema.events_statements_current extended;
checksum table performance_schema.events_statements_history extended;
checksum table performance_schema.events_statements_history_long extended;
checksum table performance_schema.events_statements_summary_by_account_by_event_name extended;
checksum table performance_schema.events_statements_summary_by_host_by_event_name extended;
checksum table performance_schema.events_statements_summary_by_thread_by_event_name extended;
checksum table performance_schema.events_statements_summary_by_user_by_event_name extended;
checksum table performance_schema.events_statements_summary_global_by_event_name extended;
checksum table performance_schema.events_waits_current extended; checksum table performance_schema.events_waits_current extended;
checksum table performance_schema.events_waits_history extended; checksum table performance_schema.events_waits_history extended;
checksum table performance_schema.events_waits_history_long extended; checksum table performance_schema.events_waits_history_long extended;
checksum table performance_schema.events_waits_summary_by_account_by_event_name extended;
checksum table performance_schema.events_waits_summary_by_host_by_event_name extended;
checksum table performance_schema.events_waits_summary_by_instance extended; checksum table performance_schema.events_waits_summary_by_instance extended;
checksum table performance_schema.events_waits_summary_by_thread_by_event_name extended; checksum table performance_schema.events_waits_summary_by_thread_by_event_name extended;
checksum table performance_schema.events_waits_summary_by_user_by_event_name extended;
checksum table performance_schema.events_waits_summary_global_by_event_name extended; checksum table performance_schema.events_waits_summary_global_by_event_name extended;
checksum table performance_schema.file_instances extended; checksum table performance_schema.file_instances extended;
checksum table performance_schema.file_summary_by_event_name extended; checksum table performance_schema.file_summary_by_event_name extended;
checksum table performance_schema.file_summary_by_instance extended; checksum table performance_schema.file_summary_by_instance extended;
checksum table performance_schema.hosts extended;
checksum table performance_schema.mutex_instances extended; checksum table performance_schema.mutex_instances extended;
checksum table performance_schema.objects_summary_global_by_type extended;
checksum table performance_schema.performance_timers extended; checksum table performance_schema.performance_timers extended;
checksum table performance_schema.rwlock_instances extended; checksum table performance_schema.rwlock_instances extended;
checksum table performance_schema.setup_actors extended;
checksum table performance_schema.setup_consumers extended; checksum table performance_schema.setup_consumers extended;
checksum table performance_schema.setup_instruments extended; checksum table performance_schema.setup_instruments extended;
checksum table performance_schema.setup_objects extended;
checksum table performance_schema.setup_timers extended; checksum table performance_schema.setup_timers extended;
checksum table performance_schema.table_io_waits_summary_by_index_usage extended;
checksum table performance_schema.table_io_waits_summary_by_table extended;
checksum table performance_schema.table_lock_waits_summary_by_table extended;
checksum table performance_schema.threads extended; checksum table performance_schema.threads extended;
checksum table performance_schema.users extended;

View File

@ -24,5 +24,3 @@ REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'pfs_user_5'@localhost;
DROP USER 'pfs_user_5'@localhost; DROP USER 'pfs_user_5'@localhost;
flush privileges; flush privileges;
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES'; UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
UPDATE performance_schema.setup_consumers SET enabled = 'YES';
UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE';

View File

@ -0,0 +1,875 @@
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user1 in con1a" as status;
status
user1 in con1a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user1 in con1b" as status;
status
user1 in con1b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user1 in con1c" as status;
status
user1 in con1c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user2 in con2a" as status;
status
user2 in con2a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
user2 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
user2 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user2 in con2b" as status;
status
user2 in con2b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
user2 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
user2 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 6 6
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user2 in con2c" as status;
status
user2 in con2c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
user2 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
user2 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user3 in con3a" as status;
status
user3 in con3a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
user2 localhost 3 3
user3 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
user2 3 3
user3 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 8
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user3 in con3b" as status;
status
user3 in con3b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
user2 localhost 3 3
user3 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
user2 3 3
user3 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 9
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user3 in con3c" as status;
status
user3 in con3c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
user2 localhost 3 3
user3 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
user2 3 3
user3 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 10 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con1a disconnected" as status;
status
con1a disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 3
user2 localhost 3 3
user3 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
user2 3 3
user3 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con2a disconnected" as status;
status
con2a disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 3
user2 localhost 2 3
user3 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
user2 2 3
user3 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con3a disconnected" as status;
status
con3a disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 3
user2 localhost 2 3
user3 localhost 2 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
user2 2 3
user3 2 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.accounts;
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
user2 localhost 2 2
user3 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
user2 2 3
user3 2 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.users;
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
user2 localhost 2 2
user3 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
user2 2 2
user3 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.hosts;
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
user2 localhost 2 2
user3 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
user2 2 2
user3 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user4 in con4a" as status;
status
user4 in con4a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
user2 localhost 2 2
user3 localhost 2 2
user4 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
user2 2 2
user3 2 2
user4 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 8
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user4 in con4b" as status;
status
user4 in con4b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
user2 localhost 2 2
user3 localhost 2 2
user4 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
user2 2 2
user3 2 2
user4 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 9
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user4 in con4c" as status;
status
user4 in con4c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
user2 localhost 2 2
user3 localhost 2 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
user2 2 2
user3 2 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 10 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con1b disconnected" as status;
status
con1b disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 2
user2 localhost 2 2
user3 localhost 2 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 2
user2 2 2
user3 2 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con2b disconnected" as status;
status
con2b disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 2
user2 localhost 1 2
user3 localhost 2 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 2
user2 1 2
user3 2 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con3b disconnected" as status;
status
con3b disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user2 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 2
user2 localhost 1 2
user3 localhost 1 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 2
user2 1 2
user3 1 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con1c disconnected" as status;
status
con1c disconnected
call dump_all();
processlist_user processlist_host
root localhost
user2 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 0 2
user2 localhost 1 2
user3 localhost 1 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
user2 1 2
user3 1 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 6 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con2c disconnected" as status;
status
con2c disconnected
call dump_all();
processlist_user processlist_host
root localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 0 2
user2 localhost 0 2
user3 localhost 1 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
user2 0 2
user3 1 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con3c disconnected" as status;
status
con3c disconnected
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 0 2
user2 localhost 0 2
user3 localhost 0 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
user2 0 2
user3 0 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.accounts;
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
user2 0 2
user3 0 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.users;
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.hosts;
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user5 in con5a" as status;
status
user5 in con5a
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
user5 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 3 3
user5 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 3 3
user5 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user5 in con5b" as status;
status
user5 in con5b
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
user5 localhost
user5 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 3 3
user5 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 3 3
user5 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 6 6
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user5 in con5c" as status;
status
user5 in con5c
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
user5 localhost
user5 localhost
user5 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 3 3
user5 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 3 3
user5 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
status
con 5a, 5b, 5c, 6a, 6b, 6c disconnected
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 0 3
user5 localhost 0 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 0 3
user5 0 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.hosts;
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 0 3
user5 0 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.users;
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.accounts;
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0

View File

@ -0,0 +1,820 @@
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user1 in con1a" as status;
status
user1 in con1a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user1 in con1b" as status;
status
user1 in con1b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user1 in con1c" as status;
status
user1 in con1c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user2 in con2a" as status;
status
user2 in con2a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
user2 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 1
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user2 in con2b" as status;
status
user2 in con2b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
user2 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 6 6
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 2
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user2 in con2c" as status;
status
user2 in con2c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
user2 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 3
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user3 in con3a" as status;
status
user3 in con3a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
user2 3 3
user3 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 8
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 4
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user3 in con3b" as status;
status
user3 in con3b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
user2 3 3
user3 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 9
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 5
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user3 in con3c" as status;
status
user3 in con3c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
user2 3 3
user3 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 10 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con1a disconnected" as status;
status
con1a disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
user2 3 3
user3 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con2a disconnected" as status;
status
con2a disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
user2 2 3
user3 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con3a disconnected" as status;
status
con3a disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
user2 2 3
user3 2 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.accounts;
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
user2 2 3
user3 2 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.users;
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
user2 2 2
user3 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.hosts;
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
user2 2 2
user3 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user4 in con4a" as status;
status
user4 in con4a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
user2 2 2
user3 2 2
user4 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 8
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 7
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user4 in con4b" as status;
status
user4 in con4b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
user2 2 2
user3 2 2
user4 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 9
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 8
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user4 in con4c" as status;
status
user4 in con4c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
user2 2 2
user3 2 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 10 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con1b disconnected" as status;
status
con1b disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 2
user2 2 2
user3 2 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con2b disconnected" as status;
status
con2b disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 2
user2 1 2
user3 2 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con3b disconnected" as status;
status
con3b disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user2 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 2
user2 1 2
user3 1 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con1c disconnected" as status;
status
con1c disconnected
call dump_all();
processlist_user processlist_host
root localhost
user2 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 0 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
user2 1 2
user3 1 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 6 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con2c disconnected" as status;
status
con2c disconnected
call dump_all();
processlist_user processlist_host
root localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 0 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
user2 0 2
user3 1 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con3c disconnected" as status;
status
con3c disconnected
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 0 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
user2 0 2
user3 0 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.accounts;
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
user2 0 2
user3 0 2
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.users;
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.hosts;
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user5 in con5a" as status;
status
user5 in con5a
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
user5 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user5 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 3 3
user5 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user5 in con5b" as status;
status
user5 in con5b
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
user5 localhost
user5 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user5 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 3 3
user5 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 6 6
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user5 in con5c" as status;
status
user5 in con5c
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
user5 localhost
user5 localhost
user5 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user5 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 3 3
user5 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
status
con 5a, 5b, 5c, 6a, 6b, 6c disconnected
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user5 localhost 0 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 0 3
user5 0 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.hosts;
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user4 0 3
user5 0 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.users;
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
truncate table performance_schema.accounts;
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0

View File

@ -0,0 +1,762 @@
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user1 in con1a" as status;
status
user1 in con1a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user1 in con1b" as status;
status
user1 in con1b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user1 in con1c" as status;
status
user1 in con1c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user2 in con2a" as status;
status
user2 in con2a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 1
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 1
select "user2 in con2b" as status;
status
user2 in con2b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 6 6
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 2
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
select "user2 in con2c" as status;
status
user2 in con2c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 3
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "user3 in con3a" as status;
status
user3 in con3a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 8
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 4
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 4
select "user3 in con3b" as status;
status
user3 in con3b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 9
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 5
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 5
select "user3 in con3c" as status;
status
user3 in con3c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 10 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 6
select "con1a disconnected" as status;
status
con1a disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 6
select "con2a disconnected" as status;
status
con2a disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 6
select "con3a disconnected" as status;
status
con3a disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 6
truncate table performance_schema.accounts;
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 6
truncate table performance_schema.users;
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 6
truncate table performance_schema.hosts;
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 6
select "user4 in con4a" as status;
status
user4 in con4a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 8
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 7
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 7
select "user4 in con4b" as status;
status
user4 in con4b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 9
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 8
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 8
select "user4 in con4c" as status;
status
user4 in con4c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 10 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
select "con1b disconnected" as status;
status
con1b disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
select "con2b disconnected" as status;
status
con2b disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
select "con3b disconnected" as status;
status
con3b disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user2 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
select "con1c disconnected" as status;
status
con1c disconnected
call dump_all();
processlist_user processlist_host
root localhost
user2 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 0 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 6 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
select "con2c disconnected" as status;
status
con2c disconnected
call dump_all();
processlist_user processlist_host
root localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 0 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
select "con3c disconnected" as status;
status
con3c disconnected
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 0 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
truncate table performance_schema.accounts;
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
truncate table performance_schema.users;
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
truncate table performance_schema.hosts;
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
select "user5 in con5a" as status;
status
user5 in con5a
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
user5 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user5 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user5 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
select "user5 in con5b" as status;
status
user5 in con5b
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
user5 localhost
user5 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user5 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user5 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 6 6
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
select "user5 in con5c" as status;
status
user5 in con5c
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
user5 localhost
user5 localhost
user5 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user5 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user5 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
status
con 5a, 5b, 5c, 6a, 6b, 6c disconnected
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user5 localhost 0 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user5 0 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
truncate table performance_schema.hosts;
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user5 0 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
truncate table performance_schema.users;
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
truncate table performance_schema.accounts;
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9

View File

@ -0,0 +1,817 @@
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user1 in con1a" as status;
status
user1 in con1a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user1 in con1b" as status;
status
user1 in con1b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user1 in con1c" as status;
status
user1 in con1c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
select "user2 in con2a" as status;
status
user2 in con2a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
user2 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 1
select "user2 in con2b" as status;
status
user2 in con2b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
user2 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 6 6
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 1
select "user2 in con2c" as status;
status
user2 in con2c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
user2 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 1
select "user3 in con3a" as status;
status
user3 in con3a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
user2 localhost 3 3
user3 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 8
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
select "user3 in con3b" as status;
status
user3 in con3b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
user2 localhost 3 3
user3 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 9
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
select "user3 in con3c" as status;
status
user3 in con3c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 3 3
user2 localhost 3 3
user3 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 10 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
select "con1a disconnected" as status;
status
con1a disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 3
user2 localhost 3 3
user3 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
select "con2a disconnected" as status;
status
con2a disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 3
user2 localhost 2 3
user3 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
select "con3a disconnected" as status;
status
con3a disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 3
user2 localhost 2 3
user3 localhost 2 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
truncate table performance_schema.accounts;
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
user2 localhost 2 2
user3 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
truncate table performance_schema.users;
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
user2 localhost 2 2
user3 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
truncate table performance_schema.hosts;
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
user2 localhost 2 2
user3 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
select "user4 in con4a" as status;
status
user4 in con4a
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
user2 localhost 2 2
user3 localhost 2 2
user4 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 8
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "user4 in con4b" as status;
status
user4 in con4b
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
user2 localhost 2 2
user3 localhost 2 2
user4 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 9
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "user4 in con4c" as status;
status
user4 in con4c
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 2 2
user2 localhost 2 2
user3 localhost 2 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 10 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "con1b disconnected" as status;
status
con1b disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user2 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 2
user2 localhost 2 2
user3 localhost 2 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 9 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "con2b disconnected" as status;
status
con2b disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user2 localhost
user3 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 2
user2 localhost 1 2
user3 localhost 2 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 8 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "con3b disconnected" as status;
status
con3b disconnected
call dump_all();
processlist_user processlist_host
root localhost
user1 localhost
user2 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 1 2
user2 localhost 1 2
user3 localhost 1 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 1 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "con1c disconnected" as status;
status
con1c disconnected
call dump_all();
processlist_user processlist_host
root localhost
user2 localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 0 2
user2 localhost 1 2
user3 localhost 1 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 6 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "con2c disconnected" as status;
status
con2c disconnected
call dump_all();
processlist_user processlist_host
root localhost
user3 localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 0 2
user2 localhost 0 2
user3 localhost 1 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "con3c disconnected" as status;
status
con3c disconnected
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user1 localhost 0 2
user2 localhost 0 2
user3 localhost 0 2
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
truncate table performance_schema.accounts;
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user1 0 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
truncate table performance_schema.users;
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 10
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
truncate table performance_schema.hosts;
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "user5 in con5a" as status;
status
user5 in con5a
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
user5 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 3 3
user5 localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user5 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "user5 in con5b" as status;
status
user5 in con5b
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
user5 localhost
user5 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 3 3
user5 localhost 2 2
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user5 2 2
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 6 6
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "user5 in con5c" as status;
status
user5 in con5c
call dump_all();
processlist_user processlist_host
root localhost
user4 localhost
user4 localhost
user4 localhost
user5 localhost
user5 localhost
user5 localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 3 3
user5 localhost 3 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user5 3 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 7 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
status
con 5a, 5b, 5c, 6a, 6b, 6c disconnected
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
user4 localhost 0 3
user5 localhost 0 3
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user5 0 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 7
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
truncate table performance_schema.hosts;
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
user5 0 3
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
truncate table performance_schema.users;
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
truncate table performance_schema.accounts;
call dump_all();
processlist_user processlist_host
root localhost
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3

View File

@ -0,0 +1,145 @@
drop table if exists test.marker;
create table test.marker(a int);
update performance_schema.setup_consumers set enabled='NO';
update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES'
where name like "wait/io/table/%";
truncate table performance_schema.events_waits_history_long;
flush status;
flush tables;
drop table if exists test.no_index_tab;
update performance_schema.setup_consumers set enabled='YES';
insert into marker set a = 1;
create table test.no_index_tab
( a varchar(255) not null, b int not null) engine = CSV;
insert into marker set a = 1;
show create table test.no_index_tab;
Table Create Table
no_index_tab CREATE TABLE `no_index_tab` (
`a` varchar(255) NOT NULL,
`b` int(11) NOT NULL
) ENGINE=CSV DEFAULT CHARSET=latin1
insert into marker set a = 1;
insert into test.no_index_tab set a = 'foo', b = 1;
insert into marker set a = 1;
insert into test.no_index_tab set a = 'foo', b = 2;
insert into marker set a = 1;
insert into test.no_index_tab set a = 'foo', b = 3;
insert into marker set a = 1;
select * from test.no_index_tab;
a b
foo 1
foo 2
foo 3
insert into marker set a = 1;
update test.no_index_tab set a = 'bar';
insert into marker set a = 1;
select * from test.no_index_tab limit 2;
a b
bar 1
bar 2
insert into marker set a = 1;
delete from test.no_index_tab where b = 3;
insert into marker set a = 1;
select * from test.no_index_tab;
a b
bar 1
bar 2
insert into marker set a = 1;
optimize table test.no_index_tab;
Table Op Msg_type Msg_text
test.no_index_tab optimize note The storage engine for the table doesn't support optimize
insert into marker set a = 1;
select * from test.no_index_tab;
a b
bar 1
bar 2
insert into marker set a = 1;
truncate table test.no_index_tab;
insert into marker set a = 1;
drop table test.no_index_tab;
update performance_schema.setup_consumers set enabled='NO';
select event_name,
left(source, locate(":", source)) as short_source,
object_type, object_schema,
if (locate("#sql-", object_name), "#sql-XXXX", object_name)
as pretty_name,
operation, number_of_bytes
from performance_schema.events_waits_history_long
where event_name like 'wait/io/table/%'
and object_schema in ("test")
order by thread_id, event_id;
event_name short_source object_type object_schema pretty_name operation number_of_bytes
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab delete NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL
show status like 'performance_schema_%';
Variable_name Value
Performance_schema_accounts_lost 0
Performance_schema_cond_classes_lost 0
Performance_schema_cond_instances_lost 0
Performance_schema_digest_lost 0
Performance_schema_file_classes_lost 0
Performance_schema_file_handles_lost 0
Performance_schema_file_instances_lost 0
Performance_schema_hosts_lost 0
Performance_schema_locker_lost 0
Performance_schema_mutex_classes_lost 0
Performance_schema_mutex_instances_lost 0
Performance_schema_rwlock_classes_lost 0
Performance_schema_rwlock_instances_lost 0
Performance_schema_socket_classes_lost 0
Performance_schema_socket_instances_lost 0
Performance_schema_stage_classes_lost 0
Performance_schema_statement_classes_lost 0
Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
Performance_schema_users_lost 0
truncate performance_schema.events_waits_history_long;
flush status;
update performance_schema.setup_consumers set enabled='NO';
truncate performance_schema.events_waits_history_long;
drop table test.marker;
flush status;
update performance_schema.setup_instruments set enabled='YES';
update performance_schema.setup_consumers set enabled='YES';

View File

@ -0,0 +1,8 @@
alter table performance_schema.accounts
add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.accounts;
ALTER TABLE performance_schema.accounts ADD INDEX test_index(CURRENT_CONNECTIONS);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.accounts(CURRENT_CONNECTIONS);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

View File

@ -0,0 +1,10 @@
alter table performance_schema.events_stages_summary_by_account_by_event_name
add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.events_stages_summary_by_account_by_event_name;
ALTER TABLE performance_schema.events_stages_summary_by_account_by_event_name
ADD INDEX test_index(USERNAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index
ON performance_schema.events_stages_summary_by_account_by_event_name(USERNAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

View File

@ -0,0 +1,10 @@
alter table performance_schema.events_stages_summary_by_host_by_event_name
add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.events_stages_summary_by_host_by_event_name;
ALTER TABLE performance_schema.events_stages_summary_by_host_by_event_name
ADD INDEX test_index(HOSTNAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index
ON performance_schema.events_stages_summary_by_host_by_event_name(HOSTNAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

View File

@ -0,0 +1,9 @@
alter table performance_schema.events_stages_summary_by_thread_by_event_name
add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.events_stages_summary_by_thread_by_event_name;
ALTER TABLE performance_schema.events_stages_summary_by_thread_by_event_name ADD INDEX test_index(THREAD_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index
ON performance_schema.events_stages_summary_by_thread_by_event_name(THREAD_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

View File

@ -0,0 +1,10 @@
alter table performance_schema.events_stages_summary_by_user_by_event_name
add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.events_stages_summary_by_user_by_event_name;
ALTER TABLE performance_schema.events_stages_summary_by_user_by_event_name
ADD INDEX test_index(USERNAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index
ON performance_schema.events_stages_summary_by_user_by_event_name(USERNAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

View File

@ -0,0 +1,10 @@
alter table performance_schema.events_stages_summary_global_by_event_name
add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.events_stages_summary_global_by_event_name;
ALTER TABLE performance_schema.events_stages_summary_global_by_event_name
ADD INDEX test_index(EVENT_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index
ON performance_schema.events_stages_summary_global_by_event_name(EVENT_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

View File

@ -0,0 +1,10 @@
alter table performance_schema.events_statements_summary_by_account_by_event_name
add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
truncate table performance_schema.events_statements_summary_by_account_by_event_name;
ALTER TABLE performance_schema.events_statements_summary_by_account_by_event_name
ADD INDEX test_index(USERNAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index
ON performance_schema.events_statements_summary_by_account_by_event_name(USERNAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

Some files were not shown because too many files have changed in this diff Show More