diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h index 1d2ec34fc98..533c440d4f9 100644 --- a/include/mysql/psi/mysql_file.h +++ b/include/mysql/psi/mysql_file.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -48,6 +48,10 @@ #include "mysql/psi/psi.h" +#ifndef PSI_FILE_CALL +#define PSI_FILE_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + /** @defgroup File_instrumentation File Instrumentation @ingroup Instrumentation_interface @@ -295,7 +299,7 @@ */ #ifdef HAVE_PSI_FILE_INTERFACE #define mysql_file_create_temp(K, T, D, P, M, F) \ - inline_mysql_file_create_temp(K, T, D, P, M, F) + inline_mysql_file_create_temp(K, __FILE__, __LINE__, T, D, P, M, F) #else #define mysql_file_create_temp(K, T, D, P, M, F) \ inline_mysql_file_create_temp(T, D, P, M, F) @@ -828,7 +832,8 @@ inline_mysql_file_fopen( const char *filename, int flags, myf myFlags) { MYSQL_FILE *that; - that= (MYSQL_FILE*) my_malloc(sizeof(MYSQL_FILE), MYF(MY_WME)); + that= (MYSQL_FILE*) my_malloc(PSI_NOT_INSTRUMENTED, + sizeof(MYSQL_FILE), MYF(MY_WME)); if (likely(that != NULL)) { #ifdef HAVE_PSI_FILE_INTERFACE @@ -1052,20 +1057,27 @@ inline_mysql_file_create( static inline File inline_mysql_file_create_temp( #ifdef HAVE_PSI_FILE_INTERFACE - PSI_file_key key, + PSI_file_key key, const char *src_file, uint src_line, #endif char *to, const char *dir, const char *pfx, int mode, myf myFlags) { File file; - /* - TODO: This event is instrumented, but not timed. - The problem is that the file name is now known - before the create_temp_file call. - */ - file= create_temp_file(to, dir, pfx, mode, myFlags); #ifdef HAVE_PSI_FILE_INTERFACE - PSI_FILE_CALL(create_file)(key, to, file); + struct PSI_file_locker *locker; + PSI_file_locker_state state; + locker= PSI_FILE_CALL(get_thread_file_name_locker) + (&state, key, PSI_FILE_CREATE, NULL, &locker); + if (likely(locker != NULL)) + { + PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line); + /* The file name is generated by create_temp_file(). */ + file= create_temp_file(to, dir, pfx, mode, myFlags); + PSI_FILE_CALL(end_temp_file_open_wait_and_bind_to_descriptor)(locker, file, (const char*)to); + return file; + } #endif + + file= create_temp_file(to, dir, pfx, mode, myFlags); return file; } @@ -1355,12 +1367,13 @@ inline_mysql_file_rename( { struct PSI_file_locker *locker; PSI_file_locker_state state; - locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_RENAME, to, &locker); + locker= PSI_FILE_CALL(get_thread_file_name_locker) + (&state, key, PSI_FILE_RENAME, from, &locker); if (likely(locker != NULL)) { PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); result= my_rename(from, to, flags); - PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0); + PSI_FILE_CALL(end_file_rename_wait)(locker, from, to, result); return result; } } @@ -1449,12 +1462,13 @@ inline_mysql_file_rename_with_symlink( { struct PSI_file_locker *locker; PSI_file_locker_state state; - locker= PSI_FILE_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_RENAME, to, &locker); + locker= PSI_FILE_CALL(get_thread_file_name_locker) + (&state, key, PSI_FILE_RENAME, from, &locker); if (likely(locker != NULL)) { PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); result= my_rename_with_symlink(from, to, flags); - PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0); + PSI_FILE_CALL(end_file_rename_wait)(locker, from, to, result); return result; } } diff --git a/include/mysql/psi/mysql_idle.h b/include/mysql/psi/mysql_idle.h index 1eb19f8f684..f8085073af6 100644 --- a/include/mysql/psi/mysql_idle.h +++ b/include/mysql/psi/mysql_idle.h @@ -1,5 +1,5 @@ /* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - Copyright (c) 2017, MariaDB Corporation. + Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -31,6 +31,10 @@ #include "mysql/psi/psi.h" +#ifndef PSI_IDLE_CALL +#define PSI_IDLE_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + /** @defgroup Idle_instrumentation Idle Instrumentation @ingroup Instrumentation_interface diff --git a/include/mysql/psi/mysql_mdl.h b/include/mysql/psi/mysql_mdl.h new file mode 100644 index 00000000000..0db0160c77d --- /dev/null +++ b/include/mysql/psi/mysql_mdl.h @@ -0,0 +1,128 @@ +/* Copyright (c) 2012, 2015, 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, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. + + 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, version 2.0, 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef MYSQL_MDL_H +#define MYSQL_MDL_H + +/** + @file mysql/psi/mysql_mdl.h + Instrumentation helpers for metadata locks. +*/ + +#include "mysql/psi/psi.h" + +#ifndef PSI_METADATA_CALL +#define PSI_METADATA_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + +/** + @defgroup Thread_instrumentation Metadata Instrumentation + @ingroup Instrumentation_interface + @{ +*/ + +/** + @def mysql_mdl_create(K, M, A) + Instrumented metadata lock creation. + @param I Metadata lock identity + @param K Metadata key + @param T Metadata lock type + @param D Metadata lock duration + @param S Metadata lock status + @param F request source file + @param L request source line +*/ + +#ifdef HAVE_PSI_METADATA_INTERFACE + #define mysql_mdl_create(I, K, T, D, S, F, L) \ + inline_mysql_mdl_create(I, K, T, D, S, F, L) +#else + #define mysql_mdl_create(I, K, T, D, S, F, L) NULL +#endif + +#ifdef HAVE_PSI_METADATA_INTERFACE + #define mysql_mdl_set_status(L, S) \ + inline_mysql_mdl_set_status(L, S) +#else + #define mysql_mdl_set_status(L, S) \ + do {} while (0) +#endif + + +/** + @def mysql_mdl_destroy(M) + Instrumented metadata lock destruction. + @param M Metadata lock +*/ +#ifdef HAVE_PSI_METADATA_INTERFACE + #define mysql_mdl_destroy(M) \ + inline_mysql_mdl_destroy(M, __FILE__, __LINE__) +#else + #define mysql_mdl_destroy(M) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_METADATA_INTERFACE + +static inline PSI_metadata_lock * +inline_mysql_mdl_create(void *identity, + const MDL_key *mdl_key, + enum_mdl_type mdl_type, + enum_mdl_duration mdl_duration, + MDL_ticket::enum_psi_status mdl_status, + const char *src_file, uint src_line) +{ + PSI_metadata_lock *result; + + /* static_cast: Fit a round C++ enum peg into a square C int hole ... */ + result= PSI_METADATA_CALL(create_metadata_lock) + (identity, + mdl_key, + static_cast (mdl_type), + static_cast (mdl_duration), + static_cast (mdl_status), + src_file, src_line); + + return result; +} + +static inline void inline_mysql_mdl_set_status( + PSI_metadata_lock *psi, + MDL_ticket::enum_psi_status mdl_status) +{ + if (psi != NULL) + PSI_METADATA_CALL(set_metadata_lock_status)(psi, mdl_status); +} + +static inline void inline_mysql_mdl_destroy( + PSI_metadata_lock *psi, + const char *src_file, uint src_line) +{ + if (psi != NULL) + PSI_METADATA_CALL(destroy_metadata_lock)(psi); +} +#endif /* HAVE_PSI_METADATA_INTERFACE */ + +/** @} (end of group Metadata_instrumentation) */ + +#endif + diff --git a/include/mysql/psi/mysql_memory.h b/include/mysql/psi/mysql_memory.h new file mode 100644 index 00000000000..c491ef4570c --- /dev/null +++ b/include/mysql/psi/mysql_memory.h @@ -0,0 +1,69 @@ +/* Copyright (c) 2012, 2016, 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, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. + + 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, version 2.0, 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef MYSQL_MEMORY_H +#define MYSQL_MEMORY_H + +/** + @file mysql/psi/mysql_memory.h + Instrumentation helpers for memory allocation. +*/ + +#include "mysql/psi/psi.h" + +#ifndef PSI_MEMORY_CALL +#define PSI_MEMORY_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + +/** + @defgroup Memory_instrumentation Memory Instrumentation + @ingroup Instrumentation_interface + @{ +*/ + +/** + @def mysql_memory_register(P1, P2, P3) + Memory registration. +*/ +#define mysql_memory_register(P1, P2, P3) \ + inline_mysql_memory_register(P1, P2, P3) + +static inline void inline_mysql_memory_register( +#ifdef HAVE_PSI_MEMORY_INTERFACE + const char *category, + PSI_memory_info *info, + int count) +#else + const char *category __attribute__((unused)), + void *info __attribute__((unused)), + int count __attribute__((unused))) +#endif +{ +#ifdef HAVE_PSI_MEMORY_INTERFACE + PSI_MEMORY_CALL(register_memory)(category, info, count); +#endif +} + +/** @} (end of group Memory_instrumentation) */ + +#endif + diff --git a/include/mysql/psi/mysql_ps.h b/include/mysql/psi/mysql_ps.h new file mode 100644 index 00000000000..e68994d949c --- /dev/null +++ b/include/mysql/psi/mysql_ps.h @@ -0,0 +1,110 @@ +/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. + + 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, version 2.0, 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 */ + +#ifndef MYSQL_PS_H +#define MYSQL_PS_H + +/** + @file mysql/psi/mysql_ps.h + Instrumentation helpers for prepared statements. +*/ + +#include "mysql/psi/psi.h" + +#ifndef PSI_PS_CALL +#define PSI_PS_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + +#ifdef HAVE_PSI_PS_INTERFACE + #define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) \ + inline_mysql_create_prepared_stmt(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) + #define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \ + inline_mysql_execute_prepared_stmt(LOCKER, PREPARED_STMT) + #define MYSQL_DESTROY_PS(PREPARED_STMT) \ + inline_mysql_destroy_prepared_stmt(PREPARED_STMT) + #define MYSQL_REPREPARE_PS(PREPARED_STMT) \ + inline_mysql_reprepare_prepared_stmt(PREPARED_STMT) + #define MYSQL_SET_PS_TEXT(PREPARED_STMT, SQLTEXT, SQLTEXT_LENGTH) \ + inline_mysql_set_prepared_stmt_text(PREPARED_STMT, SQLTEXT, SQLTEXT_LENGTH) +#else + #define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) \ + NULL + #define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \ + do {} while (0) + #define MYSQL_DESTROY_PS(PREPARED_STMT) \ + do {} while (0) + #define MYSQL_REPREPARE_PS(PREPARED_STMT) \ + do {} while (0) + #define MYSQL_SET_PS_TEXT(PREPARED_STMT, SQLTEXT, SQLTEXT_LENGTH) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_PS_INTERFACE +static inline struct PSI_prepared_stmt* +inline_mysql_create_prepared_stmt(void *identity, uint stmt_id, + PSI_statement_locker *locker, + const char *stmt_name, size_t stmt_name_length, + const char *sqltext, size_t sqltext_length) +{ + if (locker == NULL) + return NULL; + return PSI_PS_CALL(create_prepared_stmt)(identity, stmt_id, + locker, + stmt_name, stmt_name_length, + sqltext, sqltext_length); +} + +static inline void +inline_mysql_execute_prepared_stmt(PSI_statement_locker *locker, + PSI_prepared_stmt* prepared_stmt) +{ + if (prepared_stmt != NULL && locker != NULL) + PSI_PS_CALL(execute_prepared_stmt)(locker, prepared_stmt); +} + +static inline void +inline_mysql_destroy_prepared_stmt(PSI_prepared_stmt *prepared_stmt) +{ + if (prepared_stmt != NULL) + PSI_PS_CALL(destroy_prepared_stmt)(prepared_stmt); +} + +static inline void +inline_mysql_reprepare_prepared_stmt(PSI_prepared_stmt *prepared_stmt) +{ + if (prepared_stmt != NULL) + PSI_PS_CALL(reprepare_prepared_stmt)(prepared_stmt); +} + +static inline void +inline_mysql_set_prepared_stmt_text(PSI_prepared_stmt *prepared_stmt, + const char *text, + uint text_len) +{ + if (prepared_stmt != NULL) + { + PSI_PS_CALL(set_prepared_stmt_text)(prepared_stmt, text, text_len); + } +} +#endif + +#endif diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h index d0302edd09b..765c5aa7793 100644 --- a/include/mysql/psi/mysql_socket.h +++ b/include/mysql/psi/mysql_socket.h @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA /* For my_chsize */ #include /* For socket api */ -#ifdef __WIN__ +#ifdef _WIN32 #include #include #include @@ -47,6 +47,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA #include "mysql/psi/psi.h" +#ifndef PSI_SOCKET_CALL +#define PSI_SOCKET_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + /** @defgroup Socket_instrumentation Socket Instrumentation @ingroup Instrumentation_interface @@ -65,6 +69,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA do {} while (0) #endif +/** An instrumented socket. */ struct st_mysql_socket { /** The real socket descriptor. */ @@ -107,9 +112,8 @@ mysql_socket_invalid() /** Set socket descriptor and address. @param socket nstrumented socket - @param fd socket descriptor @param addr unformatted socket address - @param adr_len length of socket address + @param addr_len length of socket address */ static inline void @@ -134,7 +138,6 @@ mysql_socket_set_address( /** Set socket descriptor and address. @param socket instrumented socket - @param thread instrumented owning thread */ static inline void mysql_socket_set_thread_owner( @@ -201,7 +204,6 @@ mysql_socket_setfd(MYSQL_SOCKET *mysql_socket, my_socket fd) @param STATE locker state @param SOCKET instrumented socket @param OP The socket operation to be performed - @param FLAGS per-socket operation flags. @param COUNT bytes to be written/read @sa MYSQL_END_SOCKET_WAIT. */ @@ -230,6 +232,13 @@ mysql_socket_setfd(MYSQL_SOCKET *mysql_socket, my_socket fd) do {} while (0) #endif +/** + @def MYSQL_SOCKET_SET_STATE + Set the state (IDLE, ACTIVE) of an instrumented socket. + @param SOCKET the instrumented socket + @param STATE the new state + @sa PSI_socket_state +*/ #ifdef HAVE_PSI_SOCKET_INTERFACE #define MYSQL_SOCKET_SET_STATE(SOCKET, STATE) \ inline_mysql_socket_set_state(SOCKET, STATE) @@ -325,8 +334,8 @@ inline_mysql_socket_set_state(MYSQL_SOCKET socket, enum PSI_socket_state state) Return port number and IP address of the local host @c mysql_socket_getsockname is a replacement for @c getsockname. @param FD Instrumented socket descriptor returned by socket() - @param A Pointer to returned address of local host in sockaddr structure - @param L Pointer to length of sockaddr structure + @param AP Pointer to returned address of local host in @c sockaddr structure + @param LP Pointer to length of @c sockaddr structure */ #ifdef HAVE_PSI_SOCKET_INTERFACE #define mysql_socket_getsockname(FD, AP, LP) \ @@ -430,7 +439,7 @@ inline_mysql_socket_set_state(MYSQL_SOCKET socket, enum PSI_socket_state state) @param N Maximum bytes to receive @param FL Control flags @param AP Pointer to source address in sockaddr_storage structure - @param L Size of sockaddr_storage structure + @param LP Size of sockaddr_storage structure */ #ifdef HAVE_PSI_SOCKET_INTERFACE #define mysql_socket_recvfrom(FD, B, N, FL, AP, LP) \ @@ -476,6 +485,19 @@ inline_mysql_socket_set_state(MYSQL_SOCKET socket, enum PSI_socket_state state) inline_mysql_socket_setsockopt(FD, LV, ON, OP, OL) #endif +/** + @def mysql_sock_set_nonblocking + Set socket to non-blocking. + @param FD instrumented socket descriptor +*/ +#ifdef HAVE_PSI_SOCKET_INTERFACE + #define mysql_sock_set_nonblocking(FD) \ + inline_mysql_sock_set_nonblocking(__FILE__, __LINE__, FD) +#else + #define mysql_sock_set_nonblocking(FD) \ + inline_mysql_sock_set_nonblocking(FD) +#endif + /** @def mysql_socket_listen(FD, N) Set socket state to listen for an incoming connection. @@ -972,6 +994,78 @@ inline_mysql_socket_setsockopt return result; } +/** set_socket_nonblock */ +static inline int +set_socket_nonblock(my_socket fd) +{ + int ret= 0; +#ifdef _WIN32 + { + u_long nonblocking= 1; + ret= ioctlsocket(fd, FIONBIO, &nonblocking); + } +#else + { + int fd_flags; + fd_flags= fcntl(fd, F_GETFL, 0); + if (fd_flags < 0) + return errno; +#if defined(O_NONBLOCK) + fd_flags |= O_NONBLOCK; +#elif defined(O_NDELAY) + fd_flags |= O_NDELAY; +#elif defined(O_FNDELAY) + fd_flags |= O_FNDELAY; +#else +#error "No definition of non-blocking flag found." +#endif /* O_NONBLOCK */ + if (fcntl(fd, F_SETFL, fd_flags) == -1) + ret= errno; + } +#endif /* _WIN32 */ + return ret; +} + +/** mysql_socket_set_nonblocking */ + +static inline int +inline_mysql_sock_set_nonblocking +( +#ifdef HAVE_PSI_SOCKET_INTERFACE + const char *src_file, uint src_line, +#endif + MYSQL_SOCKET mysql_socket +) +{ + int result= 0; + +#ifdef HAVE_PSI_SOCKET_INTERFACE + if (mysql_socket.m_psi) + { + /* Instrumentation start */ + PSI_socket_locker *locker; + PSI_socket_locker_state state; + locker= PSI_SOCKET_CALL(start_socket_wait) + (&state, mysql_socket.m_psi, PSI_SOCKET_OPT, + (size_t)0, src_file, src_line); + + /* Instrumented code */ + result= set_socket_nonblock(mysql_socket.fd); + + /* Instrumentation end */ + if (locker != NULL) + PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0); + + return result; + } +#endif + + /* Non instrumented code */ + result= set_socket_nonblock(mysql_socket.fd); + + return result; +} + /** mysql_socket_listen */ static inline int @@ -1136,7 +1230,7 @@ inline_mysql_socket_shutdown { int result; -#ifdef __WIN__ +#ifdef _WIN32 static LPFN_DISCONNECTEX DisconnectEx = NULL; if (DisconnectEx == NULL) { @@ -1159,7 +1253,7 @@ inline_mysql_socket_shutdown (&state, mysql_socket.m_psi, PSI_SOCKET_SHUTDOWN, (size_t)0, src_file, src_line); /* Instrumented code */ -#ifdef __WIN__ +#ifdef _WIN32 if (DisconnectEx) result= (DisconnectEx(mysql_socket.fd, (LPOVERLAPPED) NULL, (DWORD) 0, (DWORD) 0) == TRUE) ? 0 : -1; @@ -1176,7 +1270,7 @@ inline_mysql_socket_shutdown #endif /* Non instrumented code */ -#ifdef __WIN__ +#ifdef _WIN32 if (DisconnectEx) result= (DisconnectEx(mysql_socket.fd, (LPOVERLAPPED) NULL, (DWORD) 0, (DWORD) 0) == TRUE) ? 0 : -1; diff --git a/include/mysql/psi/mysql_sp.h b/include/mysql/psi/mysql_sp.h new file mode 100644 index 00000000000..5eeea37f4c4 --- /dev/null +++ b/include/mysql/psi/mysql_sp.h @@ -0,0 +1,104 @@ +/* Copyright (c) 2013, 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, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. + + 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, version 2.0, 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 */ + +#ifndef MYSQL_SP_H +#define MYSQL_SP_H + +/** + @file mysql/psi/mysql_sp.h + Instrumentation helpers for stored programs. +*/ + +#include "mysql/psi/psi.h" + +#ifndef PSI_SP_CALL +#define PSI_SP_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + +#ifdef HAVE_PSI_SP_INTERFACE + #define MYSQL_START_SP(STATE, SP_SHARE) \ + inline_mysql_start_sp(STATE, SP_SHARE) +#else + #define MYSQL_START_SP(STATE, SP_SHARE) \ + NULL +#endif + + +#ifdef HAVE_PSI_SP_INTERFACE + #define MYSQL_END_SP(LOCKER) \ + inline_mysql_end_sp(LOCKER) +#else + #define MYSQL_END_SP(LOCKER) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_SP_INTERFACE + #define MYSQL_DROP_SP(OT, SN, SNL, ON, ONL) \ + inline_mysql_drop_sp(OT, SN, SNL, ON, ONL) +#else + #define MYSQL_DROP_SP(OT, SN, SNL, ON, ONL) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_SP_INTERFACE + #define MYSQL_GET_SP_SHARE(OT, SN, SNL, ON, ONL) \ + inline_mysql_get_sp_share(OT, SN, SNL, ON, ONL) +#else + #define MYSQL_GET_SP_SHARE(OT, SN, SNL, ON, ONL) \ + NULL +#endif + +#ifdef HAVE_PSI_SP_INTERFACE +static inline struct PSI_sp_locker* +inline_mysql_start_sp(PSI_sp_locker_state *state, PSI_sp_share *sp_share) +{ + return PSI_SP_CALL(start_sp)(state, sp_share); +} + +static inline void inline_mysql_end_sp(PSI_sp_locker *locker) +{ + if (likely(locker != NULL)) + PSI_SP_CALL(end_sp)(locker); +} + +static inline void +inline_mysql_drop_sp(uint sp_type, + const char* schema_name, uint shcema_name_length, + const char* object_name, uint object_name_length) +{ + PSI_SP_CALL(drop_sp)(sp_type, + schema_name, shcema_name_length, + object_name, object_name_length); +} + +static inline PSI_sp_share* +inline_mysql_get_sp_share(uint sp_type, + const char* schema_name, uint shcema_name_length, + const char* object_name, uint object_name_length) +{ + return PSI_SP_CALL(get_sp_share)(sp_type, + schema_name, shcema_name_length, + object_name, object_name_length); +} +#endif + +#endif diff --git a/include/mysql/psi/mysql_stage.h b/include/mysql/psi/mysql_stage.h index 1dbaed6c682..9af5a7110df 100644 --- a/include/mysql/psi/mysql_stage.h +++ b/include/mysql/psi/mysql_stage.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2014, 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, version 2.0, @@ -30,6 +30,10 @@ #include "mysql/psi/psi.h" +#ifndef PSI_STAGE_CALL +#define PSI_STAGE_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + /** @defgroup Stage_instrumentation Stage Instrumentation @ingroup Instrumentation_interface @@ -48,12 +52,48 @@ do {} while (0) #endif +/** + @def MYSQL_SET_STAGE + Set the current stage. + Use this API when the file and line + is passed from the caller. + @param K the stage key + @param F the source file name + @param L the source file line + @return the current stage progress +*/ #ifdef HAVE_PSI_STAGE_INTERFACE #define MYSQL_SET_STAGE(K, F, L) \ inline_mysql_set_stage(K, F, L) #else #define MYSQL_SET_STAGE(K, F, L) \ - do {} while (0) + NULL +#endif + +/** + @def mysql_set_stage + Set the current stage. + @param K the stage key + @return the current stage progress +*/ +#ifdef HAVE_PSI_STAGE_INTERFACE + #define mysql_set_stage(K) \ + inline_mysql_set_stage(K, __FILE__, __LINE__) +#else + #define mysql_set_stage(K) \ + NULL +#endif + +/** + @def mysql_end_stage + End the last stage +*/ +#ifdef HAVE_PSI_STAGE_INTERFACE + #define mysql_end_stage \ + inline_mysql_end_stage +#else + #define mysql_end_stage \ + do {} while (0) #endif #ifdef HAVE_PSI_STAGE_INTERFACE @@ -65,11 +105,97 @@ static inline void inline_mysql_stage_register( #endif #ifdef HAVE_PSI_STAGE_INTERFACE -static inline void +static inline PSI_stage_progress* inline_mysql_set_stage(PSI_stage_key key, const char *src_file, int src_line) { - PSI_STAGE_CALL(start_stage)(key, src_file, src_line); + return PSI_STAGE_CALL(start_stage)(key, src_file, src_line); +} +#endif + +#ifdef HAVE_PSI_STAGE_INTERFACE +static inline void +inline_mysql_end_stage() +{ + PSI_STAGE_CALL(end_stage)(); +} +#endif + +#ifdef HAVE_PSI_STAGE_INTERFACE +#define mysql_stage_set_work_completed(P1, P2) \ + inline_mysql_stage_set_work_completed(P1, P2) + +#define mysql_stage_get_work_completed(P1) \ + inline_mysql_stage_get_work_completed(P1) +#else +#define mysql_stage_set_work_completed(P1, P2) \ + do {} while (0) + +#define mysql_stage_get_work_completed(P1) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_STAGE_INTERFACE +#define mysql_stage_inc_work_completed(P1, P2) \ + inline_mysql_stage_inc_work_completed(P1, P2) +#else +#define mysql_stage_inc_work_completed(P1, P2) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_STAGE_INTERFACE +#define mysql_stage_set_work_estimated(P1, P2) \ + inline_mysql_stage_set_work_estimated(P1, P2) + +#define mysql_stage_get_work_estimated(P1) \ + inline_mysql_stage_get_work_estimated(P1) +#else +#define mysql_stage_set_work_estimated(P1, P2) \ + do {} while (0) + +#define mysql_stage_get_work_estimated(P1) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_STAGE_INTERFACE +static inline void +inline_mysql_stage_set_work_completed(PSI_stage_progress *progress, + ulonglong val) +{ + if (progress != NULL) + progress->m_work_completed= val; +} + +static inline ulonglong +inline_mysql_stage_get_work_completed(PSI_stage_progress *progress) +{ + return progress->m_work_completed; +} +#endif + +#ifdef HAVE_PSI_STAGE_INTERFACE +static inline void +inline_mysql_stage_inc_work_completed(PSI_stage_progress *progress, + ulonglong val) +{ + if (progress != NULL) + progress->m_work_completed+= val; +} +#endif + +#ifdef HAVE_PSI_STAGE_INTERFACE +static inline void +inline_mysql_stage_set_work_estimated(PSI_stage_progress *progress, + ulonglong val) +{ + if (progress != NULL) + progress->m_work_estimated= val; +} + +static inline ulonglong +inline_mysql_stage_get_work_estimated(PSI_stage_progress *progress) +{ + return progress->m_work_estimated; } #endif diff --git a/include/mysql/psi/mysql_statement.h b/include/mysql/psi/mysql_statement.h index 6d38131ea99..fab23d2c5c2 100644 --- a/include/mysql/psi/mysql_statement.h +++ b/include/mysql/psi/mysql_statement.h @@ -1,5 +1,5 @@ /* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. - Copyright (c) 2017, MariaDB Corporation. + Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -31,6 +31,17 @@ #include "mysql/psi/psi.h" +class Diagnostics_area; +typedef const struct charset_info_st CHARSET_INFO; + +#ifndef PSI_STATEMENT_CALL +#define PSI_STATEMENT_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + +#ifndef PSI_DIGEST_CALL +#define PSI_DIGEST_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + /** @defgroup Statement_instrumentation Statement Instrumentation @ingroup Instrumentation_interface @@ -66,10 +77,10 @@ #endif #ifdef HAVE_PSI_STATEMENT_INTERFACE - #define MYSQL_START_STATEMENT(STATE, K, DB, DB_LEN, CS) \ - inline_mysql_start_statement(STATE, K, DB, DB_LEN, CS, __FILE__, __LINE__) + #define MYSQL_START_STATEMENT(STATE, K, DB, DB_LEN, CS, SPS) \ + inline_mysql_start_statement(STATE, K, DB, DB_LEN, CS, SPS, __FILE__, __LINE__) #else - #define MYSQL_START_STATEMENT(STATE, K, DB, DB_LEN, CS) \ + #define MYSQL_START_STATEMENT(STATE, K, DB, DB_LEN, CS, SPS) \ NULL #endif @@ -153,11 +164,13 @@ static inline struct PSI_statement_locker * inline_mysql_start_statement(PSI_statement_locker_state *state, PSI_statement_key key, const char *db, size_t db_len, - const CHARSET_INFO *charset, + CHARSET_INFO *charset, + PSI_sp_share *sp_share, const char *src_file, uint src_line) { PSI_statement_locker *locker; - locker= PSI_STATEMENT_CALL(get_thread_statement_locker)(state, key, charset); + locker= PSI_STATEMENT_CALL(get_thread_statement_locker)(state, key, charset, + sp_share); if (psi_likely(locker != NULL)) PSI_STATEMENT_CALL(start_statement)(locker, db, (uint)db_len, src_file, src_line); return locker; diff --git a/include/mysql/psi/mysql_table.h b/include/mysql/psi/mysql_table.h index c1244e38866..5bbe8cef929 100644 --- a/include/mysql/psi/mysql_table.h +++ b/include/mysql/psi/mysql_table.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. - Copyright (c) 2017, MariaDB Corporation. +/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -31,6 +31,10 @@ #include "mysql/psi/psi.h" +#ifndef PSI_TABLE_CALL +#define PSI_TABLE_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + /** @defgroup Table_instrumentation Table Instrumentation @ingroup Instrumentation_interface @@ -54,7 +58,7 @@ #define PSI_CALL_unbind_table(A1) do { } while(0) #define PSI_CALL_rebind_table(A1,A2,A3) NULL -#define PSI_CALL_close_table(A1) do { } while(0) +#define PSI_CALL_close_table(A1,A2) do { } while(0) #define PSI_CALL_open_table(A1,A2) NULL #define PSI_CALL_get_table_share(A1,A2) NULL #define PSI_CALL_release_table_share(A1) do { } while(0) @@ -81,72 +85,6 @@ #define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE) #endif -/** - @def MYSQL_TABLE_IO_WAIT - Instrumentation helper for table io_waits. - This instrumentation marks the start of a wait event. - @param PSI the instrumented table - @param OP the table operation to be performed - @param INDEX the table index used if any, or MAY_KEY. - @param FLAGS per table operation flags. - @sa MYSQL_END_TABLE_WAIT. -*/ -#ifdef HAVE_PSI_TABLE_INTERFACE - #define MYSQL_TABLE_IO_WAIT(PSI, OP, INDEX, FLAGS, PAYLOAD) \ - { \ - if (psi_likely(PSI != NULL)) \ - { \ - PSI_table_locker *locker; \ - PSI_table_locker_state state; \ - locker= PSI_TABLE_CALL(start_table_io_wait) \ - (& state, PSI, OP, INDEX, __FILE__, __LINE__); \ - PAYLOAD \ - if (locker != NULL) \ - PSI_TABLE_CALL(end_table_io_wait)(locker); \ - } \ - else \ - { \ - PAYLOAD \ - } \ - } -#else - #define MYSQL_TABLE_IO_WAIT(PSI, OP, INDEX, FLAGS, PAYLOAD) \ - PAYLOAD -#endif - -/** - @def MYSQL_TABLE_LOCK_WAIT - Instrumentation helper for table io_waits. - This instrumentation marks the start of a wait event. - @param PSI the instrumented table - @param OP the table operation to be performed - @param INDEX the table index used if any, or MAY_KEY. - @param FLAGS per table operation flags. - @sa MYSQL_END_TABLE_WAIT. -*/ -#ifdef HAVE_PSI_TABLE_INTERFACE - #define MYSQL_TABLE_LOCK_WAIT(PSI, OP, FLAGS, PAYLOAD) \ - { \ - if (psi_likely(PSI != NULL)) \ - { \ - PSI_table_locker *locker; \ - PSI_table_locker_state state; \ - locker= PSI_TABLE_CALL(start_table_lock_wait) \ - (& state, PSI, OP, FLAGS, __FILE__, __LINE__); \ - PAYLOAD \ - if (locker != NULL) \ - PSI_TABLE_CALL(end_table_lock_wait)(locker); \ - } \ - else \ - { \ - PAYLOAD \ - } \ - } -#else - #define MYSQL_TABLE_LOCK_WAIT(PSI, OP, FLAGS, PAYLOAD) \ - PAYLOAD -#endif - /** @def MYSQL_START_TABLE_LOCK_WAIT Instrumentation helper for table lock waits. @@ -182,6 +120,14 @@ do {} while (0) #endif +#ifdef HAVE_PSI_TABLE_INTERFACE + #define MYSQL_UNLOCK_TABLE(T) \ + inline_mysql_unlock_table(T) +#else + #define MYSQL_UNLOCK_TABLE(T) \ + do {} while (0) +#endif + #ifdef HAVE_PSI_TABLE_INTERFACE /** Instrumentation calls for MYSQL_START_TABLE_LOCK_WAIT. @@ -213,6 +159,13 @@ inline_mysql_end_table_lock_wait(struct PSI_table_locker *locker) if (psi_likely(locker != NULL)) PSI_TABLE_CALL(end_table_lock_wait)(locker); } + +static inline void +inline_mysql_unlock_table(struct PSI_table *table) +{ + if (table != NULL) + PSI_TABLE_CALL(unlock_table)(table); +} #endif /** @} (end of group Table_instrumentation) */ diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h index eab87402140..071ea66e656 100644 --- a/include/mysql/psi/mysql_thread.h +++ b/include/mysql/psi/mysql_thread.h @@ -62,6 +62,27 @@ */ #include "mysql/psi/psi.h" +#ifdef MYSQL_SERVER +#ifndef MYSQL_DYNAMIC_PLUGIN +#include "pfs_thread_provider.h" +#endif +#endif + +#ifndef PSI_MUTEX_CALL +#define PSI_MUTEX_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + +#ifndef PSI_RWLOCK_CALL +#define PSI_RWLOCK_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + +#ifndef PSI_COND_CALL +#define PSI_COND_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + +#ifndef PSI_THREAD_CALL +#define PSI_THREAD_CALL(M) PSI_DYNAMIC_CALL(M) +#endif /** @defgroup Thread_instrumentation Thread Instrumentation @@ -80,7 +101,7 @@ #define PSI_CALL_set_thread_id PSI_THREAD_CALL(set_thread_id) #define PSI_CALL_set_thread_info PSI_THREAD_CALL(set_thread_info) #define PSI_CALL_set_thread_start_time PSI_THREAD_CALL(set_thread_start_time) -#define PSI_CALL_set_thread_user_host PSI_THREAD_CALL(set_thread_user_host) +#define PSI_CALL_set_thread_account PSI_THREAD_CALL(set_thread_account) #define PSI_CALL_spawn_thread PSI_THREAD_CALL(spawn_thread) #else #define PSI_CALL_delete_current_thread() do { } while(0) @@ -93,7 +114,7 @@ #define PSI_CALL_set_thread_id(A1,A2) do { } while(0) #define PSI_CALL_set_thread_info(A1, A2) do { } while(0) #define PSI_CALL_set_thread_start_time(A1) do { } while(0) -#define PSI_CALL_set_thread_user_host(A1, A2, A3, A4) do { } while(0) +#define PSI_CALL_set_thread_account(A1, A2, A3, A4) do { } while(0) #define PSI_CALL_spawn_thread(A1, A2, A3, A4, A5) 0 #endif @@ -256,11 +277,19 @@ typedef struct st_mysql_cond mysql_cond_t; #define mysql_mutex_setflags(M, F) \ safe_mutex_setflags(&(M)->m_mutex, (F)) -/** Wrappers for instrumented prlock objects. */ - +/** + @def mysql_prlock_assert_write_owner(M) + Drop-in replacement + for @c rw_pr_lock_assert_write_owner. +*/ #define mysql_prlock_assert_write_owner(M) \ rw_pr_lock_assert_write_owner(&(M)->m_prlock) +/** + @def mysql_prlock_assert_not_write_owner(M) + Drop-in replacement + for @c rw_pr_lock_assert_not_write_owner. +*/ #define mysql_prlock_assert_not_write_owner(M) \ rw_pr_lock_assert_not_write_owner(&(M)->m_prlock) @@ -538,7 +567,7 @@ typedef struct st_mysql_cond mysql_cond_t; Instrumented cond_wait. @c mysql_cond_wait is a drop-in replacement for @c pthread_cond_wait. */ -#ifdef HAVE_PSI_COND_INTERFACE +#if defined(SAFE_MUTEX) || defined(HAVE_PSI_COND_INTERFACE) #define mysql_cond_wait(C, M) \ inline_mysql_cond_wait(C, M, __FILE__, __LINE__) #else @@ -552,7 +581,7 @@ typedef struct st_mysql_cond mysql_cond_t; @c mysql_cond_timedwait is a drop-in replacement for @c pthread_cond_timedwait. */ -#ifdef HAVE_PSI_COND_INTERFACE +#if defined(SAFE_MUTEX) || defined(HAVE_PSI_COND_INTERFACE) #define mysql_cond_timedwait(C, M, W) \ inline_mysql_cond_timedwait(C, M, W, __FILE__, __LINE__) #else @@ -618,6 +647,17 @@ typedef struct st_mysql_cond mysql_cond_t; #define mysql_thread_set_psi_id(I) do {} while (0) #endif +/** + @def mysql_thread_set_psi_THD(T) + Set the thread sql session for the instrumentation. + @param I The thread identifier +*/ +#ifdef HAVE_PSI_THREAD_INTERFACE + #define mysql_thread_set_psi_THD(T) inline_mysql_thread_set_psi_THD(T) +#else + #define mysql_thread_set_psi_THD(T) do {} while (0) +#endif + static inline void inline_mysql_mutex_register( #ifdef HAVE_PSI_MUTEX_INTERFACE const char *category, @@ -1154,7 +1194,7 @@ static inline int inline_mysql_cond_destroy( static inline int inline_mysql_cond_wait( mysql_cond_t *that, mysql_mutex_t *mutex -#ifdef HAVE_PSI_COND_INTERFACE +#if defined(SAFE_MUTEX) || defined(HAVE_PSI_COND_INTERFACE) , const char *src_file, uint src_line #endif ) @@ -1191,7 +1231,7 @@ static inline int inline_mysql_cond_timedwait( mysql_cond_t *that, mysql_mutex_t *mutex, const struct timespec *abstime -#ifdef HAVE_PSI_COND_INTERFACE +#if defined(SAFE_MUTEX) || defined(HAVE_PSI_COND_INTERFACE) , const char *src_file, uint src_line #endif ) @@ -1281,6 +1321,16 @@ static inline void inline_mysql_thread_set_psi_id(my_thread_id id) struct PSI_thread *psi= PSI_THREAD_CALL(get_thread)(); PSI_THREAD_CALL(set_thread_id)(psi, id); } + +#ifdef __cplusplus +class THD; +static inline void inline_mysql_thread_set_psi_THD(THD *thd) +{ + struct PSI_thread *psi= PSI_THREAD_CALL(get_thread)(); + PSI_THREAD_CALL(set_thread_THD)(psi, thd); +} +#endif /* __cplusplus */ + #endif #endif /* DISABLE_MYSQL_THREAD_H */ diff --git a/include/mysql/psi/mysql_transaction.h b/include/mysql/psi/mysql_transaction.h new file mode 100644 index 00000000000..41629395ee0 --- /dev/null +++ b/include/mysql/psi/mysql_transaction.h @@ -0,0 +1,220 @@ +/* Copyright (c) 2013, 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, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. + + 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, version 2.0, 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 */ + +#ifndef MYSQL_TRANSACTION_H +#define MYSQL_TRANSACTION_H + +/** + @file mysql/psi/mysql_transaction.h + Instrumentation helpers for transactions. +*/ + +#include "mysql/psi/psi.h" + +#ifndef PSI_TRANSACTION_CALL +#define PSI_TRANSACTION_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + +/** + @defgroup Transaction_instrumentation Transaction Instrumentation + @ingroup Instrumentation_interface + @{ +*/ + +#ifdef HAVE_PSI_TRANSACTION_INTERFACE + #define MYSQL_START_TRANSACTION(STATE, XID, TRXID, ISO, RO, AC) \ + inline_mysql_start_transaction(STATE, XID, TRXID, ISO, RO, AC, __FILE__, __LINE__) +#else + #define MYSQL_START_TRANSACTION(STATE, XID, TRXID, ISO, RO, AC) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_TRANSACTION_INTERFACE + #define MYSQL_SET_TRANSACTION_GTID(LOCKER, P1, P2) \ + inline_mysql_set_transaction_gtid(LOCKER, P1, P2) +#else + #define MYSQL_SET_TRANSACTION_GTID(LOCKER, P1, P2) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_TRANSACTION_INTERFACE + #define MYSQL_SET_TRANSACTION_XID(LOCKER, P1, P2) \ + inline_mysql_set_transaction_xid(LOCKER, P1, P2) +#else + #define MYSQL_SET_TRANSACTION_XID(LOCKER, P1, P2) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_TRANSACTION_INTERFACE + #define MYSQL_SET_TRANSACTION_XA_STATE(LOCKER, P1) \ + inline_mysql_set_transaction_xa_state(LOCKER, P1) +#else + #define MYSQL_SET_TRANSACTION_XA_STATE(LOCKER, P1) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_TRANSACTION_INTERFACE + #define MYSQL_SET_TRANSACTION_TRXID(LOCKER, P1) \ + inline_mysql_set_transaction_trxid(LOCKER, P1) +#else + #define MYSQL_SET_TRANSACTION_TRXID(LOCKER, P1) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_TRANSACTION_INTERFACE + #define MYSQL_INC_TRANSACTION_SAVEPOINTS(LOCKER, P1) \ + inline_mysql_inc_transaction_savepoints(LOCKER, P1) +#else + #define MYSQL_INC_TRANSACTION_SAVEPOINTS(LOCKER, P1) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_TRANSACTION_INTERFACE + #define MYSQL_INC_TRANSACTION_ROLLBACK_TO_SAVEPOINT(LOCKER, P1) \ + inline_mysql_inc_transaction_rollback_to_savepoint(LOCKER, P1) +#else + #define MYSQL_INC_TRANSACTION_ROLLBACK_TO_SAVEPOINT(LOCKER, P1) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_TRANSACTION_INTERFACE + #define MYSQL_INC_TRANSACTION_RELEASE_SAVEPOINT(LOCKER, P1) \ + inline_mysql_inc_transaction_release_savepoint(LOCKER, P1) +#else + #define MYSQL_INC_TRANSACTION_RELEASE_SAVEPOINT(LOCKER, P1) \ + do {} while (0) +#endif + +#ifdef HAVE_PSI_TRANSACTION_INTERFACE + #define MYSQL_ROLLBACK_TRANSACTION(LOCKER) \ + inline_mysql_rollback_transaction(LOCKER) +#else + #define MYSQL_ROLLBACK_TRANSACTION(LOCKER) \ + NULL +#endif + +#ifdef HAVE_PSI_TRANSACTION_INTERFACE + #define MYSQL_COMMIT_TRANSACTION(LOCKER) \ + inline_mysql_commit_transaction(LOCKER) +#else + #define MYSQL_COMMIT_TRANSACTION(LOCKER) \ + NULL +#endif + +#ifdef HAVE_PSI_TRANSACTION_INTERFACE +static inline struct PSI_transaction_locker * +inline_mysql_start_transaction(PSI_transaction_locker_state *state, + const void *xid, + const ulonglong *trxid, + int isolation_level, + my_bool read_only, + my_bool autocommit, + const char *src_file, int src_line) +{ + PSI_transaction_locker *locker; + locker= PSI_TRANSACTION_CALL(get_thread_transaction_locker)(state, + xid, trxid, + isolation_level, + read_only, + autocommit); + if (likely(locker != NULL)) + PSI_TRANSACTION_CALL(start_transaction)(locker, src_file, src_line); + return locker; +} + +static inline void +inline_mysql_set_transaction_gtid(PSI_transaction_locker *locker, + const void *sid, + const void *gtid_spec) +{ + if (likely(locker != NULL)) + PSI_TRANSACTION_CALL(set_transaction_gtid)(locker, sid, gtid_spec); +} + +static inline void +inline_mysql_set_transaction_xid(PSI_transaction_locker *locker, + const void *xid, + int xa_state) +{ + if (likely(locker != NULL)) + PSI_TRANSACTION_CALL(set_transaction_xid)(locker, xid, xa_state); +} + +static inline void +inline_mysql_set_transaction_xa_state(PSI_transaction_locker *locker, + int xa_state) +{ + if (likely(locker != NULL)) + PSI_TRANSACTION_CALL(set_transaction_xa_state)(locker, xa_state); +} + +static inline void +inline_mysql_set_transaction_trxid(PSI_transaction_locker *locker, + const ulonglong *trxid) +{ + if (likely(locker != NULL)) + PSI_TRANSACTION_CALL(set_transaction_trxid)(locker, trxid); +} + +static inline void +inline_mysql_inc_transaction_savepoints(PSI_transaction_locker *locker, + ulong count) +{ + if (likely(locker != NULL)) + PSI_TRANSACTION_CALL(inc_transaction_savepoints)(locker, count); +} + +static inline void +inline_mysql_inc_transaction_rollback_to_savepoint(PSI_transaction_locker *locker, + ulong count) +{ + if (likely(locker != NULL)) + PSI_TRANSACTION_CALL(inc_transaction_rollback_to_savepoint)(locker, count); +} + +static inline void +inline_mysql_inc_transaction_release_savepoint(PSI_transaction_locker *locker, + ulong count) +{ + if (likely(locker != NULL)) + PSI_TRANSACTION_CALL(inc_transaction_release_savepoint)(locker, count); +} + +static inline void +inline_mysql_rollback_transaction(struct PSI_transaction_locker *locker) +{ + if (likely(locker != NULL)) + PSI_TRANSACTION_CALL(end_transaction)(locker, false); +} + +static inline void +inline_mysql_commit_transaction(struct PSI_transaction_locker *locker) +{ + if (likely(locker != NULL)) + PSI_TRANSACTION_CALL(end_transaction)(locker, true); +} +#endif + +/** @} (end of group Transaction_instrumentation) */ + +#endif + diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h index 238471c7af1..9400bebe5b0 100644 --- a/include/mysql/psi/psi.h +++ b/include/mysql/psi/psi.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -24,16 +24,7 @@ #define MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H #ifdef EMBEDDED_LIBRARY -#define DISABLE_PSI_MUTEX -#define DISABLE_PSI_RWLOCK -#define DISABLE_PSI_COND -#define DISABLE_PSI_FILE -#define DISABLE_PSI_TABLE -#define DISABLE_PSI_SOCKET -#define DISABLE_PSI_STAGE -#define DISABLE_PSI_STATEMENT -#define DISABLE_PSI_IDLE -#define DISABLE_PSI_STATEMENT_DIGEST +#define DISABLE_ALL_PSI #endif /* EMBEDDED_LIBRARY */ #ifndef MY_GLOBAL_INCLUDED @@ -61,13 +52,52 @@ #define psi_unlikely(A) likely(A) #endif +#include "psi_base.h" +#include "psi_memory.h" + +/* + MAINTAINER: + The following pattern: + typedef struct XYZ XYZ; + is not needed in C++, but required for C. +*/ C_MODE_START +/** @sa MDL_key. */ +struct MDL_key; +typedef struct MDL_key MDL_key; + +/** @sa enum_mdl_type. */ +typedef int opaque_mdl_type; + +/** @sa enum_mdl_duration. */ +typedef int opaque_mdl_duration; + +/** @sa MDL_wait::enum_wait_status. */ +typedef int opaque_mdl_status; + +/** @sa enum_vio_type. */ +typedef int opaque_vio_type; + struct TABLE_SHARE; struct sql_digest_storage; +#ifdef __cplusplus + class THD; +#else + /* + Phony declaration when compiling C code. + This is ok, because the C code will never have a THD anyway. + */ + struct opaque_THD + { + int dummy; + }; + typedef struct opaque_THD THD; +#endif + /** @file mysql/psi/psi.h Performance schema instrumentation interface. @@ -133,6 +163,13 @@ typedef struct PSI_file PSI_file; struct PSI_socket; typedef struct PSI_socket PSI_socket; +/** + Interface for an instrumented prepared statement. + This is an opaque structure. +*/ +struct PSI_prepared_stmt; +typedef struct PSI_prepared_stmt PSI_prepared_stmt; + /** Interface for an instrumented table operation. This is an opaque structure. @@ -147,6 +184,13 @@ typedef struct PSI_table_locker PSI_table_locker; struct PSI_statement_locker; typedef struct PSI_statement_locker PSI_statement_locker; +/** + Interface for an instrumented transaction. + This is an opaque structure. +*/ +struct PSI_transaction_locker; +typedef struct PSI_transaction_locker PSI_transaction_locker; + /** Interface for an instrumented idle operation. This is an opaque structure. @@ -161,6 +205,90 @@ typedef struct PSI_idle_locker PSI_idle_locker; struct PSI_digest_locker; typedef struct PSI_digest_locker PSI_digest_locker; +/** + Interface for an instrumented stored procedure share. + This is an opaque structure. +*/ +struct PSI_sp_share; +typedef struct PSI_sp_share PSI_sp_share; + +/** + Interface for an instrumented stored program. + This is an opaque structure. +*/ +struct PSI_sp_locker; +typedef struct PSI_sp_locker PSI_sp_locker; + +/** + Interface for an instrumented metadata lock. + This is an opaque structure. +*/ +struct PSI_metadata_lock; +typedef struct PSI_metadata_lock PSI_metadata_lock; + +/** + Interface for an instrumented stage progress. + This is a public structure, for efficiency. +*/ +struct PSI_stage_progress +{ + ulonglong m_work_completed; + ulonglong m_work_estimated; +}; +typedef struct PSI_stage_progress PSI_stage_progress; + +/** IO operation performed on an instrumented table. */ +enum PSI_table_io_operation +{ + /** Row fetch. */ + PSI_TABLE_FETCH_ROW= 0, + /** Row write. */ + PSI_TABLE_WRITE_ROW= 1, + /** Row update. */ + PSI_TABLE_UPDATE_ROW= 2, + /** Row delete. */ + PSI_TABLE_DELETE_ROW= 3 +}; +typedef enum PSI_table_io_operation PSI_table_io_operation; + +/** + State data storage for @c start_table_io_wait_v1_t, + @c start_table_lock_wait_v1_t. + This structure provide temporary storage to a table locker. + The content of this structure is considered opaque, + the fields are only hints of what an implementation + of the psi interface can use. + This memory is provided by the instrumented code for performance reasons. + @sa start_table_io_wait_v1_t + @sa start_table_lock_wait_v1_t +*/ +struct PSI_table_locker_state +{ + /** Internal state. */ + uint m_flags; + /** Current io operation. */ + enum PSI_table_io_operation m_io_operation; + /** Current table handle. */ + struct PSI_table *m_table; + /** Current table share. */ + struct PSI_table_share *m_table_share; + /** Current thread. */ + struct PSI_thread *m_thread; + /** Timer start. */ + ulonglong m_timer_start; + /** Timer function. */ + ulonglong (*m_timer)(void); + /** Internal data. */ + void *m_wait; + /** + Implementation specific. + For table io, the table io index. + For table lock, the lock type. + */ + uint m_index; +}; +typedef struct PSI_table_locker_state PSI_table_locker_state; + /** Entry point for the performance schema interface. */ struct PSI_bootstrap { @@ -183,14 +311,84 @@ typedef struct PSI_bootstrap PSI_bootstrap; #ifdef HAVE_PSI_INTERFACE +#ifdef DISABLE_ALL_PSI + +#ifndef DISABLE_PSI_THREAD +#define DISABLE_PSI_THREAD +#endif + +#ifndef DISABLE_PSI_MUTEX +#define DISABLE_PSI_MUTEX +#endif + +#ifndef DISABLE_PSI_RWLOCK +#define DISABLE_PSI_RWLOCK +#endif + +#ifndef DISABLE_PSI_COND +#define DISABLE_PSI_COND +#endif + +#ifndef DISABLE_PSI_FILE +#define DISABLE_PSI_FILE +#endif + +#ifndef DISABLE_PSI_TABLE +#define DISABLE_PSI_TABLE +#endif + +#ifndef DISABLE_PSI_SOCKET +#define DISABLE_PSI_SOCKET +#endif + +#ifndef DISABLE_PSI_STAGE +#define DISABLE_PSI_STAGE +#endif + +#ifndef DISABLE_PSI_STATEMENT +#define DISABLE_PSI_STATEMENT +#endif + +#ifndef DISABLE_PSI_SP +#define DISABLE_PSI_SP +#endif + +#ifndef DISABLE_PSI_IDLE +#define DISABLE_PSI_IDLE +#endif + +#ifndef DISABLE_PSI_STATEMENT_DIGEST +#define DISABLE_PSI_STATEMENT_DIGEST +#endif + +#ifndef DISABLE_PSI_METADATA +#define DISABLE_PSI_METADATA +#endif + +#ifndef DISABLE_PSI_MEMORY +#define DISABLE_PSI_MEMORY +#endif + +#ifndef DISABLE_PSI_TRANSACTION +#define DISABLE_PSI_TRANSACTION +#endif + +#ifndef DISABLE_PSI_SP +#define DISABLE_PSI_SP +#endif + +#ifndef DISABLE_PSI_PS +#define DISABLE_PSI_PS +#endif + +#endif + /** @def DISABLE_PSI_MUTEX Compiling option to disable the mutex instrumentation. This option is mostly intended to be used during development, when doing special builds with only a subset of the performance schema instrumentation, for code analysis / profiling / performance tuning of a specific instrumentation alone. - For this reason, DISABLE_PSI_MUTEX is not advertised in the cmake general options. - To disable mutexes, add -DDISABLE_PSI_MUTEX to CFLAGS. @sa DISABLE_PSI_RWLOCK @sa DISABLE_PSI_COND @sa DISABLE_PSI_FILE @@ -198,8 +396,13 @@ typedef struct PSI_bootstrap PSI_bootstrap; @sa DISABLE_PSI_TABLE @sa DISABLE_PSI_STAGE @sa DISABLE_PSI_STATEMENT + @sa DISABLE_PSI_SP + @sa DISABLE_PSI_STATEMENT_DIGEST @sa DISABLE_PSI_SOCKET + @sa DISABLE_PSI_MEMORY @sa DISABLE_PSI_IDLE + @sa DISABLE_PSI_METADATA + @sa DISABLE PSI_TRANSACTION */ #ifndef DISABLE_PSI_MUTEX @@ -275,6 +478,26 @@ typedef struct PSI_bootstrap PSI_bootstrap; #define HAVE_PSI_STATEMENT_INTERFACE #endif +/** + @def DISABLE_PSI_SP + Compiling option to disable the stored program instrumentation. + @sa DISABLE_PSI_MUTEX +*/ +#ifndef DISABLE_PSI_SP +#define HAVE_PSI_SP_INTERFACE +#endif + +/** + @def DISABLE_PSI_PS + Compiling option to disable the prepared statement instrumentation. + @sa DISABLE_PSI_MUTEX +*/ +#ifndef DISABLE_PSI_STATEMENT +#ifndef DISABLE_PSI_PS +#define HAVE_PSI_PS_INTERFACE +#endif +#endif + /** @def DISABLE_PSI_STATEMENT_DIGEST Compiling option to disable the statement digest instrumentation. @@ -286,6 +509,16 @@ typedef struct PSI_bootstrap PSI_bootstrap; #endif #endif +/** + @def DISABLE_PSI_TRANSACTION + Compiling option to disable the transaction instrumentation. + @sa DISABLE_PSI_MUTEX +*/ + +#ifndef DISABLE_PSI_TRANSACTION +#define HAVE_PSI_TRANSACTION_INTERFACE +#endif + /** @def DISABLE_PSI_SOCKET Compiling option to disable the statement instrumentation. @@ -296,6 +529,16 @@ typedef struct PSI_bootstrap PSI_bootstrap; #define HAVE_PSI_SOCKET_INTERFACE #endif +/** + @def DISABLE_PSI_MEMORY + Compiling option to disable the memory instrumentation. + @sa DISABLE_PSI_MUTEX +*/ + +#ifndef DISABLE_PSI_MEMORY +#define HAVE_PSI_MEMORY_INTERFACE +#endif + /** @def DISABLE_PSI_IDLE Compiling option to disable the idle instrumentation. @@ -306,6 +549,16 @@ typedef struct PSI_bootstrap PSI_bootstrap; #define HAVE_PSI_IDLE_INTERFACE #endif +/** + @def DISABLE_PSI_METADATA + Compiling option to disable the metadata instrumentation. + @sa DISABLE_PSI_MUTEX +*/ + +#ifndef DISABLE_PSI_METADATA +#define HAVE_PSI_METADATA_INTERFACE +#endif + /** @def PSI_VERSION_1 Performance Schema Interface number for version 1. @@ -368,6 +621,13 @@ typedef struct PSI_file_locker PSI_file_locker; struct PSI_socket_locker; typedef struct PSI_socket_locker PSI_socket_locker; +/** + Interface for an instrumented MDL operation. + This is an opaque structure. +*/ +struct PSI_metadata_locker; +typedef struct PSI_metadata_locker PSI_metadata_locker; + /** Operation performed on an instrumented mutex. */ enum PSI_mutex_operation { @@ -378,7 +638,12 @@ enum PSI_mutex_operation }; typedef enum PSI_mutex_operation PSI_mutex_operation; -/** Operation performed on an instrumented rwlock. */ +/** + Operation performed on an instrumented rwlock. + For basic READ / WRITE lock, + operations are "READ" or "WRITE". + For SX-locks, operations are "SHARED", "SHARED-EXCLUSIVE" or "EXCLUSIVE". +*/ enum PSI_rwlock_operation { /** Read lock. */ @@ -388,7 +653,21 @@ enum PSI_rwlock_operation /** Read lock attempt. */ PSI_RWLOCK_TRYREADLOCK= 2, /** Write lock attempt. */ - PSI_RWLOCK_TRYWRITELOCK= 3 + PSI_RWLOCK_TRYWRITELOCK= 3, + + /** Shared lock. */ + PSI_RWLOCK_SHAREDLOCK= 4, + /** Shared Exclusive lock. */ + PSI_RWLOCK_SHAREDEXCLUSIVELOCK= 5, + /** Exclusive lock. */ + PSI_RWLOCK_EXCLUSIVELOCK= 6, + /** Shared lock attempt. */ + PSI_RWLOCK_TRYSHAREDLOCK= 7, + /** Shared Exclusive lock attempt. */ + PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK= 8, + /** Exclusive lock attempt. */ + PSI_RWLOCK_TRYEXCLUSIVELOCK= 9 + }; typedef enum PSI_rwlock_operation PSI_rwlock_operation; @@ -448,20 +727,6 @@ enum PSI_file_operation }; typedef enum PSI_file_operation PSI_file_operation; -/** IO operation performed on an instrumented table. */ -enum PSI_table_io_operation -{ - /** Row fetch. */ - PSI_TABLE_FETCH_ROW= 0, - /** Row write. */ - PSI_TABLE_WRITE_ROW= 1, - /** Row update. */ - PSI_TABLE_UPDATE_ROW= 2, - /** Row delete. */ - PSI_TABLE_DELETE_ROW= 3 -}; -typedef enum PSI_table_io_operation PSI_table_io_operation; - /** Lock operation performed on an instrumented table. */ enum PSI_table_lock_operation { @@ -554,7 +819,10 @@ typedef unsigned int PSI_thread_key; To instrument a file, a file key must be obtained using @c register_file. Using a zero key always disable the instrumentation. */ +#ifndef PSI_FILE_KEY_DEFINED typedef unsigned int PSI_file_key; +#define PSI_FILE_KEY_DEFINED +#endif /** Instrumented stage key. @@ -577,44 +845,6 @@ typedef unsigned int PSI_statement_key; */ typedef unsigned int PSI_socket_key; -/** - @def USE_PSI_1 - Define USE_PSI_1 to use the interface version 1. -*/ - -/** - @def USE_PSI_2 - Define USE_PSI_2 to use the interface version 2. -*/ - -/** - @def HAVE_PSI_1 - Define HAVE_PSI_1 if the interface version 1 needs to be compiled in. -*/ - -/** - @def HAVE_PSI_2 - Define HAVE_PSI_2 if the interface version 2 needs to be compiled in. -*/ - -/** - Global flag. - This flag indicate that an instrumentation point is a global variable, - or a singleton. -*/ -#define PSI_FLAG_GLOBAL (1 << 0) - -/** - Global flag. - This flag indicate that an instrumentation point is a general placeholder, - that can mutate into a more specific instrumentation point. -*/ -#define PSI_FLAG_MUTABLE (1 << 1) - -#ifdef USE_PSI_1 -#define HAVE_PSI_1 -#endif - #ifdef HAVE_PSI_1 /** @@ -644,6 +874,7 @@ struct PSI_mutex_info_v1 */ int m_flags; }; +typedef struct PSI_mutex_info_v1 PSI_mutex_info_v1; /** Rwlock information. @@ -666,6 +897,7 @@ struct PSI_rwlock_info_v1 */ int m_flags; }; +typedef struct PSI_rwlock_info_v1 PSI_rwlock_info_v1; /** Condition information. @@ -688,6 +920,7 @@ struct PSI_cond_info_v1 */ int m_flags; }; +typedef struct PSI_cond_info_v1 PSI_cond_info_v1; /** Thread instrument information. @@ -710,6 +943,7 @@ struct PSI_thread_info_v1 */ int m_flags; }; +typedef struct PSI_thread_info_v1 PSI_thread_info_v1; /** File instrument information. @@ -732,6 +966,7 @@ struct PSI_file_info_v1 */ int m_flags; }; +typedef struct PSI_file_info_v1 PSI_file_info_v1; /** Stage instrument information. @@ -747,6 +982,7 @@ struct PSI_stage_info_v1 /** The flags of the stage instrument to register. */ int m_flags; }; +typedef struct PSI_stage_info_v1 PSI_stage_info_v1; /** Statement instrument information. @@ -762,6 +998,7 @@ struct PSI_statement_info_v1 /** The flags of the statement instrument to register. */ int m_flags; }; +typedef struct PSI_statement_info_v1 PSI_statement_info_v1; /** Socket instrument information. @@ -784,6 +1021,7 @@ struct PSI_socket_info_v1 */ int m_flags; }; +typedef struct PSI_socket_info_v1 PSI_socket_info_v1; /** State data storage for @c start_idle_wait_v1_t. @@ -807,6 +1045,7 @@ struct PSI_idle_locker_state_v1 /** Internal data. */ void *m_wait; }; +typedef struct PSI_idle_locker_state_v1 PSI_idle_locker_state_v1; /** State data storage for @c start_mutex_wait_v1_t. @@ -834,6 +1073,7 @@ struct PSI_mutex_locker_state_v1 /** Internal data. */ void *m_wait; }; +typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state_v1; /** State data storage for @c start_rwlock_rdwait_v1_t, @c start_rwlock_wrwait_v1_t. @@ -862,6 +1102,7 @@ struct PSI_rwlock_locker_state_v1 /** Internal data. */ void *m_wait; }; +typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state_v1; /** State data storage for @c start_cond_wait_v1_t. @@ -891,6 +1132,7 @@ struct PSI_cond_locker_state_v1 /** Internal data. */ void *m_wait; }; +typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state_v1; /** State data storage for @c get_thread_file_name_locker_v1_t. @@ -926,28 +1168,23 @@ struct PSI_file_locker_state_v1 /** Internal data. */ void *m_wait; }; +typedef struct PSI_file_locker_state_v1 PSI_file_locker_state_v1; /** - State data storage for @c start_table_io_wait_v1_t, - @c start_table_lock_wait_v1_t. - This structure provide temporary storage to a table locker. + State data storage for @c start_metadata_wait_v1_t. + This structure provide temporary storage to a metadata locker. The content of this structure is considered opaque, the fields are only hints of what an implementation of the psi interface can use. This memory is provided by the instrumented code for performance reasons. - @sa start_table_io_wait_v1_t - @sa start_table_lock_wait_v1_t + @sa start_metadata_wait_v1_t */ -struct PSI_table_locker_state_v1 +struct PSI_metadata_locker_state_v1 { /** Internal state. */ uint m_flags; - /** Current io operation. */ - enum PSI_table_io_operation m_io_operation; - /** Current table handle. */ - struct PSI_table *m_table; - /** Current table share. */ - struct PSI_table_share *m_table_share; + /** Current metadata lock. */ + struct PSI_metadata_lock *m_metadata_lock; /** Current thread. */ struct PSI_thread *m_thread; /** Timer start. */ @@ -956,13 +1193,8 @@ struct PSI_table_locker_state_v1 ulonglong (*m_timer)(void); /** Internal data. */ void *m_wait; - /** - Implementation specific. - For table io, the table io index. - For table lock, the lock type. - */ - uint m_index; }; +typedef struct PSI_metadata_locker_state_v1 PSI_metadata_locker_state_v1; /* Duplicate of NAME_LEN, to avoid dependency on mysql_com.h */ #define PSI_SCHEMA_NAME_LEN (64 * 3) @@ -981,6 +1213,8 @@ struct PSI_statement_locker_state_v1 { /** Discarded flag. */ my_bool m_discarded; + /** In prepare flag. */ + my_bool m_in_prepare; /** Metric, no index used flag. */ uchar m_no_index_used; /** Metric, no good index used flag. */ @@ -1033,7 +1267,50 @@ struct PSI_statement_locker_state_v1 uint m_schema_name_length; /** Statement character set number. */ uint m_cs_number; + PSI_sp_share *m_parent_sp_share; + PSI_prepared_stmt *m_parent_prepared_stmt; }; +typedef struct PSI_statement_locker_state_v1 PSI_statement_locker_state_v1; + +/** + State data storage for @c get_thread_transaction_locker_v1_t, + @c get_thread_transaction_locker_v1_t. + This structure provide temporary storage to a transaction locker. + The content of this structure is considered opaque, + the fields are only hints of what an implementation + of the psi interface can use. + This memory is provided by the instrumented code for performance reasons. + @sa get_thread_transaction_locker_v1_t +*/ +struct PSI_transaction_locker_state_v1 +{ + /** Internal state. */ + uint m_flags; + /** Instrumentation class. */ + void *m_class; + /** Current thread. */ + struct PSI_thread *m_thread; + /** Timer start. */ + ulonglong m_timer_start; + /** Timer function. */ + ulonglong (*m_timer)(void); + /** Internal data. */ + void *m_transaction; + /** True if read-only transaction, false if read-write. */ + my_bool m_read_only; + /** True if transaction is autocommit. */ + my_bool m_autocommit; + /** Number of statements. */ + ulong m_statement_count; + /** Total number of savepoints. */ + ulong m_savepoint_count; + /** Number of rollback_to_savepoint. */ + ulong m_rollback_to_savepoint_count; + /** Number of release_savepoint. */ + ulong m_release_savepoint_count; +}; + +typedef struct PSI_transaction_locker_state_v1 PSI_transaction_locker_state_v1; /** State data storage for @c start_socket_wait_v1_t. @@ -1067,6 +1344,22 @@ struct PSI_socket_locker_state_v1 /** Internal data. */ void *m_wait; }; +typedef struct PSI_socket_locker_state_v1 PSI_socket_locker_state_v1; + +struct PSI_sp_locker_state_v1 +{ + /** Internal state. */ + uint m_flags; + /** Current thread. */ + struct PSI_thread *m_thread; + /** Timer start. */ + ulonglong m_timer_start; + /** Timer function. */ + ulonglong (*m_timer)(void); + /** Stored Procedure share. */ + PSI_sp_share* m_sp_share; +}; +typedef struct PSI_sp_locker_state_v1 PSI_sp_locker_state_v1; /* Using typedef to make reuse between PSI_v1 and PSI_v2 easier later. */ @@ -1263,7 +1556,8 @@ typedef PSI_table* (*rebind_table_v1_t) Note that the table handle is invalid after this call. @param table the table handle to close */ -typedef void (*close_table_v1_t)(struct PSI_table *table); +typedef void (*close_table_v1_t)(struct TABLE_SHARE *server_share, + struct PSI_table *table); /** Create a file instrumentation for a created file. @@ -1299,6 +1593,14 @@ typedef int (*spawn_thread_v1_t)(PSI_thread_key key, typedef struct PSI_thread* (*new_thread_v1_t) (PSI_thread_key key, const void *identity, ulonglong thread_id); +/** + Assign a THD to an instrumented thread. + @param thread the instrumented thread + @param THD the sql layer THD to assign +*/ +typedef void (*set_thread_THD_v1_t)(struct PSI_thread *thread, + THD *thd); + /** Assign an id to an instrumented thread. @param thread the instrumented thread @@ -1307,6 +1609,13 @@ typedef struct PSI_thread* (*new_thread_v1_t) typedef void (*set_thread_id_v1_t)(struct PSI_thread *thread, ulonglong id); +/** + Assign the current operating system thread id to an instrumented thread. + The operating system task id is obtained from @c gettid() + @param thread the instrumented thread +*/ +typedef void (*set_thread_os_id_v1_t)(struct PSI_thread *thread); + /** Get the instrumentation for the running thread. For this function to return a result, @@ -1330,8 +1639,8 @@ typedef void (*set_thread_user_v1_t)(const char *user, int user_len); @param host the host name @param host_len the host name length */ -typedef void (*set_thread_user_host_v1_t)(const char *user, int user_len, - const char *host, int host_len); +typedef void (*set_thread_account_v1_t)(const char *user, int user_len, + const char *host, int host_len); /** Assign a current database to the instrumented thread. @@ -1346,6 +1655,13 @@ typedef void (*set_thread_db_v1_t)(const char* db, int db_len); */ typedef void (*set_thread_command_v1_t)(int command); +/** + Assign a connection type to the instrumented thread. + @param conn_type the connection type +*/ +typedef void (*set_connection_type_v1_t)(opaque_vio_type conn_type); + + /** Assign a start time to the instrumented thread. @param start_time the thread start time @@ -1446,9 +1762,20 @@ typedef void (*signal_cond_v1_t) typedef void (*broadcast_cond_v1_t) (struct PSI_cond *cond); +/** + Record an idle instrumentation wait start event. + @param state data storage for the locker + @param file the source file name + @param line the source line number + @return an idle locker, or NULL +*/ typedef struct PSI_idle_locker* (*start_idle_wait_v1_t) (struct PSI_idle_locker_state_v1 *state, const char *src_file, uint src_line); +/** + Record an idle instrumentation wait end event. + @param locker a thread locker for the running thread +*/ typedef void (*end_idle_wait_v1_t) (struct PSI_idle_locker *locker); @@ -1540,7 +1867,7 @@ typedef void (*end_cond_wait_v1_t) @param line the source line number */ typedef struct PSI_table_locker* (*start_table_io_wait_v1_t) - (struct PSI_table_locker_state_v1 *state, + (struct PSI_table_locker_state *state, struct PSI_table *table, enum PSI_table_io_operation op, uint index, @@ -1549,8 +1876,11 @@ typedef struct PSI_table_locker* (*start_table_io_wait_v1_t) /** Record a table instrumentation io wait end event. @param locker a table locker for the running thread + @param numrows the number of rows involved in io */ -typedef void (*end_table_io_wait_v1_t)(struct PSI_table_locker *locker); +typedef void (*end_table_io_wait_v1_t) + (struct PSI_table_locker *locker, + ulonglong numrows); /** Record a table instrumentation lock wait start event. @@ -1559,7 +1889,7 @@ typedef void (*end_table_io_wait_v1_t)(struct PSI_table_locker *locker); @param line the source line number */ typedef struct PSI_table_locker* (*start_table_lock_wait_v1_t) - (struct PSI_table_locker_state_v1 *state, + (struct PSI_table_locker_state *state, struct PSI_table *table, enum PSI_table_lock_operation op, ulong flags, @@ -1571,6 +1901,8 @@ typedef struct PSI_table_locker* (*start_table_lock_wait_v1_t) */ typedef void (*end_table_lock_wait_v1_t)(struct PSI_table_locker *locker); +typedef void (*unlock_table_v1_t)(struct PSI_table *table); + /** Start a file instrumentation open operation. @param locker the file locker @@ -1598,6 +1930,15 @@ typedef struct PSI_file* (*end_file_open_wait_v1_t) typedef void (*end_file_open_wait_and_bind_to_descriptor_v1_t) (struct PSI_file_locker *locker, File file); +/** + End a file instrumentation open operation, for non stream temporary files. + @param locker the file locker. + @param file the file number assigned by open() or create() for this file. + @param filename the file name generated during temporary file creation. +*/ +typedef void (*end_temp_file_open_wait_and_bind_to_descriptor_v1_t) + (struct PSI_file_locker *locker, File file, const char *filename); + /** Record a file instrumentation start event. @param locker a file locker for the running thread @@ -1644,15 +1985,29 @@ typedef void (*start_file_close_wait_v1_t) typedef void (*end_file_close_wait_v1_t) (struct PSI_file_locker *locker, int rc); +/** + Rename a file instrumentation close operation. + @param locker the file locker. + @param old_name name of the file to be renamed. + @param new_name name of the file after rename. + @param rc the rename operation return code (0 for success). +*/ +typedef void (*end_file_rename_wait_v1_t) + (struct PSI_file_locker *locker, const char *old_name, + const char *new_name, int rc); + /** Start a new stage, and implicitly end the previous stage. @param key the key of the new stage @param src_file the source file name @param src_line the source line number + @return the new stage progress */ -typedef void (*start_stage_v1_t) +typedef PSI_stage_progress* (*start_stage_v1_t) (PSI_stage_key key, const char *src_file, int src_line); +typedef PSI_stage_progress* (*get_current_stage_progress_v1_t)(void); + /** End the current stage. */ typedef void (*end_stage_v1_t) (void); @@ -1665,7 +2020,7 @@ typedef void (*end_stage_v1_t) (void); */ typedef struct PSI_statement_locker* (*get_thread_statement_locker_v1_t) (struct PSI_statement_locker_state_v1 *state, - PSI_statement_key key, const void *charset); + PSI_statement_key key, const void *charset, PSI_sp_share *sp_share); /** Refine a statement locker to a more specific key. @@ -1838,6 +2193,102 @@ typedef void (*set_statement_no_good_index_used_t) typedef void (*end_statement_v1_t) (struct PSI_statement_locker *locker, void *stmt_da); +/** + Get a transaction instrumentation locker. + @param state data storage for the locker + @param xid the xid for this transaction + @param trxid the InnoDB transaction id + @param iso_level isolation level for this transaction + @param read_only true if transaction access mode is read-only + @param autocommit true if transaction is autocommit + @return a transaction locker, or NULL +*/ +typedef struct PSI_transaction_locker* (*get_thread_transaction_locker_v1_t) + (struct PSI_transaction_locker_state_v1 *state, const void *xid, + const ulonglong *trxid, int isolation_level, my_bool read_only, + my_bool autocommit); + +/** + Start a new transaction event. + @param locker the transaction locker for this event + @param src_file source file name + @param src_line source line number +*/ +typedef void (*start_transaction_v1_t) + (struct PSI_transaction_locker *locker, + const char *src_file, uint src_line); + +/** + Set the transaction xid. + @param locker the transaction locker for this event + @param xid the id of the XA transaction + #param xa_state is the state of the XA transaction +*/ +typedef void (*set_transaction_xid_v1_t) + (struct PSI_transaction_locker *locker, + const void *xid, int xa_state); + +/** + Set the state of the XA transaction. + @param locker the transaction locker for this event + @param xa_state the new state of the xa transaction +*/ +typedef void (*set_transaction_xa_state_v1_t) + (struct PSI_transaction_locker *locker, + int xa_state); + +/** + Set the transaction gtid. + @param locker the transaction locker for this event + @param sid the source id for the transaction, mapped from sidno + @param gtid_spec the gtid specifier for the transaction +*/ +typedef void (*set_transaction_gtid_v1_t) + (struct PSI_transaction_locker *locker, + const void *sid, const void *gtid_spec); + +/** + Set the transaction trx_id. + @param locker the transaction locker for this event + @param trxid the storage engine transaction ID +*/ +typedef void (*set_transaction_trxid_v1_t) + (struct PSI_transaction_locker *locker, + const ulonglong *trxid); + +/** + Increment a transaction event savepoint count. + @param locker the transaction locker + @param count the increment value +*/ +typedef void (*inc_transaction_savepoints_v1_t) + (struct PSI_transaction_locker *locker, ulong count); + +/** + Increment a transaction event rollback to savepoint count. + @param locker the transaction locker + @param count the increment value +*/ +typedef void (*inc_transaction_rollback_to_savepoint_v1_t) + (struct PSI_transaction_locker *locker, ulong count); + +/** + Increment a transaction event release savepoint count. + @param locker the transaction locker + @param count the increment value +*/ +typedef void (*inc_transaction_release_savepoint_v1_t) + (struct PSI_transaction_locker *locker, ulong count); + +/** + Commit or rollback the transaction. + @param locker the transaction locker for this event + @param commit true if transaction was committed, false if rolled back +*/ +typedef void (*end_transaction_v1_t) + (struct PSI_transaction_locker *locker, + my_bool commit); + /** Record a socket instrumentation start event. @param locker a socket locker for the running thread @@ -1893,6 +2344,46 @@ typedef void (*set_socket_info_v1_t)(struct PSI_socket *socket, */ typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket); +/** + Get a prepare statement. + @param locker a statement locker for the running thread. +*/ +typedef PSI_prepared_stmt* (*create_prepared_stmt_v1_t) + (void *identity, uint stmt_id, PSI_statement_locker *locker, + const char *stmt_name, size_t stmt_name_length, + const char *name, size_t length); + +/** + destroy a prepare statement. + @param prepared_stmt prepared statement. +*/ +typedef void (*destroy_prepared_stmt_v1_t) + (PSI_prepared_stmt *prepared_stmt); + +/** + repreare a prepare statement. + @param prepared_stmt prepared statement. +*/ +typedef void (*reprepare_prepared_stmt_v1_t) + (PSI_prepared_stmt *prepared_stmt); + +/** + Record a prepare statement instrumentation execute event. + @param locker a statement locker for the running thread. + @param prepared_stmt prepared statement. +*/ +typedef void (*execute_prepared_stmt_v1_t) + (PSI_statement_locker *locker, PSI_prepared_stmt* prepared_stmt); + +/** + Set the statement text for a prepared statment event. + @param prepared_stmt prepared statement. + @param text the prepared statement text + @param text_len the prepared statement text length +*/ +typedef void (*set_prepared_stmt_text_v1_t)(PSI_prepared_stmt *prepared_stmt, + const char *text, + uint text_len); /** Get a digest locker for the current statement. @param locker a statement locker for the running thread @@ -1900,17 +2391,74 @@ typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket); typedef struct PSI_digest_locker * (*digest_start_v1_t) (struct PSI_statement_locker *locker); +/** + Add a token to the current digest instrumentation. + @param locker a digest locker for the current statement + @param token the lexical token to add + @param yylval the lexical token attributes +*/ typedef void (*digest_end_v1_t) (struct PSI_digest_locker *locker, const struct sql_digest_storage *digest); +typedef PSI_sp_locker* (*start_sp_v1_t) + (struct PSI_sp_locker_state_v1 *state, struct PSI_sp_share* sp_share); + +typedef void (*end_sp_v1_t) + (struct PSI_sp_locker *locker); + +typedef void (*drop_sp_v1_t) + (uint object_type, + const char *schema_name, uint schema_name_length, + const char *object_name, uint object_name_length); + +/** + Acquire a sp share instrumentation. + @param type of stored program + @param schema name of stored program + @param name of stored program + @return a stored program share instrumentation, or NULL +*/ +typedef struct PSI_sp_share* (*get_sp_share_v1_t) + (uint object_type, + const char *schema_name, uint schema_name_length, + const char *object_name, uint object_name_length); + +/** + Release a stored program share. + @param info the stored program share to release +*/ +typedef void (*release_sp_share_v1_t)(struct PSI_sp_share *share); + +typedef PSI_metadata_lock* (*create_metadata_lock_v1_t) + (void *identity, + const MDL_key *key, + opaque_mdl_type mdl_type, + opaque_mdl_duration mdl_duration, + opaque_mdl_status mdl_status, + const char *src_file, + uint src_line); + +typedef void (*set_metadata_lock_status_v1_t)(PSI_metadata_lock *lock, + opaque_mdl_status mdl_status); + +typedef void (*destroy_metadata_lock_v1_t)(PSI_metadata_lock *lock); + +typedef struct PSI_metadata_locker* (*start_metadata_wait_v1_t) + (struct PSI_metadata_locker_state_v1 *state, + struct PSI_metadata_lock *mdl, + const char *src_file, uint src_line); + +typedef void (*end_metadata_wait_v1_t) + (struct PSI_metadata_locker *locker, int rc); + /** Stores an array of connection attributes @param buffer char array of length encoded connection attributes in network format - @param length legnth of the data in buffer - @param from_cs charset in which @buffer is encodded + @param length length of the data in buffer + @param from_cs charset in which @c buffer is encoded @return state - @retval non-0 attributes truncated + @retval non_0 attributes truncated @retval 0 stored the attribute */ typedef int (*set_thread_connect_attrs_v1_t)(const char *buffer, uint length, @@ -1954,6 +2502,7 @@ struct PSI_v1 init_socket_v1_t init_socket; /** @sa destroy_socket_v1_t. */ destroy_socket_v1_t destroy_socket; + /** @sa get_table_share_v1_t. */ get_table_share_v1_t get_table_share; /** @sa release_table_share_v1_t. */ @@ -1976,16 +2525,22 @@ struct PSI_v1 new_thread_v1_t new_thread; /** @sa set_thread_id_v1_t. */ set_thread_id_v1_t set_thread_id; + /** @sa set_thread_THD_v1_t. */ + set_thread_THD_v1_t set_thread_THD; + /** @sa set_thread_os_id_v1_t. */ + set_thread_os_id_v1_t set_thread_os_id; /** @sa get_thread_v1_t. */ get_thread_v1_t get_thread; /** @sa set_thread_user_v1_t. */ set_thread_user_v1_t set_thread_user; - /** @sa set_thread_user_host_v1_t. */ - set_thread_user_host_v1_t set_thread_user_host; + /** @sa set_thread_account_v1_t. */ + set_thread_account_v1_t set_thread_account; /** @sa set_thread_db_v1_t. */ set_thread_db_v1_t set_thread_db; /** @sa set_thread_command_v1_t. */ set_thread_command_v1_t set_thread_command; + /** @sa set_connection_type_v1_t. */ + set_connection_type_v1_t set_connection_type; /** @sa set_thread_start_time_v1_t. */ set_thread_start_time_v1_t set_thread_start_time; /** @sa set_thread_state_v1_t. */ @@ -2047,6 +2602,9 @@ struct PSI_v1 /** @sa end_file_open_wait_and_bind_to_descriptor_v1_t. */ end_file_open_wait_and_bind_to_descriptor_v1_t end_file_open_wait_and_bind_to_descriptor; + /** @sa end_temp_file_open_wait_and_bind_to_descriptor_v1_t. */ + end_temp_file_open_wait_and_bind_to_descriptor_v1_t + end_temp_file_open_wait_and_bind_to_descriptor; /** @sa start_file_wait_v1_t. */ start_file_wait_v1_t start_file_wait; /** @sa end_file_wait_v1_t. */ @@ -2055,8 +2613,12 @@ struct PSI_v1 start_file_close_wait_v1_t start_file_close_wait; /** @sa end_file_close_wait_v1_t. */ end_file_close_wait_v1_t end_file_close_wait; + /** @sa rename_file_close_wait_v1_t. */ + end_file_rename_wait_v1_t end_file_rename_wait; /** @sa start_stage_v1_t. */ start_stage_v1_t start_stage; + /** @sa get_current_stage_progress_v1_t. */ + get_current_stage_progress_v1_t get_current_stage_progress; /** @sa end_stage_v1_t. */ end_stage_v1_t end_stage; /** @sa get_thread_statement_locker_v1_t. */ @@ -2101,6 +2663,26 @@ struct PSI_v1 set_statement_no_good_index_used_t set_statement_no_good_index_used; /** @sa end_statement_v1_t. */ end_statement_v1_t end_statement; + /** @sa get_thread_transaction_locker_v1_t. */ + get_thread_transaction_locker_v1_t get_thread_transaction_locker; + /** @sa start_transaction_v1_t. */ + start_transaction_v1_t start_transaction; + /** @sa set_transaction_xid_v1_t. */ + set_transaction_xid_v1_t set_transaction_xid; + /** @sa set_transaction_xa_state_v1_t. */ + set_transaction_xa_state_v1_t set_transaction_xa_state; + /** @sa set_transaction_gtid_v1_t. */ + set_transaction_gtid_v1_t set_transaction_gtid; + /** @sa set_transaction_trxid_v1_t. */ + set_transaction_trxid_v1_t set_transaction_trxid; + /** @sa inc_transaction_savepoints_v1_t. */ + inc_transaction_savepoints_v1_t inc_transaction_savepoints; + /** @sa inc_transaction_rollback_to_savepoint_v1_t. */ + inc_transaction_rollback_to_savepoint_v1_t inc_transaction_rollback_to_savepoint; + /** @sa inc_transaction_release_savepoint_v1_t. */ + inc_transaction_release_savepoint_v1_t inc_transaction_release_savepoint; + /** @sa end_transaction_v1_t. */ + end_transaction_v1_t end_transaction; /** @sa start_socket_wait_v1_t. */ start_socket_wait_v1_t start_socket_wait; /** @sa end_socket_wait_v1_t. */ @@ -2111,12 +2693,51 @@ struct PSI_v1 set_socket_info_v1_t set_socket_info; /** @sa set_socket_thread_owner_v1_t. */ set_socket_thread_owner_v1_t set_socket_thread_owner; + /** @sa create_prepared_stmt_v1_t. */ + create_prepared_stmt_v1_t create_prepared_stmt; + /** @sa destroy_prepared_stmt_v1_t. */ + destroy_prepared_stmt_v1_t destroy_prepared_stmt; + /** @sa reprepare_prepared_stmt_v1_t. */ + reprepare_prepared_stmt_v1_t reprepare_prepared_stmt; + /** @sa execute_prepared_stmt_v1_t. */ + execute_prepared_stmt_v1_t execute_prepared_stmt; + /** @sa set_prepared_stmt_text_v1_t. */ + set_prepared_stmt_text_v1_t set_prepared_stmt_text; /** @sa digest_start_v1_t. */ digest_start_v1_t digest_start; /** @sa digest_end_v1_t. */ digest_end_v1_t digest_end; /** @sa set_thread_connect_attrs_v1_t. */ set_thread_connect_attrs_v1_t set_thread_connect_attrs; + /** @sa start_sp_v1_t. */ + start_sp_v1_t start_sp; + /** @sa start_sp_v1_t. */ + end_sp_v1_t end_sp; + /** @sa drop_sp_v1_t. */ + drop_sp_v1_t drop_sp; + /** @sa get_sp_share_v1_t. */ + get_sp_share_v1_t get_sp_share; + /** @sa release_sp_share_v1_t. */ + release_sp_share_v1_t release_sp_share; + /** @sa register_memory_v1_t. */ + register_memory_v1_t register_memory; + /** @sa memory_alloc_v1_t. */ + memory_alloc_v1_t memory_alloc; + /** @sa memory_realloc_v1_t. */ + memory_realloc_v1_t memory_realloc; + /** @sa memory_claim_v1_t. */ + memory_claim_v1_t memory_claim; + /** @sa memory_free_v1_t. */ + memory_free_v1_t memory_free; + + unlock_table_v1_t unlock_table; + + create_metadata_lock_v1_t create_metadata_lock; + set_metadata_lock_status_v1_t set_metadata_lock_status; + destroy_metadata_lock_v1_t destroy_metadata_lock; + + start_metadata_wait_v1_t start_metadata_wait; + end_metadata_wait_v1_t end_metadata_wait; }; /** @} (end of group Group_PSI_v1) */ @@ -2196,6 +2817,13 @@ struct PSI_statement_info_v2 int placeholder; }; +/** Placeholder */ +struct PSI_transaction_info_v2 +{ + /** Placeholder */ + int placeholder; +}; + /** Placeholder */ struct PSI_idle_locker_state_v2 { @@ -2232,14 +2860,14 @@ struct PSI_file_locker_state_v2 }; /** Placeholder */ -struct PSI_table_locker_state_v2 +struct PSI_statement_locker_state_v2 { /** Placeholder */ int placeholder; }; /** Placeholder */ -struct PSI_statement_locker_state_v2 +struct PSI_transaction_locker_state_v2 { /** Placeholder */ int placeholder; @@ -2252,6 +2880,11 @@ struct PSI_socket_locker_state_v2 int placeholder; }; +struct PSI_metadata_locker_state_v2 +{ + int placeholder; +}; + /** @} (end of group Group_PSI_v2) */ #endif /* HAVE_PSI_2 */ @@ -2297,15 +2930,18 @@ typedef struct PSI_thread_info_v1 PSI_thread_info; typedef struct PSI_file_info_v1 PSI_file_info; typedef struct PSI_stage_info_v1 PSI_stage_info; typedef struct PSI_statement_info_v1 PSI_statement_info; +typedef struct PSI_transaction_info_v1 PSI_transaction_info; typedef struct PSI_socket_info_v1 PSI_socket_info; typedef struct PSI_idle_locker_state_v1 PSI_idle_locker_state; typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state; typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state; typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state; typedef struct PSI_file_locker_state_v1 PSI_file_locker_state; -typedef struct PSI_table_locker_state_v1 PSI_table_locker_state; typedef struct PSI_statement_locker_state_v1 PSI_statement_locker_state; +typedef struct PSI_transaction_locker_state_v1 PSI_transaction_locker_state; typedef struct PSI_socket_locker_state_v1 PSI_socket_locker_state; +typedef struct PSI_sp_locker_state_v1 PSI_sp_locker_state; +typedef struct PSI_metadata_locker_state_v1 PSI_metadata_locker_state; #endif #ifdef USE_PSI_2 @@ -2317,15 +2953,18 @@ typedef struct PSI_thread_info_v2 PSI_thread_info; typedef struct PSI_file_info_v2 PSI_file_info; typedef struct PSI_stage_info_v2 PSI_stage_info; typedef struct PSI_statement_info_v2 PSI_statement_info; +typedef struct PSI_transaction_info_v2 PSI_transaction_info; typedef struct PSI_socket_info_v2 PSI_socket_info; typedef struct PSI_idle_locker_state_v2 PSI_idle_locker_state; typedef struct PSI_mutex_locker_state_v2 PSI_mutex_locker_state; typedef struct PSI_rwlock_locker_state_v2 PSI_rwlock_locker_state; typedef struct PSI_cond_locker_state_v2 PSI_cond_locker_state; typedef struct PSI_file_locker_state_v2 PSI_file_locker_state; -typedef struct PSI_table_locker_state_v2 PSI_table_locker_state; typedef struct PSI_statement_locker_state_v2 PSI_statement_locker_state; +typedef struct PSI_transaction_locker_state_v2 PSI_transaction_locker_state; typedef struct PSI_socket_locker_state_v2 PSI_socket_locker_state; +typedef struct PSI_sp_locker_state_v2 PSI_sp_locker_state; +typedef struct PSI_metadata_locker_state_v2 PSI_metadata_locker_state; #endif #else /* HAVE_PSI_INTERFACE */ @@ -2378,50 +3017,6 @@ extern MYSQL_PLUGIN_IMPORT PSI *PSI_server; make a dynamic call using the PSI_server function pointer. */ -#ifndef PSI_MUTEX_CALL -#define PSI_MUTEX_CALL(M) PSI_DYNAMIC_CALL(M) -#endif - -#ifndef PSI_RWLOCK_CALL -#define PSI_RWLOCK_CALL(M) PSI_DYNAMIC_CALL(M) -#endif - -#ifndef PSI_COND_CALL -#define PSI_COND_CALL(M) PSI_DYNAMIC_CALL(M) -#endif - -#ifndef PSI_THREAD_CALL -#define PSI_THREAD_CALL(M) PSI_DYNAMIC_CALL(M) -#endif - -#ifndef PSI_FILE_CALL -#define PSI_FILE_CALL(M) PSI_DYNAMIC_CALL(M) -#endif - -#ifndef PSI_SOCKET_CALL -#define PSI_SOCKET_CALL(M) PSI_DYNAMIC_CALL(M) -#endif - -#ifndef PSI_STAGE_CALL -#define PSI_STAGE_CALL(M) PSI_DYNAMIC_CALL(M) -#endif - -#ifndef PSI_STATEMENT_CALL -#define PSI_STATEMENT_CALL(M) PSI_DYNAMIC_CALL(M) -#endif - -#ifndef PSI_DIGEST_CALL -#define PSI_DIGEST_CALL(M) PSI_DYNAMIC_CALL(M) -#endif - -#ifndef PSI_TABLE_CALL -#define PSI_TABLE_CALL(M) PSI_DYNAMIC_CALL(M) -#endif - -#ifndef PSI_IDLE_CALL -#define PSI_IDLE_CALL(M) PSI_DYNAMIC_CALL(M) -#endif - #define PSI_DYNAMIC_CALL(M) PSI_server->M /** @} */ diff --git a/include/mysql/psi/psi_abi_v0.h b/include/mysql/psi/psi_abi_v0.h index ca4373f847b..5c879fb8536 100644 --- a/include/mysql/psi/psi_abi_v0.h +++ b/include/mysql/psi/psi_abi_v0.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2013, 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, version 2.0, diff --git a/include/mysql/psi/psi_abi_v0.h.pp b/include/mysql/psi/psi_abi_v0.h.pp index 17d61016a68..47dc72b7ecb 100644 --- a/include/mysql/psi/psi_abi_v0.h.pp +++ b/include/mysql/psi/psi_abi_v0.h.pp @@ -1,7 +1,23 @@ #include "mysql/psi/psi.h" +#include "psi_base.h" +#include "psi_memory.h" +#include "psi_base.h" +struct PSI_thread; +typedef unsigned int PSI_memory_key; C_MODE_START +struct MDL_key; +typedef struct MDL_key MDL_key; +typedef int opaque_mdl_type; +typedef int opaque_mdl_duration; +typedef int opaque_mdl_status; +typedef int opaque_vio_type; struct TABLE_SHARE; struct sql_digest_storage; + struct opaque_THD + { + int dummy; + }; + typedef struct opaque_THD THD; struct PSI_mutex; typedef struct PSI_mutex PSI_mutex; struct PSI_rwlock; @@ -18,14 +34,51 @@ struct PSI_file; typedef struct PSI_file PSI_file; struct PSI_socket; typedef struct PSI_socket PSI_socket; +struct PSI_prepared_stmt; +typedef struct PSI_prepared_stmt PSI_prepared_stmt; struct PSI_table_locker; typedef struct PSI_table_locker PSI_table_locker; struct PSI_statement_locker; typedef struct PSI_statement_locker PSI_statement_locker; +struct PSI_transaction_locker; +typedef struct PSI_transaction_locker PSI_transaction_locker; struct PSI_idle_locker; typedef struct PSI_idle_locker PSI_idle_locker; struct PSI_digest_locker; typedef struct PSI_digest_locker PSI_digest_locker; +struct PSI_sp_share; +typedef struct PSI_sp_share PSI_sp_share; +struct PSI_sp_locker; +typedef struct PSI_sp_locker PSI_sp_locker; +struct PSI_metadata_lock; +typedef struct PSI_metadata_lock PSI_metadata_lock; +struct PSI_stage_progress +{ + ulonglong m_work_completed; + ulonglong m_work_estimated; +}; +typedef struct PSI_stage_progress PSI_stage_progress; +enum PSI_table_io_operation +{ + PSI_TABLE_FETCH_ROW= 0, + PSI_TABLE_WRITE_ROW= 1, + PSI_TABLE_UPDATE_ROW= 2, + PSI_TABLE_DELETE_ROW= 3 +}; +typedef enum PSI_table_io_operation PSI_table_io_operation; +struct PSI_table_locker_state +{ + uint m_flags; + enum PSI_table_io_operation m_io_operation; + struct PSI_table *m_table; + struct PSI_table_share *m_table_share; + struct PSI_thread *m_thread; + ulonglong m_timer_start; + ulonglong (*m_timer)(void); + void *m_wait; + uint m_index; +}; +typedef struct PSI_table_locker_state PSI_table_locker_state; struct PSI_bootstrap { void* (*get_interface)(int version); diff --git a/include/mysql/psi/psi_abi_v1.h.pp b/include/mysql/psi/psi_abi_v1.h.pp index ef18f59e4a9..3d562b794f4 100644 --- a/include/mysql/psi/psi_abi_v1.h.pp +++ b/include/mysql/psi/psi_abi_v1.h.pp @@ -1,6 +1,37 @@ +extern "C" { +} +extern "C" { +struct PSI_thread; +typedef unsigned int PSI_memory_key; +struct PSI_memory_info_v1 +{ + PSI_memory_key *m_key; + const char *m_name; + int m_flags; +}; +typedef struct PSI_memory_info_v1 PSI_memory_info_v1; +typedef void (*register_memory_v1_t) + (const char *category, struct PSI_memory_info_v1 *info, int count); +typedef PSI_memory_key (*memory_alloc_v1_t) + (PSI_memory_key key, size_t size, struct PSI_thread ** owner); +typedef PSI_memory_key (*memory_realloc_v1_t) + (PSI_memory_key key, size_t old_size, size_t new_size, struct PSI_thread ** owner); +typedef PSI_memory_key (*memory_claim_v1_t) + (PSI_memory_key key, size_t size, struct PSI_thread ** owner); +typedef void (*memory_free_v1_t) + (PSI_memory_key key, size_t size, struct PSI_thread * owner); +typedef struct PSI_memory_info_v1 PSI_memory_info; +} C_MODE_START +struct MDL_key; +typedef struct MDL_key MDL_key; +typedef int opaque_mdl_type; +typedef int opaque_mdl_duration; +typedef int opaque_mdl_status; +typedef int opaque_vio_type; struct TABLE_SHARE; struct sql_digest_storage; + class THD; struct PSI_mutex; typedef struct PSI_mutex PSI_mutex; struct PSI_rwlock; @@ -17,14 +48,51 @@ struct PSI_file; typedef struct PSI_file PSI_file; struct PSI_socket; typedef struct PSI_socket PSI_socket; +struct PSI_prepared_stmt; +typedef struct PSI_prepared_stmt PSI_prepared_stmt; struct PSI_table_locker; typedef struct PSI_table_locker PSI_table_locker; struct PSI_statement_locker; typedef struct PSI_statement_locker PSI_statement_locker; +struct PSI_transaction_locker; +typedef struct PSI_transaction_locker PSI_transaction_locker; struct PSI_idle_locker; typedef struct PSI_idle_locker PSI_idle_locker; struct PSI_digest_locker; typedef struct PSI_digest_locker PSI_digest_locker; +struct PSI_sp_share; +typedef struct PSI_sp_share PSI_sp_share; +struct PSI_sp_locker; +typedef struct PSI_sp_locker PSI_sp_locker; +struct PSI_metadata_lock; +typedef struct PSI_metadata_lock PSI_metadata_lock; +struct PSI_stage_progress +{ + ulonglong m_work_completed; + ulonglong m_work_estimated; +}; +typedef struct PSI_stage_progress PSI_stage_progress; +enum PSI_table_io_operation +{ + PSI_TABLE_FETCH_ROW= 0, + PSI_TABLE_WRITE_ROW= 1, + PSI_TABLE_UPDATE_ROW= 2, + PSI_TABLE_DELETE_ROW= 3 +}; +typedef enum PSI_table_io_operation PSI_table_io_operation; +struct PSI_table_locker_state +{ + uint m_flags; + enum PSI_table_io_operation m_io_operation; + struct PSI_table *m_table; + struct PSI_table_share *m_table_share; + struct PSI_thread *m_thread; + ulonglong m_timer_start; + ulonglong (*m_timer)(void); + void *m_wait; + uint m_index; +}; +typedef struct PSI_table_locker_state PSI_table_locker_state; struct PSI_bootstrap { void* (*get_interface)(int version); @@ -40,6 +108,8 @@ struct PSI_file_locker; typedef struct PSI_file_locker PSI_file_locker; struct PSI_socket_locker; typedef struct PSI_socket_locker PSI_socket_locker; +struct PSI_metadata_locker; +typedef struct PSI_metadata_locker PSI_metadata_locker; enum PSI_mutex_operation { PSI_MUTEX_LOCK= 0, @@ -51,7 +121,13 @@ enum PSI_rwlock_operation PSI_RWLOCK_READLOCK= 0, PSI_RWLOCK_WRITELOCK= 1, PSI_RWLOCK_TRYREADLOCK= 2, - PSI_RWLOCK_TRYWRITELOCK= 3 + PSI_RWLOCK_TRYWRITELOCK= 3, + PSI_RWLOCK_SHAREDLOCK= 4, + PSI_RWLOCK_SHAREDEXCLUSIVELOCK= 5, + PSI_RWLOCK_EXCLUSIVELOCK= 6, + PSI_RWLOCK_TRYSHAREDLOCK= 7, + PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK= 8, + PSI_RWLOCK_TRYEXCLUSIVELOCK= 9 }; typedef enum PSI_rwlock_operation PSI_rwlock_operation; enum PSI_cond_operation @@ -81,14 +157,6 @@ enum PSI_file_operation PSI_FILE_SYNC= 16 }; typedef enum PSI_file_operation PSI_file_operation; -enum PSI_table_io_operation -{ - PSI_TABLE_FETCH_ROW= 0, - PSI_TABLE_WRITE_ROW= 1, - PSI_TABLE_UPDATE_ROW= 2, - PSI_TABLE_DELETE_ROW= 3 -}; -typedef enum PSI_table_io_operation PSI_table_io_operation; enum PSI_table_lock_operation { PSI_TABLE_LOCK= 0, @@ -134,48 +202,56 @@ struct PSI_mutex_info_v1 const char *m_name; int m_flags; }; +typedef struct PSI_mutex_info_v1 PSI_mutex_info_v1; struct PSI_rwlock_info_v1 { PSI_rwlock_key *m_key; const char *m_name; int m_flags; }; +typedef struct PSI_rwlock_info_v1 PSI_rwlock_info_v1; struct PSI_cond_info_v1 { PSI_cond_key *m_key; const char *m_name; int m_flags; }; +typedef struct PSI_cond_info_v1 PSI_cond_info_v1; struct PSI_thread_info_v1 { PSI_thread_key *m_key; const char *m_name; int m_flags; }; +typedef struct PSI_thread_info_v1 PSI_thread_info_v1; struct PSI_file_info_v1 { PSI_file_key *m_key; const char *m_name; int m_flags; }; +typedef struct PSI_file_info_v1 PSI_file_info_v1; struct PSI_stage_info_v1 { PSI_stage_key m_key; const char *m_name; int m_flags; }; +typedef struct PSI_stage_info_v1 PSI_stage_info_v1; struct PSI_statement_info_v1 { PSI_statement_key m_key; const char *m_name; int m_flags; }; +typedef struct PSI_statement_info_v1 PSI_statement_info_v1; struct PSI_socket_info_v1 { PSI_socket_key *m_key; const char *m_name; int m_flags; }; +typedef struct PSI_socket_info_v1 PSI_socket_info_v1; struct PSI_idle_locker_state_v1 { uint m_flags; @@ -184,6 +260,7 @@ struct PSI_idle_locker_state_v1 ulonglong (*m_timer)(void); void *m_wait; }; +typedef struct PSI_idle_locker_state_v1 PSI_idle_locker_state_v1; struct PSI_mutex_locker_state_v1 { uint m_flags; @@ -194,6 +271,7 @@ struct PSI_mutex_locker_state_v1 ulonglong (*m_timer)(void); void *m_wait; }; +typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state_v1; struct PSI_rwlock_locker_state_v1 { uint m_flags; @@ -204,6 +282,7 @@ struct PSI_rwlock_locker_state_v1 ulonglong (*m_timer)(void); void *m_wait; }; +typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state_v1; struct PSI_cond_locker_state_v1 { uint m_flags; @@ -215,6 +294,7 @@ struct PSI_cond_locker_state_v1 ulonglong (*m_timer)(void); void *m_wait; }; +typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state_v1; struct PSI_file_locker_state_v1 { uint m_flags; @@ -228,21 +308,21 @@ struct PSI_file_locker_state_v1 ulonglong (*m_timer)(void); void *m_wait; }; -struct PSI_table_locker_state_v1 +typedef struct PSI_file_locker_state_v1 PSI_file_locker_state_v1; +struct PSI_metadata_locker_state_v1 { uint m_flags; - enum PSI_table_io_operation m_io_operation; - struct PSI_table *m_table; - struct PSI_table_share *m_table_share; + struct PSI_metadata_lock *m_metadata_lock; struct PSI_thread *m_thread; ulonglong m_timer_start; ulonglong (*m_timer)(void); void *m_wait; - uint m_index; }; +typedef struct PSI_metadata_locker_state_v1 PSI_metadata_locker_state_v1; struct PSI_statement_locker_state_v1 { my_bool m_discarded; + my_bool m_in_prepare; uchar m_no_index_used; uchar m_no_good_index_used; uint m_flags; @@ -269,7 +349,26 @@ struct PSI_statement_locker_state_v1 char m_schema_name[(64 * 3)]; uint m_schema_name_length; uint m_cs_number; + PSI_sp_share *m_parent_sp_share; + PSI_prepared_stmt *m_parent_prepared_stmt; }; +typedef struct PSI_statement_locker_state_v1 PSI_statement_locker_state_v1; +struct PSI_transaction_locker_state_v1 +{ + uint m_flags; + void *m_class; + struct PSI_thread *m_thread; + ulonglong m_timer_start; + ulonglong (*m_timer)(void); + void *m_transaction; + my_bool m_read_only; + my_bool m_autocommit; + ulong m_statement_count; + ulong m_savepoint_count; + ulong m_rollback_to_savepoint_count; + ulong m_release_savepoint_count; +}; +typedef struct PSI_transaction_locker_state_v1 PSI_transaction_locker_state_v1; struct PSI_socket_locker_state_v1 { uint m_flags; @@ -283,6 +382,16 @@ struct PSI_socket_locker_state_v1 int m_src_line; void *m_wait; }; +typedef struct PSI_socket_locker_state_v1 PSI_socket_locker_state_v1; +struct PSI_sp_locker_state_v1 +{ + uint m_flags; + struct PSI_thread *m_thread; + ulonglong m_timer_start; + ulonglong (*m_timer)(void); + PSI_sp_share* m_sp_share; +}; +typedef struct PSI_sp_locker_state_v1 PSI_sp_locker_state_v1; typedef void (*register_mutex_v1_t) (const char *category, struct PSI_mutex_info_v1 *info, int count); typedef void (*register_rwlock_v1_t) @@ -324,7 +433,8 @@ typedef void (*unbind_table_v1_t) (struct PSI_table *table); typedef PSI_table* (*rebind_table_v1_t) (PSI_table_share *share, const void *identity, PSI_table *table); -typedef void (*close_table_v1_t)(struct PSI_table *table); +typedef void (*close_table_v1_t)(struct TABLE_SHARE *server_share, + struct PSI_table *table); typedef void (*create_file_v1_t)(PSI_file_key key, const char *name, File file); typedef int (*spawn_thread_v1_t)(PSI_thread_key key, @@ -333,14 +443,18 @@ typedef int (*spawn_thread_v1_t)(PSI_thread_key key, void *(*start_routine)(void*), void *arg); typedef struct PSI_thread* (*new_thread_v1_t) (PSI_thread_key key, const void *identity, ulonglong thread_id); +typedef void (*set_thread_THD_v1_t)(struct PSI_thread *thread, + THD *thd); typedef void (*set_thread_id_v1_t)(struct PSI_thread *thread, ulonglong id); +typedef void (*set_thread_os_id_v1_t)(struct PSI_thread *thread); typedef struct PSI_thread* (*get_thread_v1_t)(void); typedef void (*set_thread_user_v1_t)(const char *user, int user_len); -typedef void (*set_thread_user_host_v1_t)(const char *user, int user_len, - const char *host, int host_len); +typedef void (*set_thread_account_v1_t)(const char *user, int user_len, + const char *host, int host_len); typedef void (*set_thread_db_v1_t)(const char* db, int db_len); typedef void (*set_thread_command_v1_t)(int command); +typedef void (*set_connection_type_v1_t)(opaque_vio_type conn_type); typedef void (*set_thread_start_time_v1_t)(time_t start_time); typedef void (*set_thread_state_v1_t)(const char* state); typedef void (*set_thread_info_v1_t)(const char* info, uint info_len); @@ -399,25 +513,30 @@ typedef struct PSI_cond_locker* (*start_cond_wait_v1_t) typedef void (*end_cond_wait_v1_t) (struct PSI_cond_locker *locker, int rc); typedef struct PSI_table_locker* (*start_table_io_wait_v1_t) - (struct PSI_table_locker_state_v1 *state, + (struct PSI_table_locker_state *state, struct PSI_table *table, enum PSI_table_io_operation op, uint index, const char *src_file, uint src_line); -typedef void (*end_table_io_wait_v1_t)(struct PSI_table_locker *locker); +typedef void (*end_table_io_wait_v1_t) + (struct PSI_table_locker *locker, + ulonglong numrows); typedef struct PSI_table_locker* (*start_table_lock_wait_v1_t) - (struct PSI_table_locker_state_v1 *state, + (struct PSI_table_locker_state *state, struct PSI_table *table, enum PSI_table_lock_operation op, ulong flags, const char *src_file, uint src_line); typedef void (*end_table_lock_wait_v1_t)(struct PSI_table_locker *locker); +typedef void (*unlock_table_v1_t)(struct PSI_table *table); typedef void (*start_file_open_wait_v1_t) (struct PSI_file_locker *locker, const char *src_file, uint src_line); typedef struct PSI_file* (*end_file_open_wait_v1_t) (struct PSI_file_locker *locker, void *result); typedef void (*end_file_open_wait_and_bind_to_descriptor_v1_t) (struct PSI_file_locker *locker, File file); +typedef void (*end_temp_file_open_wait_and_bind_to_descriptor_v1_t) + (struct PSI_file_locker *locker, File file, const char *filename); typedef void (*start_file_wait_v1_t) (struct PSI_file_locker *locker, size_t count, const char *src_file, uint src_line); @@ -427,12 +546,16 @@ typedef void (*start_file_close_wait_v1_t) (struct PSI_file_locker *locker, const char *src_file, uint src_line); typedef void (*end_file_close_wait_v1_t) (struct PSI_file_locker *locker, int rc); -typedef void (*start_stage_v1_t) +typedef void (*end_file_rename_wait_v1_t) + (struct PSI_file_locker *locker, const char *old_name, + const char *new_name, int rc); +typedef PSI_stage_progress* (*start_stage_v1_t) (PSI_stage_key key, const char *src_file, int src_line); +typedef PSI_stage_progress* (*get_current_stage_progress_v1_t)(void); typedef void (*end_stage_v1_t) (void); typedef struct PSI_statement_locker* (*get_thread_statement_locker_v1_t) (struct PSI_statement_locker_state_v1 *state, - PSI_statement_key key, const void *charset); + PSI_statement_key key, const void *charset, PSI_sp_share *sp_share); typedef struct PSI_statement_locker* (*refine_statement_v1_t) (struct PSI_statement_locker *locker, PSI_statement_key key); @@ -477,6 +600,34 @@ typedef void (*set_statement_no_good_index_used_t) (struct PSI_statement_locker *locker); typedef void (*end_statement_v1_t) (struct PSI_statement_locker *locker, void *stmt_da); +typedef struct PSI_transaction_locker* (*get_thread_transaction_locker_v1_t) + (struct PSI_transaction_locker_state_v1 *state, const void *xid, + const ulonglong *trxid, int isolation_level, my_bool read_only, + my_bool autocommit); +typedef void (*start_transaction_v1_t) + (struct PSI_transaction_locker *locker, + const char *src_file, uint src_line); +typedef void (*set_transaction_xid_v1_t) + (struct PSI_transaction_locker *locker, + const void *xid, int xa_state); +typedef void (*set_transaction_xa_state_v1_t) + (struct PSI_transaction_locker *locker, + int xa_state); +typedef void (*set_transaction_gtid_v1_t) + (struct PSI_transaction_locker *locker, + const void *sid, const void *gtid_spec); +typedef void (*set_transaction_trxid_v1_t) + (struct PSI_transaction_locker *locker, + const ulonglong *trxid); +typedef void (*inc_transaction_savepoints_v1_t) + (struct PSI_transaction_locker *locker, ulong count); +typedef void (*inc_transaction_rollback_to_savepoint_v1_t) + (struct PSI_transaction_locker *locker, ulong count); +typedef void (*inc_transaction_release_savepoint_v1_t) + (struct PSI_transaction_locker *locker, ulong count); +typedef void (*end_transaction_v1_t) + (struct PSI_transaction_locker *locker, + my_bool commit); typedef struct PSI_socket_locker* (*start_socket_wait_v1_t) (struct PSI_socket_locker_state_v1 *state, struct PSI_socket *socket, @@ -492,10 +643,53 @@ typedef void (*set_socket_info_v1_t)(struct PSI_socket *socket, const struct sockaddr *addr, socklen_t addr_len); typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket); +typedef PSI_prepared_stmt* (*create_prepared_stmt_v1_t) + (void *identity, uint stmt_id, PSI_statement_locker *locker, + const char *stmt_name, size_t stmt_name_length, + const char *name, size_t length); +typedef void (*destroy_prepared_stmt_v1_t) + (PSI_prepared_stmt *prepared_stmt); +typedef void (*reprepare_prepared_stmt_v1_t) + (PSI_prepared_stmt *prepared_stmt); +typedef void (*execute_prepared_stmt_v1_t) + (PSI_statement_locker *locker, PSI_prepared_stmt* prepared_stmt); +typedef void (*set_prepared_stmt_text_v1_t)(PSI_prepared_stmt *prepared_stmt, + const char *text, + uint text_len); typedef struct PSI_digest_locker * (*digest_start_v1_t) (struct PSI_statement_locker *locker); typedef void (*digest_end_v1_t) (struct PSI_digest_locker *locker, const struct sql_digest_storage *digest); +typedef PSI_sp_locker* (*start_sp_v1_t) + (struct PSI_sp_locker_state_v1 *state, struct PSI_sp_share* sp_share); +typedef void (*end_sp_v1_t) + (struct PSI_sp_locker *locker); +typedef void (*drop_sp_v1_t) + (uint object_type, + const char *schema_name, uint schema_name_length, + const char *object_name, uint object_name_length); +typedef struct PSI_sp_share* (*get_sp_share_v1_t) + (uint object_type, + const char *schema_name, uint schema_name_length, + const char *object_name, uint object_name_length); +typedef void (*release_sp_share_v1_t)(struct PSI_sp_share *share); +typedef PSI_metadata_lock* (*create_metadata_lock_v1_t) + (void *identity, + const MDL_key *key, + opaque_mdl_type mdl_type, + opaque_mdl_duration mdl_duration, + opaque_mdl_status mdl_status, + const char *src_file, + uint src_line); +typedef void (*set_metadata_lock_status_v1_t)(PSI_metadata_lock *lock, + opaque_mdl_status mdl_status); +typedef void (*destroy_metadata_lock_v1_t)(PSI_metadata_lock *lock); +typedef struct PSI_metadata_locker* (*start_metadata_wait_v1_t) + (struct PSI_metadata_locker_state_v1 *state, + struct PSI_metadata_lock *mdl, + const char *src_file, uint src_line); +typedef void (*end_metadata_wait_v1_t) + (struct PSI_metadata_locker *locker, int rc); typedef int (*set_thread_connect_attrs_v1_t)(const char *buffer, uint length, const void *from_cs); struct PSI_v1 @@ -527,11 +721,14 @@ struct PSI_v1 spawn_thread_v1_t spawn_thread; new_thread_v1_t new_thread; set_thread_id_v1_t set_thread_id; + set_thread_THD_v1_t set_thread_THD; + set_thread_os_id_v1_t set_thread_os_id; get_thread_v1_t get_thread; set_thread_user_v1_t set_thread_user; - set_thread_user_host_v1_t set_thread_user_host; + set_thread_account_v1_t set_thread_account; set_thread_db_v1_t set_thread_db; set_thread_command_v1_t set_thread_command; + set_connection_type_v1_t set_connection_type; set_thread_start_time_v1_t set_thread_start_time; set_thread_state_v1_t set_thread_state; set_thread_info_v1_t set_thread_info; @@ -563,11 +760,15 @@ struct PSI_v1 end_file_open_wait_v1_t end_file_open_wait; end_file_open_wait_and_bind_to_descriptor_v1_t end_file_open_wait_and_bind_to_descriptor; + end_temp_file_open_wait_and_bind_to_descriptor_v1_t + end_temp_file_open_wait_and_bind_to_descriptor; start_file_wait_v1_t start_file_wait; end_file_wait_v1_t end_file_wait; start_file_close_wait_v1_t start_file_close_wait; end_file_close_wait_v1_t end_file_close_wait; + end_file_rename_wait_v1_t end_file_rename_wait; start_stage_v1_t start_stage; + get_current_stage_progress_v1_t get_current_stage_progress; end_stage_v1_t end_stage; get_thread_statement_locker_v1_t get_thread_statement_locker; refine_statement_v1_t refine_statement; @@ -590,14 +791,45 @@ struct PSI_v1 set_statement_no_index_used_t set_statement_no_index_used; set_statement_no_good_index_used_t set_statement_no_good_index_used; end_statement_v1_t end_statement; + get_thread_transaction_locker_v1_t get_thread_transaction_locker; + start_transaction_v1_t start_transaction; + set_transaction_xid_v1_t set_transaction_xid; + set_transaction_xa_state_v1_t set_transaction_xa_state; + set_transaction_gtid_v1_t set_transaction_gtid; + set_transaction_trxid_v1_t set_transaction_trxid; + inc_transaction_savepoints_v1_t inc_transaction_savepoints; + inc_transaction_rollback_to_savepoint_v1_t inc_transaction_rollback_to_savepoint; + inc_transaction_release_savepoint_v1_t inc_transaction_release_savepoint; + end_transaction_v1_t end_transaction; start_socket_wait_v1_t start_socket_wait; end_socket_wait_v1_t end_socket_wait; set_socket_state_v1_t set_socket_state; set_socket_info_v1_t set_socket_info; set_socket_thread_owner_v1_t set_socket_thread_owner; + create_prepared_stmt_v1_t create_prepared_stmt; + destroy_prepared_stmt_v1_t destroy_prepared_stmt; + reprepare_prepared_stmt_v1_t reprepare_prepared_stmt; + execute_prepared_stmt_v1_t execute_prepared_stmt; + set_prepared_stmt_text_v1_t set_prepared_stmt_text; digest_start_v1_t digest_start; digest_end_v1_t digest_end; set_thread_connect_attrs_v1_t set_thread_connect_attrs; + start_sp_v1_t start_sp; + end_sp_v1_t end_sp; + drop_sp_v1_t drop_sp; + get_sp_share_v1_t get_sp_share; + release_sp_share_v1_t release_sp_share; + register_memory_v1_t register_memory; + memory_alloc_v1_t memory_alloc; + memory_realloc_v1_t memory_realloc; + memory_claim_v1_t memory_claim; + memory_free_v1_t memory_free; + unlock_table_v1_t unlock_table; + create_metadata_lock_v1_t create_metadata_lock; + set_metadata_lock_status_v1_t set_metadata_lock_status; + destroy_metadata_lock_v1_t destroy_metadata_lock; + start_metadata_wait_v1_t start_metadata_wait; + end_metadata_wait_v1_t end_metadata_wait; }; typedef struct PSI_v1 PSI; typedef struct PSI_mutex_info_v1 PSI_mutex_info; @@ -607,15 +839,18 @@ typedef struct PSI_thread_info_v1 PSI_thread_info; typedef struct PSI_file_info_v1 PSI_file_info; typedef struct PSI_stage_info_v1 PSI_stage_info; typedef struct PSI_statement_info_v1 PSI_statement_info; +typedef struct PSI_transaction_info_v1 PSI_transaction_info; typedef struct PSI_socket_info_v1 PSI_socket_info; typedef struct PSI_idle_locker_state_v1 PSI_idle_locker_state; typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state; typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state; typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state; typedef struct PSI_file_locker_state_v1 PSI_file_locker_state; -typedef struct PSI_table_locker_state_v1 PSI_table_locker_state; typedef struct PSI_statement_locker_state_v1 PSI_statement_locker_state; +typedef struct PSI_transaction_locker_state_v1 PSI_transaction_locker_state; typedef struct PSI_socket_locker_state_v1 PSI_socket_locker_state; +typedef struct PSI_sp_locker_state_v1 PSI_sp_locker_state; +typedef struct PSI_metadata_locker_state_v1 PSI_metadata_locker_state; extern MYSQL_PLUGIN_IMPORT my_bool pfs_enabled; extern MYSQL_PLUGIN_IMPORT PSI *PSI_server; C_MODE_END diff --git a/include/mysql/psi/psi_abi_v2.h b/include/mysql/psi/psi_abi_v2.h index 67c054848a1..3495d618b05 100644 --- a/include/mysql/psi/psi_abi_v2.h +++ b/include/mysql/psi/psi_abi_v2.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2013, 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, version 2.0, diff --git a/include/mysql/psi/psi_abi_v2.h.pp b/include/mysql/psi/psi_abi_v2.h.pp index adf1af7cfae..47e81a2c6bc 100644 --- a/include/mysql/psi/psi_abi_v2.h.pp +++ b/include/mysql/psi/psi_abi_v2.h.pp @@ -1,6 +1,24 @@ +extern "C" { +} +extern "C" { +struct PSI_thread; +typedef unsigned int PSI_memory_key; +struct PSI_memory_info_v2 +{ + int placeholder; +}; +typedef struct PSI_memory_info_v2 PSI_memory_info; +} C_MODE_START +struct MDL_key; +typedef struct MDL_key MDL_key; +typedef int opaque_mdl_type; +typedef int opaque_mdl_duration; +typedef int opaque_mdl_status; +typedef int opaque_vio_type; struct TABLE_SHARE; struct sql_digest_storage; + class THD; struct PSI_mutex; typedef struct PSI_mutex PSI_mutex; struct PSI_rwlock; @@ -17,14 +35,51 @@ struct PSI_file; typedef struct PSI_file PSI_file; struct PSI_socket; typedef struct PSI_socket PSI_socket; +struct PSI_prepared_stmt; +typedef struct PSI_prepared_stmt PSI_prepared_stmt; struct PSI_table_locker; typedef struct PSI_table_locker PSI_table_locker; struct PSI_statement_locker; typedef struct PSI_statement_locker PSI_statement_locker; +struct PSI_transaction_locker; +typedef struct PSI_transaction_locker PSI_transaction_locker; struct PSI_idle_locker; typedef struct PSI_idle_locker PSI_idle_locker; struct PSI_digest_locker; typedef struct PSI_digest_locker PSI_digest_locker; +struct PSI_sp_share; +typedef struct PSI_sp_share PSI_sp_share; +struct PSI_sp_locker; +typedef struct PSI_sp_locker PSI_sp_locker; +struct PSI_metadata_lock; +typedef struct PSI_metadata_lock PSI_metadata_lock; +struct PSI_stage_progress +{ + ulonglong m_work_completed; + ulonglong m_work_estimated; +}; +typedef struct PSI_stage_progress PSI_stage_progress; +enum PSI_table_io_operation +{ + PSI_TABLE_FETCH_ROW= 0, + PSI_TABLE_WRITE_ROW= 1, + PSI_TABLE_UPDATE_ROW= 2, + PSI_TABLE_DELETE_ROW= 3 +}; +typedef enum PSI_table_io_operation PSI_table_io_operation; +struct PSI_table_locker_state +{ + uint m_flags; + enum PSI_table_io_operation m_io_operation; + struct PSI_table *m_table; + struct PSI_table_share *m_table_share; + struct PSI_thread *m_thread; + ulonglong m_timer_start; + ulonglong (*m_timer)(void); + void *m_wait; + uint m_index; +}; +typedef struct PSI_table_locker_state PSI_table_locker_state; struct PSI_bootstrap { void* (*get_interface)(int version); @@ -40,6 +95,8 @@ struct PSI_file_locker; typedef struct PSI_file_locker PSI_file_locker; struct PSI_socket_locker; typedef struct PSI_socket_locker PSI_socket_locker; +struct PSI_metadata_locker; +typedef struct PSI_metadata_locker PSI_metadata_locker; enum PSI_mutex_operation { PSI_MUTEX_LOCK= 0, @@ -51,7 +108,13 @@ enum PSI_rwlock_operation PSI_RWLOCK_READLOCK= 0, PSI_RWLOCK_WRITELOCK= 1, PSI_RWLOCK_TRYREADLOCK= 2, - PSI_RWLOCK_TRYWRITELOCK= 3 + PSI_RWLOCK_TRYWRITELOCK= 3, + PSI_RWLOCK_SHAREDLOCK= 4, + PSI_RWLOCK_SHAREDEXCLUSIVELOCK= 5, + PSI_RWLOCK_EXCLUSIVELOCK= 6, + PSI_RWLOCK_TRYSHAREDLOCK= 7, + PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK= 8, + PSI_RWLOCK_TRYEXCLUSIVELOCK= 9 }; typedef enum PSI_rwlock_operation PSI_rwlock_operation; enum PSI_cond_operation @@ -81,14 +144,6 @@ enum PSI_file_operation PSI_FILE_SYNC= 16 }; typedef enum PSI_file_operation PSI_file_operation; -enum PSI_table_io_operation -{ - PSI_TABLE_FETCH_ROW= 0, - PSI_TABLE_WRITE_ROW= 1, - PSI_TABLE_UPDATE_ROW= 2, - PSI_TABLE_DELETE_ROW= 3 -}; -typedef enum PSI_table_io_operation PSI_table_io_operation; enum PSI_table_lock_operation { PSI_TABLE_LOCK= 0, @@ -160,6 +215,10 @@ struct PSI_statement_info_v2 { int placeholder; }; +struct PSI_transaction_info_v2 +{ + int placeholder; +}; struct PSI_idle_locker_state_v2 { int placeholder; @@ -180,18 +239,22 @@ struct PSI_file_locker_state_v2 { int placeholder; }; -struct PSI_table_locker_state_v2 -{ - int placeholder; -}; struct PSI_statement_locker_state_v2 { int placeholder; }; +struct PSI_transaction_locker_state_v2 +{ + int placeholder; +}; struct PSI_socket_locker_state_v2 { int placeholder; }; +struct PSI_metadata_locker_state_v2 +{ + int placeholder; +}; typedef struct PSI_v2 PSI; typedef struct PSI_mutex_info_v2 PSI_mutex_info; typedef struct PSI_rwlock_info_v2 PSI_rwlock_info; @@ -200,15 +263,18 @@ typedef struct PSI_thread_info_v2 PSI_thread_info; typedef struct PSI_file_info_v2 PSI_file_info; typedef struct PSI_stage_info_v2 PSI_stage_info; typedef struct PSI_statement_info_v2 PSI_statement_info; +typedef struct PSI_transaction_info_v2 PSI_transaction_info; typedef struct PSI_socket_info_v2 PSI_socket_info; typedef struct PSI_idle_locker_state_v2 PSI_idle_locker_state; typedef struct PSI_mutex_locker_state_v2 PSI_mutex_locker_state; typedef struct PSI_rwlock_locker_state_v2 PSI_rwlock_locker_state; typedef struct PSI_cond_locker_state_v2 PSI_cond_locker_state; typedef struct PSI_file_locker_state_v2 PSI_file_locker_state; -typedef struct PSI_table_locker_state_v2 PSI_table_locker_state; typedef struct PSI_statement_locker_state_v2 PSI_statement_locker_state; +typedef struct PSI_transaction_locker_state_v2 PSI_transaction_locker_state; typedef struct PSI_socket_locker_state_v2 PSI_socket_locker_state; +typedef struct PSI_sp_locker_state_v2 PSI_sp_locker_state; +typedef struct PSI_metadata_locker_state_v2 PSI_metadata_locker_state; extern MYSQL_PLUGIN_IMPORT my_bool pfs_enabled; extern MYSQL_PLUGIN_IMPORT PSI *PSI_server; C_MODE_END diff --git a/include/mysql/psi/psi_base.h b/include/mysql/psi/psi_base.h index 2bb3061d55c..95f8d2101f0 100644 --- a/include/mysql/psi/psi_base.h +++ b/include/mysql/psi/psi_base.h @@ -1,13 +1,25 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2016, 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. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. + + Without limiting anything contained in the foregoing, this file, + which is part of C Driver for MySQL (Connector/C), is also subject to the + Universal FOSS Exception, version 1.0, a copy of which can be found at + http://oss.oracle.com/licenses/universal-foss-exception. 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. + GNU General Public License, version 2.0, 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, @@ -30,6 +42,7 @@ extern "C" { */ #define PSI_INSTRUMENT_ME 0 +#define PSI_INSTRUMENT_MEM ((PSI_memory_key)0) #define PSI_NOT_INSTRUMENTED 0 @@ -69,6 +82,14 @@ extern "C" { */ #define PSI_FLAG_TRANSFER (1 << 5) +/** + Volatility flag. + This flag indicate that an instrumented object + has a volatility (life cycle) comparable + to the volatility of a session. +*/ +#define PSI_FLAG_VOLATILITY_SESSION (1 << 6) + #ifdef HAVE_PSI_INTERFACE /** diff --git a/include/mysql/psi/psi_memory.h b/include/mysql/psi/psi_memory.h index 3c633e6a918..bbe2be32a29 100644 --- a/include/mysql/psi/psi_memory.h +++ b/include/mysql/psi/psi_memory.h @@ -1,13 +1,25 @@ /* Copyright (c) 2013, 2015, 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. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. + + Without limiting anything contained in the foregoing, this file, + which is part of C Driver for MySQL (Connector/C), is also subject to the + Universal FOSS Exception, version 1.0, a copy of which can be found at + http://oss.oracle.com/licenses/universal-foss-exception. 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. + GNU General Public License, version 2.0, 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, diff --git a/include/pfs_file_provider.h b/include/pfs_file_provider.h new file mode 100644 index 00000000000..eae10e9c39e --- /dev/null +++ b/include/pfs_file_provider.h @@ -0,0 +1,89 @@ +/* Copyright (c) 2012, 2015, 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef PFS_FILE_PROVIDER_H +#define PFS_FILE_PROVIDER_H + +/** + @file include/pfs_file_provider.h + Performance schema instrumentation (declarations). +*/ + +#ifdef HAVE_PSI_FILE_INTERFACE +#ifdef MYSQL_SERVER +#ifndef EMBEDDED_LIBRARY +#ifndef MYSQL_DYNAMIC_PLUGIN + +#include "mysql/psi/psi.h" + +#define PSI_FILE_CALL(M) pfs_ ## M ## _v1 + +C_MODE_START + +void pfs_register_file_v1(const char *category, + PSI_file_info_v1 *info, + int count); + +void pfs_create_file_v1(PSI_file_key key, const char *name, File file); + +PSI_file_locker* +pfs_get_thread_file_name_locker_v1(PSI_file_locker_state *state, + PSI_file_key key, + PSI_file_operation op, + const char *name, const void *identity); + +PSI_file_locker* +pfs_get_thread_file_stream_locker_v1(PSI_file_locker_state *state, + PSI_file *file, PSI_file_operation op); + +PSI_file_locker* +pfs_get_thread_file_descriptor_locker_v1(PSI_file_locker_state *state, + File file, PSI_file_operation op); + +void pfs_start_file_open_wait_v1(PSI_file_locker *locker, + const char *src_file, + uint src_line); + +PSI_file* pfs_end_file_open_wait_v1(PSI_file_locker *locker, void *result); + +void pfs_end_file_open_wait_and_bind_to_descriptor_v1 + (PSI_file_locker *locker, File file); + +void pfs_end_temp_file_open_wait_and_bind_to_descriptor_v1 + (PSI_file_locker *locker, File file, const char *filename); + +void pfs_start_file_wait_v1(PSI_file_locker *locker, + size_t count, + const char *src_file, + uint src_line); + +void pfs_end_file_wait_v1(PSI_file_locker *locker, + size_t byte_count); + +void pfs_start_file_close_wait_v1(PSI_file_locker *locker, + const char *src_file, + uint src_line); + +void pfs_end_file_close_wait_v1(PSI_file_locker *locker, int rc); + +C_MODE_END + +#endif /* EMBEDDED_LIBRARY */ +#endif /* MYSQL_DYNAMIC_PLUGIN */ +#endif /* MYSQL_SERVER */ +#endif /* HAVE_PSI_FILE_INTERFACE */ + +#endif + diff --git a/include/pfs_idle_provider.h b/include/pfs_idle_provider.h new file mode 100644 index 00000000000..71d116f7423 --- /dev/null +++ b/include/pfs_idle_provider.h @@ -0,0 +1,48 @@ +/* Copyright (c) 2012, 2015, 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef PFS_IDLE_PROVIDER_H +#define PFS_IDLE_PROVIDER_H + +/** + @file include/pfs_idle_provider.h + Performance schema instrumentation (declarations). +*/ + +#ifdef HAVE_PSI_IDLE_INTERFACE +#ifdef MYSQL_SERVER +#ifndef EMBEDDED_LIBRARY +#ifndef MYSQL_DYNAMIC_PLUGIN + +#include "mysql/psi/psi.h" + +#define PSI_IDLE_CALL(M) pfs_ ## M ## _v1 + +C_MODE_START + +PSI_idle_locker* +pfs_start_idle_wait_v1(PSI_idle_locker_state* state, const char *src_file, uint src_line); + +void pfs_end_idle_wait_v1(PSI_idle_locker* locker); + +C_MODE_END + +#endif /* MYSQL_DYNAMIC_PLUGIN */ +#endif /* EMBEDDED_LIBRARY */ +#endif /* MYSQL_SERVER */ +#endif /* HAVE_PSI_IDLE_INTERFACE */ + +#endif + diff --git a/include/pfs_memory_provider.h b/include/pfs_memory_provider.h new file mode 100644 index 00000000000..ea60f9de3be --- /dev/null +++ b/include/pfs_memory_provider.h @@ -0,0 +1,57 @@ +/* Copyright (c) 2012, 2015, 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef PFS_MEMORY_PROVIDER_H +#define PFS_MEMORY_PROVIDER_H + +/** + @file include/pfs_memory_provider.h + Performance schema instrumentation (declarations). +*/ + +#ifdef HAVE_PSI_MEMORY_INTERFACE +#ifdef MYSQL_SERVER +#ifndef EMBEDDED_LIBRARY +#ifndef MYSQL_DYNAMIC_PLUGIN + +#include "mysql/psi/psi.h" + +#define PSI_MEMORY_CALL(M) pfs_ ## M ## _v1 + +C_MODE_START + +void pfs_register_memory_v1 + (const char *category, struct PSI_memory_info_v1 *info, int count); + +PSI_memory_key +pfs_memory_alloc_v1 + (PSI_memory_key key, size_t size, PSI_thread **owner); + +PSI_memory_key +pfs_memory_realloc_v1 + (PSI_memory_key key, size_t old_size, size_t new_size, PSI_thread **owner); + +void pfs_memory_free_v1 + (PSI_memory_key key, size_t size, PSI_thread *owner); + +C_MODE_END + +#endif /* MYSQL_DYNAMIC_PLUGIN */ +#endif /* EMBEDDED_LIBRARY */ +#endif /* MYSQL_SERVER */ +#endif /* HAVE_PSI_MEMORY_INTERFACE */ + +#endif + diff --git a/include/pfs_metadata_provider.h b/include/pfs_metadata_provider.h new file mode 100644 index 00000000000..cf3dd0d0dc1 --- /dev/null +++ b/include/pfs_metadata_provider.h @@ -0,0 +1,67 @@ +/* Copyright (c) 2012, 2015, 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef PFS_METADATA_PROVIDER_H +#define PFS_METADATA_PROVIDER_H + +/** + @file include/pfs_metadata_provider.h + Performance schema instrumentation (declarations). +*/ + +#ifdef HAVE_PSI_METADATA_INTERFACE +#ifdef MYSQL_SERVER +#ifndef EMBEDDED_LIBRARY +#ifndef MYSQL_DYNAMIC_PLUGIN + +#include "mysql/psi/psi.h" + +#define PSI_METADATA_CALL(M) pfs_ ## M ## _v1 + +C_MODE_START + +PSI_metadata_lock* pfs_create_metadata_lock_v1 + (void *identity, + const MDL_key *key, + opaque_mdl_type mdl_type, + opaque_mdl_duration mdl_duration, + opaque_mdl_status mdl_status, + const char *src_file, + uint src_line); + +void pfs_set_metadata_lock_status_v1 + (PSI_metadata_lock *lock, + opaque_mdl_status mdl_status); + +void pfs_destroy_metadata_lock_v1(PSI_metadata_lock *lock); + +struct PSI_metadata_locker* +pfs_start_metadata_wait_v1 + (struct PSI_metadata_locker_state_v1 *state, + struct PSI_metadata_lock *mdl, + const char *src_file, uint src_line); + +void pfs_end_metadata_wait_v1 + (struct PSI_metadata_locker *locker, int rc); + +C_MODE_END + +#endif /* MYSQL_DYNAMIC_PLUGIN */ +#endif /* EMBEDDED_LIBRARY */ +#endif /* MYSQL_SERVER */ +#endif /* HAVE_PSI_METADATA_INTERFACE */ + +#endif + diff --git a/include/pfs_socket_provider.h b/include/pfs_socket_provider.h new file mode 100644 index 00000000000..bfafdaafb00 --- /dev/null +++ b/include/pfs_socket_provider.h @@ -0,0 +1,71 @@ +/* Copyright (c) 2012, 2015, 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef PFS_SOCKET_PROVIDER_H +#define PFS_SOCKET_PROVIDER_H + +/** + @file include/pfs_socket_provider.h + Performance schema instrumentation (declarations). +*/ + +#ifdef HAVE_PSI_SOCKET_INTERFACE +#ifdef MYSQL_SERVER +#ifndef EMBEDDED_LIBRARY +#ifndef MYSQL_DYNAMIC_PLUGIN + +#include "mysql/psi/psi.h" + +#define PSI_SOCKET_CALL(M) pfs_ ## M ## _v1 + +C_MODE_START + +void pfs_register_socket_v1(const char *category, + PSI_socket_info_v1 *info, + int count); + +PSI_socket* +pfs_init_socket_v1(PSI_socket_key key, const my_socket *fd, + const struct sockaddr *addr, socklen_t addr_len); + +void pfs_destroy_socket_v1(PSI_socket *socket); + +PSI_socket_locker* +pfs_start_socket_wait_v1(PSI_socket_locker_state *state, + PSI_socket *socket, + PSI_socket_operation op, + size_t count, + const char *src_file, uint src_line); + +void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count); + +void pfs_set_socket_state_v1(PSI_socket *socket, PSI_socket_state state); + +void pfs_set_socket_info_v1(PSI_socket *socket, + const my_socket *fd, + const struct sockaddr *addr, + socklen_t addr_len); + +void pfs_set_socket_thread_owner_v1(PSI_socket *socket); + +C_MODE_END + +#endif /* EMBEDDED_LIBRARY */ +#endif /* MYSQL_DYNAMIC_PLUGIN */ +#endif /* MYSQL_SERVER */ +#endif /* HAVE_PSI_SOCKET_INTERFACE */ + +#endif + diff --git a/include/pfs_stage_provider.h b/include/pfs_stage_provider.h new file mode 100644 index 00000000000..2ad2faab890 --- /dev/null +++ b/include/pfs_stage_provider.h @@ -0,0 +1,52 @@ +/* Copyright (c) 2012, 2015, 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef PFS_STAGE_PROVIDER_H +#define PFS_STAGE_PROVIDER_H + +/** + @file include/pfs_stage_provider.h + Performance schema instrumentation (declarations). +*/ + +#ifdef HAVE_PSI_STAGE_INTERFACE +#ifdef MYSQL_SERVER +#ifndef EMBEDDED_LIBRARY +#ifndef MYSQL_DYNAMIC_PLUGIN + +#include "mysql/psi/psi.h" + +#define PSI_STAGE_CALL(M) pfs_ ## M ## _v1 + +C_MODE_START + +void pfs_register_stage_v1(const char *category, + PSI_stage_info_v1 **info_array, + int count); + +PSI_stage_progress* pfs_start_stage_v1(PSI_stage_key key, const char *src_file, int src_line); +PSI_stage_progress* pfs_get_current_stage_progress_v1(); + +void pfs_end_stage_v1(); + +C_MODE_END + +#endif /* MYSQL_DYNAMIC_PLUGIN */ +#endif /* EMBEDDED_LIBRARY */ +#endif /* MYSQL_SERVER */ +#endif /* HAVE_PSI_STAGE_INTERFACE */ + +#endif + diff --git a/include/pfs_statement_provider.h b/include/pfs_statement_provider.h new file mode 100644 index 00000000000..96870d8400d --- /dev/null +++ b/include/pfs_statement_provider.h @@ -0,0 +1,118 @@ +/* Copyright (c) 2012, 2015, 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef PFS_STATEMENT_PROVIDER_H +#define PFS_STATEMENT_PROVIDER_H + +/** + @file include/pfs_statement_provider.h + Performance schema instrumentation (declarations). +*/ + +#ifdef HAVE_PSI_STATEMENT_INTERFACE +#ifdef MYSQL_SERVER +#ifndef EMBEDDED_LIBRARY +#ifndef MYSQL_DYNAMIC_PLUGIN + +#include "mysql/psi/psi.h" + +#define PSI_STATEMENT_CALL(M) pfs_ ## M ## _v1 +#define PSI_DIGEST_CALL(M) pfs_ ## M ## _v1 + +C_MODE_START + +void pfs_register_statement_v1(const char *category, + PSI_statement_info_v1 *info, + int count); + +PSI_statement_locker* +pfs_get_thread_statement_locker_v1(PSI_statement_locker_state *state, + PSI_statement_key key, + const void *charset, + PSI_sp_share *sp_share); + +PSI_statement_locker* +pfs_refine_statement_v1(PSI_statement_locker *locker, + PSI_statement_key key); + +void pfs_start_statement_v1(PSI_statement_locker *locker, + const char *db, uint db_len, + const char *src_file, uint src_line); + +void pfs_set_statement_text_v1(PSI_statement_locker *locker, + const char *text, uint text_len); + +void pfs_set_statement_lock_time_v1(PSI_statement_locker *locker, + ulonglong count); + +void pfs_set_statement_rows_sent_v1(PSI_statement_locker *locker, + ulonglong count); + +void pfs_set_statement_rows_examined_v1(PSI_statement_locker *locker, + ulonglong count); + +void pfs_inc_statement_created_tmp_disk_tables_v1(PSI_statement_locker *locker, + ulong count); + +void pfs_inc_statement_created_tmp_tables_v1(PSI_statement_locker *locker, + ulong count); + +void pfs_inc_statement_select_full_join_v1(PSI_statement_locker *locker, + ulong count); + +void pfs_inc_statement_select_full_range_join_v1(PSI_statement_locker *locker, + ulong count); + +void pfs_inc_statement_select_range_v1(PSI_statement_locker *locker, + ulong count); + +void pfs_inc_statement_select_range_check_v1(PSI_statement_locker *locker, + ulong count); + +void pfs_inc_statement_select_scan_v1(PSI_statement_locker *locker, + ulong count); + +void pfs_inc_statement_sort_merge_passes_v1(PSI_statement_locker *locker, + ulong count); + +void pfs_inc_statement_sort_range_v1(PSI_statement_locker *locker, + ulong count); + +void pfs_inc_statement_sort_rows_v1(PSI_statement_locker *locker, + ulong count); + +void pfs_inc_statement_sort_scan_v1(PSI_statement_locker *locker, + ulong count); + +void pfs_set_statement_no_index_used_v1(PSI_statement_locker *locker); + +void pfs_set_statement_no_good_index_used_v1(PSI_statement_locker *locker); + +void pfs_end_statement_v1(PSI_statement_locker *locker, void *stmt_da); + +PSI_digest_locker *pfs_digest_start_v1(PSI_statement_locker *locker); + +void pfs_digest_end_v1(PSI_digest_locker *locker, + const sql_digest_storage *digest); + +C_MODE_END + +#endif /* MYSQL_DYNAMIC_PLUGIN */ +#endif /* EMBEDDED_LIBRARY */ +#endif /* MYSQL_SERVER */ +#endif /* HAVE_PSI_STATEMENT_INTERFACE */ + +#endif + diff --git a/include/pfs_table_provider.h b/include/pfs_table_provider.h new file mode 100644 index 00000000000..0d7ee76274b --- /dev/null +++ b/include/pfs_table_provider.h @@ -0,0 +1,83 @@ +/* Copyright (c) 2012, 2015, 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef PFS_TABLE_PROVIDER_H +#define PFS_TABLE_PROVIDER_H + +/** + @file include/pfs_table_provider.h + Performance schema instrumentation (declarations). +*/ + +#ifdef HAVE_PSI_TABLE_INTERFACE +#ifdef MYSQL_SERVER +#ifndef EMBEDDED_LIBRARY +#ifndef MYSQL_DYNAMIC_PLUGIN + +#include "mysql/psi/psi.h" + +#define PSI_TABLE_CALL(M) pfs_ ## M ## _v1 + +C_MODE_START + +PSI_table_share* +pfs_get_table_share_v1(my_bool temporary, struct TABLE_SHARE *share); + +void pfs_release_table_share_v1(PSI_table_share* share); + +void +pfs_drop_table_share_v1(my_bool temporary, + const char *schema_name, int schema_name_length, + const char *table_name, int table_name_length); + +PSI_table* +pfs_open_table_v1(PSI_table_share *share, const void *identity); + +void pfs_unbind_table_v1(PSI_table *table); + +PSI_table * +pfs_rebind_table_v1(PSI_table_share *share, const void *identity, PSI_table *table); + +void pfs_close_table_v1(struct TABLE_SHARE *server_share, PSI_table *table); + +PSI_table_locker* +pfs_start_table_io_wait_v1(PSI_table_locker_state *state, + PSI_table *table, + PSI_table_io_operation op, + uint index, + const char *src_file, uint src_line); + +PSI_table_locker* +pfs_start_table_lock_wait_v1(PSI_table_locker_state *state, + PSI_table *table, + PSI_table_lock_operation op, + ulong op_flags, + const char *src_file, uint src_line); + +void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows); + +void pfs_end_table_lock_wait_v1(PSI_table_locker* locker); + +void pfs_unlock_table_v1(PSI_table *table); + +C_MODE_END + +#endif /* MYSQL_DYNAMIC_PLUGIN */ +#endif /* EMBEDDED_LIBRARY */ +#endif /* MYSQL_SERVER */ +#endif /* HAVE_PSI_TABLE_INTERFACE */ + +#endif + diff --git a/include/pfs_thread_provider.h b/include/pfs_thread_provider.h new file mode 100644 index 00000000000..c4118a8efbf --- /dev/null +++ b/include/pfs_thread_provider.h @@ -0,0 +1,170 @@ +/* Copyright (c) 2012, 2015, 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef PFS_THREAD_PROVIDER_H +#define PFS_THREAD_PROVIDER_H + +/** + @file include/pfs_thread_provider.h + Performance schema instrumentation (declarations). +*/ + +#ifdef HAVE_PSI_THREAD_INTERFACE +#ifdef MYSQL_SERVER +#ifndef EMBEDDED_LIBRARY +#ifndef MYSQL_DYNAMIC_PLUGIN + +#include "mysql/psi/psi.h" + +#define PSI_MUTEX_CALL(M) pfs_ ## M ## _v1 +#define PSI_RWLOCK_CALL(M) pfs_ ## M ## _v1 +#define PSI_COND_CALL(M) pfs_ ## M ## _v1 +#define PSI_THREAD_CALL(M) pfs_ ## M ## _v1 + +C_MODE_START + +void pfs_register_mutex_v1(const char *category, + PSI_mutex_info_v1 *info, + int count); + +void pfs_register_rwlock_v1(const char *category, + PSI_rwlock_info_v1 *info, + int count); + +void pfs_register_cond_v1(const char *category, + PSI_cond_info_v1 *info, + int count); + +void pfs_register_thread_v1(const char *category, + PSI_thread_info_v1 *info, + int count); + +PSI_mutex* +pfs_init_mutex_v1(PSI_mutex_key key, const void *identity); + +void pfs_destroy_mutex_v1(PSI_mutex* mutex); + +PSI_rwlock* +pfs_init_rwlock_v1(PSI_rwlock_key key, const void *identity); + +void pfs_destroy_rwlock_v1(PSI_rwlock* rwlock); + +PSI_cond* +pfs_init_cond_v1(PSI_cond_key key, const void *identity); + +void pfs_destroy_cond_v1(PSI_cond* cond); + +int pfs_spawn_thread_v1(PSI_thread_key key, + pthread_t *thread, const pthread_attr_t *attr, + void *(*start_routine)(void*), void *arg); + +PSI_thread* +pfs_new_thread_v1(PSI_thread_key key, const void *identity, ulonglong processlist_id); + +void pfs_set_thread_id_v1(PSI_thread *thread, ulonglong processlist_id); +void pfs_set_thread_THD_v1(PSI_thread *thread, THD *thd); +void pfs_set_thread_os_id_v1(PSI_thread *thread); + +PSI_thread* +pfs_get_thread_v1(void); + +void pfs_set_thread_user_v1(const char *user, int user_len); + +void pfs_set_thread_account_v1(const char *user, int user_len, + const char *host, int host_len); + +void pfs_set_thread_db_v1(const char* db, int db_len); + +void pfs_set_thread_command_v1(int command); + +void pfs_set_thread_start_time_v1(time_t start_time); + +void pfs_set_thread_state_v1(const char* state); + +void pfs_set_connection_type_v1(opaque_vio_type conn_type); + +void pfs_set_thread_info_v1(const char* info, uint info_len); + +void pfs_set_thread_v1(PSI_thread* thread); + +void pfs_delete_current_thread_v1(void); + +void pfs_delete_thread_v1(PSI_thread *thread); + +PSI_mutex_locker* +pfs_start_mutex_wait_v1(PSI_mutex_locker_state *state, + PSI_mutex *mutex, PSI_mutex_operation op, + const char *src_file, uint src_line); + +PSI_rwlock_locker* +pfs_start_rwlock_rdwait_v1(PSI_rwlock_locker_state *state, + PSI_rwlock *rwlock, + PSI_rwlock_operation op, + const char *src_file, uint src_line); + +PSI_rwlock_locker* +pfs_start_rwlock_wrwait_v1(PSI_rwlock_locker_state *state, + PSI_rwlock *rwlock, + PSI_rwlock_operation op, + const char *src_file, uint src_line); + +PSI_cond_locker* +pfs_start_cond_wait_v1(PSI_cond_locker_state *state, + PSI_cond *cond, PSI_mutex *mutex, + PSI_cond_operation op, + const char *src_file, uint src_line); + +PSI_table_locker* +pfs_start_table_io_wait_v1(PSI_table_locker_state *state, + PSI_table *table, + PSI_table_io_operation op, + uint index, + const char *src_file, uint src_line); + +PSI_table_locker* +pfs_start_table_lock_wait_v1(PSI_table_locker_state *state, + PSI_table *table, + PSI_table_lock_operation op, + ulong op_flags, + const char *src_file, uint src_line); + +void pfs_unlock_mutex_v1(PSI_mutex *mutex); + +void pfs_unlock_rwlock_v1(PSI_rwlock *rwlock); + +void pfs_signal_cond_v1(PSI_cond* cond); + +void pfs_broadcast_cond_v1(PSI_cond* cond); + +void pfs_end_mutex_wait_v1(PSI_mutex_locker* locker, int rc); + +void pfs_end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc); + +void pfs_end_rwlock_wrwait_v1(PSI_rwlock_locker* locker, int rc); + +void pfs_end_cond_wait_v1(PSI_cond_locker* locker, int rc); + +int pfs_set_thread_connect_attrs_v1(const char *buffer, uint length, + const void *from_cs); + +C_MODE_END + +#endif /* EMBEDDED_LIBRARY */ +#endif /* MYSQL_DYNAMIC_PLUGIN */ +#endif /* MYSQL_SERVER */ +#endif /* HAVE_PSI_THREAD_INTERFACE */ + +#endif + diff --git a/include/pfs_transaction_provider.h b/include/pfs_transaction_provider.h new file mode 100644 index 00000000000..7cf5357c570 --- /dev/null +++ b/include/pfs_transaction_provider.h @@ -0,0 +1,79 @@ +/* Copyright (c) 2013, 2015, 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef PFS_TRANSACTION_PROVIDER_H +#define PFS_TRANSACTION_PROVIDER_H + +/** + @file include/pfs_transaction_provider.h + Performance schema instrumentation (declarations). +*/ + +#ifdef HAVE_PSI_TRANSACTION_INTERFACE +#ifdef MYSQL_SERVER +#ifndef EMBEDDED_LIBRARY +#ifndef MYSQL_DYNAMIC_PLUGIN + +#include "mysql/psi/psi.h" + +#define PSI_TRANSACTION_CALL(M) pfs_ ## M ## _v1 + +C_MODE_START + +PSI_transaction_locker* +pfs_get_thread_transaction_locker_v1(PSI_transaction_locker_state *state, + const void *xid, + const ulonglong *trxid, + int isolation_level, + my_bool read_only, + my_bool autocommit); + +void pfs_start_transaction_v1(PSI_transaction_locker *locker, + const char *src_file, uint src_line); + +void pfs_set_transaction_xid_v1(PSI_transaction_locker *locker, + const void *xid, + int xa_state); + +void pfs_set_transaction_xa_state_v1(PSI_transaction_locker *locker, + int xa_state); + +void pfs_set_transaction_gtid_v1(PSI_transaction_locker *locker, + const void *sid, + const void *gtid_spec); + +void pfs_set_transaction_trxid_v1(PSI_transaction_locker *locker, + const ulonglong *trxid); + +void pfs_inc_transaction_savepoints_v1(PSI_transaction_locker *locker, + ulong count); + +void pfs_inc_transaction_rollback_to_savepoint_v1(PSI_transaction_locker *locker, + ulong count); + +void pfs_inc_transaction_release_savepoint_v1(PSI_transaction_locker *locker, + ulong count); + +void pfs_end_transaction_v1(PSI_transaction_locker *locker, my_bool commit); + +C_MODE_END + +#endif /* MYSQL_DYNAMIC_PLUGIN */ +#endif /* EMBEDDED_LIBRARY */ +#endif /* MYSQL_SERVER */ +#endif /* HAVE_PSI_TRANSACTION_INTERFACE */ + +#endif + diff --git a/mysql-test/suite/perfschema/include/binlog_edge_common.inc b/mysql-test/suite/perfschema/include/binlog_edge_common.inc index 8092c9a5427..6ecd50afe08 100644 --- a/mysql-test/suite/perfschema/include/binlog_edge_common.inc +++ b/mysql-test/suite/perfschema/include/binlog_edge_common.inc @@ -148,7 +148,7 @@ drop table if exists marker_multi_delete; use my_replicated_db; insert into performance_schema.setup_actors - values ('FOO', 'FOO', 'FOO'); + values ('FOO', 'FOO', 'FOO', 'YES', 'YES'); --error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES delete my_tx_table.*, performance_schema.setup_actors.* @@ -157,7 +157,7 @@ delete my_tx_table.*, performance_schema.setup_actors.* or performance_schema.setup_actors.role='FOO'; insert into performance_schema.setup_actors - values ('BAR', 'BAR', 'BAR'); + values ('BAR', 'BAR', 'BAR', 'YES', 'YES'); --error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES delete my_non_tx_table.*, performance_schema.setup_actors.* @@ -166,7 +166,7 @@ delete my_non_tx_table.*, performance_schema.setup_actors.* or performance_schema.setup_actors.role='BAR'; insert into performance_schema.setup_actors - values ('BAZ', 'BAZ', 'BAZ'); + values ('BAZ', 'BAZ', 'BAZ', 'YES', 'YES'); --error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES delete my_bh_table.*, performance_schema.setup_actors.* @@ -184,5 +184,5 @@ drop database my_replicated_db; # Restore performance_schema.setup_actors, damaged by this script truncate table performance_schema.setup_actors; -insert into performance_schema.setup_actors values ('%', '%', '%'); +insert into performance_schema.setup_actors values ('%', '%', '%', 'YES', 'YES'); diff --git a/mysql-test/suite/perfschema/include/event_aggregate_cleanup.inc b/mysql-test/suite/perfschema/include/event_aggregate_cleanup.inc index c50394f748b..2cb8a69e4d6 100644 --- a/mysql-test/suite/perfschema/include/event_aggregate_cleanup.inc +++ b/mysql-test/suite/perfschema/include/event_aggregate_cleanup.inc @@ -36,6 +36,12 @@ drop prepare dump_statements_host; drop prepare dump_statements_history; drop prepare dump_statements_global; +drop prepare dump_transactions_account; +drop prepare dump_transactions_user; +drop prepare dump_transactions_host; +drop prepare dump_transactions_history; +drop prepare dump_transactions_global; + drop prepare dump_users; drop prepare dump_hosts; drop prepare dump_accounts; @@ -49,6 +55,7 @@ insert into performance_schema.setup_actors select * from test.setup_actors; drop table test.setup_actors; drop table test.t1; +drop function test.f; update performance_schema.threads set instrumented='YES'; update performance_schema.setup_instruments set enabled='YES', timed='YES'; diff --git a/mysql-test/suite/perfschema/include/event_aggregate_load.inc b/mysql-test/suite/perfschema/include/event_aggregate_load.inc index 6e632b98c62..b27a3113318 100644 --- a/mysql-test/suite/perfschema/include/event_aggregate_load.inc +++ b/mysql-test/suite/perfschema/include/event_aggregate_load.inc @@ -21,6 +21,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -30,7 +35,7 @@ execute dump_hosts; # 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 +# Each uuid_short() causes 1 wait/synch/mutex/sql/LOCK_uuid_generator # # To avoid noise from main, the background threads are disabled. @@ -61,15 +66,23 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; --connection con1 -select get_lock("marker", 10); -select release_lock("marker"); +select uuid_short() <> 1; +select uuid_short() <> 1; +start transaction; insert into test.t1 values ("marker"); +commit; +select test.f(10,20); --connection default @@ -96,6 +109,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -131,15 +149,23 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; --connection con2 -select get_lock("marker", 10); -select release_lock("marker"); +select uuid_short() <> 1; +select uuid_short() <> 1; +start transaction; insert into test.t1 values ("marker"); +commit; +select test.f(10,20); --connection default @@ -166,6 +192,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -197,15 +228,23 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; --connection con3 -select get_lock("marker", 10); -select release_lock("marker"); +select uuid_short() <> 1; +select uuid_short() <> 1; +start transaction; insert into test.t1 values ("marker"); +commit; +select test.f(10,20); --connection default @@ -232,6 +271,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -263,15 +307,23 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; --connection con4 -select get_lock("marker", 10); -select release_lock("marker"); +select uuid_short() <> 1; +select uuid_short() <> 1; +start transaction; insert into test.t1 values ("marker"); +commit; +select test.f(10,20); --connection default @@ -298,6 +350,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -329,6 +386,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -360,6 +422,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -391,6 +458,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -422,6 +494,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -449,6 +526,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -474,6 +556,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -499,6 +586,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -524,6 +616,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -549,6 +646,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -574,6 +676,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -599,6 +706,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -624,6 +736,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -649,6 +766,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -674,6 +796,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -699,6 +826,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -724,6 +856,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -749,6 +886,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -774,6 +916,11 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; @@ -799,13 +946,18 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; -truncate performance_schema.accounts; +truncate performance_schema.events_transactions_summary_by_thread_by_event_name; -echo "================== ACCOUNTS truncated =================="; +echo "================== TRANSACTIONS_BY_THREAD truncated =================="; echo "================== Step 29 =================="; call dump_thread(); @@ -824,13 +976,18 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; -truncate performance_schema.users; +truncate performance_schema.events_transactions_summary_by_account_by_event_name; -echo "================== USERS truncated =================="; +echo "================== TRANSACTIONS_BY_ACCOUNT truncated =================="; echo "================== Step 30 =================="; call dump_thread(); @@ -849,13 +1006,18 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; -truncate performance_schema.hosts; +truncate performance_schema.events_transactions_summary_by_user_by_event_name; -echo "================== HOSTS truncated =================="; +echo "================== TRANSACTIONS_BY_USER truncated =================="; echo "================== Step 31 =================="; call dump_thread(); @@ -874,6 +1036,161 @@ execute dump_statements_user; execute dump_statements_host; execute dump_statements_global; execute dump_statements_history; +execute dump_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate performance_schema.events_transactions_summary_by_host_by_event_name; + +echo "================== TRANSACTIONS_BY_HOST truncated =================="; + +echo "================== Step 32 =================="; +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_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate performance_schema.events_transactions_summary_global_by_event_name; + +echo "================== TRANSACTIONS_GLOBAL truncated =================="; + +echo "================== Step 33 =================="; +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_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate performance_schema.accounts; + +echo "================== ACCOUNTS truncated =================="; + +echo "================== Step 34 =================="; +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_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate performance_schema.users; + +echo "================== USERS truncated =================="; + +echo "================== Step 35 =================="; +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_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate performance_schema.hosts; + +echo "================== HOSTS truncated =================="; + +echo "================== Step 36 =================="; +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_transactions_account; +execute dump_transactions_user; +execute dump_transactions_host; +execute dump_transactions_global; +execute dump_transactions_history; execute dump_accounts; execute dump_users; execute dump_hosts; diff --git a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc index 59431e31682..03f88e97eef 100644 --- a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc +++ b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc @@ -19,11 +19,16 @@ # - events_statements_summary_by_account_by_event_name # - events_statements_summary_by_user_by_event_name # - events_statements_summary_by_host_by_event_name +# - events_transactions_summary_by_thread_by_event_name +# - events_transactions_summary_by_account_by_event_name +# - events_transactions_summary_by_user_by_event_name +# - events_transactions_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 +# - events_transactions_summary_global_by_event_name # # The tests are written with the following helpers: # - include/event_aggregate_setup.inc @@ -90,6 +95,8 @@ drop table if exists test.t1; --enable_warnings create table test.t1(a varchar(64)); +create function test.f(a int, b int) returns int +return a+b; create table test.setup_actors as select * from performance_schema.setup_actors; @@ -111,14 +118,16 @@ update performance_schema.threads set instrumented='NO'; 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_user_locks', + where name in ('wait/synch/mutex/sql/LOCK_connection_count', + 'wait/synch/mutex/sql/LOCK_uuid_generator', 'wait/synch/rwlock/sql/LOCK_grant', 'wait/io/file/sql/query_log', 'idle'); update performance_schema.setup_instruments set enabled='YES', timed='YES' - where name in ('stage/sql/Init', 'stage/sql/Init for update', - 'stage/sql/Checking permissions', + where name in ('stage/sql/starting', + 'stage/sql/init', + 'stage/sql/checking permissions', 'stage/sql/Opening tables', 'stage/sql/Closing tables'); @@ -128,7 +137,11 @@ update performance_schema.setup_instruments set enabled='YES', timed='YES' 'statement/abstract/new_packet', 'statement/abstract/Query', 'statement/com/Quit', - 'statement/com/error'); + 'statement/com/error', + 'statement/sp/freturn'); + +update performance_schema.setup_instruments set enabled='YES', timed='YES' + where name in ('transaction'); # Start from a known clean state, to avoid noise from previous tests flush tables; @@ -154,6 +167,13 @@ 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; +truncate performance_schema.events_transactions_summary_by_thread_by_event_name; +truncate performance_schema.events_transactions_summary_by_account_by_event_name; +truncate performance_schema.events_transactions_summary_by_user_by_event_name; +truncate performance_schema.events_transactions_summary_by_host_by_event_name; +truncate performance_schema.events_transactions_summary_global_by_event_name; +truncate performance_schema.events_transactions_history_long; + --disable_warnings drop procedure if exists dump_thread; drop procedure if exists dump_one_thread; @@ -180,7 +200,8 @@ begin 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_user_locks', + where event_name in ('wait/synch/mutex/sql/LOCK_connection_count', + 'wait/synch/mutex/sql/LOCK_uuid_generator', 'wait/synch/rwlock/sql/LOCK_grant', 'wait/io/file/sql/query_log') and thread_id = my_thread_id @@ -197,7 +218,8 @@ 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_user_locks', + and event_name in ('wait/synch/mutex/sql/LOCK_connection_count', + 'wait/synch/mutex/sql/LOCK_uuid_generator', 'wait/synch/rwlock/sql/LOCK_grant', 'wait/io/file/sql/query_log') order by user, host, event_name;"; @@ -206,7 +228,8 @@ 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_user_locks', + and event_name in ('wait/synch/mutex/sql/LOCK_connection_count', + 'wait/synch/mutex/sql/LOCK_uuid_generator', 'wait/synch/rwlock/sql/LOCK_grant', 'wait/io/file/sql/query_log') order by user, event_name;"; @@ -215,7 +238,8 @@ 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_user_locks', + and event_name in ('wait/synch/mutex/sql/LOCK_connection_count', + 'wait/synch/mutex/sql/LOCK_uuid_generator', 'wait/synch/rwlock/sql/LOCK_grant', 'wait/io/file/sql/query_log') order by host, event_name;"; @@ -223,7 +247,8 @@ prepare dump_waits_host from 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_user_locks', + where event_name in ('wait/synch/mutex/sql/LOCK_connection_count', + 'wait/synch/mutex/sql/LOCK_uuid_generator', 'wait/synch/rwlock/sql/LOCK_grant', 'wait/io/file/sql/query_log') order by event_name;"; @@ -231,7 +256,8 @@ prepare dump_waits_global from 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_user_locks', + where event_name in ('wait/synch/mutex/sql/LOCK_connection_count', + 'wait/synch/mutex/sql/LOCK_uuid_generator', 'wait/synch/rwlock/sql/LOCK_grant', 'wait/io/file/sql/query_log') group by event_name order by event_name;"; @@ -240,7 +266,8 @@ 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/Init for update', + and event_name in ('stage/sql/starting', + 'stage/sql/init', 'stage/sql/checking permissions', 'stage/sql/Opening tables', 'stage/sql/closing tables') @@ -250,7 +277,8 @@ 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/Init for update', + and event_name in ('stage/sql/starting', + 'stage/sql/init', 'stage/sql/checking permissions', 'stage/sql/Opening tables', 'stage/sql/closing tables') @@ -260,7 +288,8 @@ 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/Init for update', + and event_name in ('stage/sql/starting', + 'stage/sql/init', 'stage/sql/checking permissions', 'stage/sql/Opening tables', 'stage/sql/closing tables') @@ -269,7 +298,8 @@ prepare dump_stages_host from 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/Init for update', + where event_name in ('stage/sql/starting', + 'stage/sql/init', 'stage/sql/checking permissions', 'stage/sql/Opening tables', 'stage/sql/closing tables') @@ -278,7 +308,8 @@ prepare dump_stages_global from 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/Init for update', + where event_name in ('stage/sql/starting', + 'stage/sql/init', 'stage/sql/checking permissions', 'stage/sql/Opening tables', 'stage/sql/closing tables') @@ -291,7 +322,8 @@ prepare dump_statements_account from and event_name in ('statement/sql/select', 'statement/sql/insert', 'statement/com/Quit', - 'statement/com/error') + 'statement/com/error', + 'statement/sp/freturn') order by user, host, event_name;"; prepare dump_statements_user from @@ -301,7 +333,8 @@ prepare dump_statements_user from and event_name in ('statement/sql/select', 'statement/sql/insert', 'statement/com/Quit', - 'statement/com/error') + 'statement/com/error', + 'statement/sp/freturn') order by user, event_name;"; prepare dump_statements_host from @@ -311,7 +344,8 @@ prepare dump_statements_host from and event_name in ('statement/sql/select', 'statement/sql/insert', 'statement/com/Quit', - 'statement/com/error') + 'statement/com/error', + 'statement/sp/freturn') order by host, event_name;"; prepare dump_statements_global from @@ -320,7 +354,8 @@ prepare dump_statements_global from where event_name in ('statement/sql/select', 'statement/sql/insert', 'statement/com/Quit', - 'statement/com/error') + 'statement/com/error', + 'statement/sp/freturn') order by event_name;"; prepare dump_statements_history from @@ -329,7 +364,41 @@ prepare dump_statements_history from where event_name in ('statement/sql/select', 'statement/sql/insert', 'statement/com/Quit', - 'statement/com/error') + 'statement/com/error', + 'statement/sp/freturn') + group by event_name order by event_name;"; + +prepare dump_transactions_account from + "select user, host, event_name, count_star + from performance_schema.events_transactions_summary_by_account_by_event_name + where user like \'user%\' + and event_name in ('transaction') + order by user, host, event_name;"; + +prepare dump_transactions_user from + "select user, event_name, count_star + from performance_schema.events_transactions_summary_by_user_by_event_name + where user like \'user%\' + and event_name in ('transaction') + order by user, event_name;"; + +prepare dump_transactions_host from + "select host, event_name, count_star + from performance_schema.events_transactions_summary_by_host_by_event_name + where host=\'localhost\' + and event_name in ('transaction') + order by host, event_name;"; + +prepare dump_transactions_global from + "select event_name, count_star + from performance_schema.events_transactions_summary_global_by_event_name + where event_name in ('transaction') + order by event_name;"; + +prepare dump_transactions_history from + "select event_name, count(event_name) + from performance_schema.events_transactions_history_long + where event_name in ('transaction') group by event_name order by event_name;"; prepare dump_users from diff --git a/mysql-test/suite/perfschema/include/memory_aggregate_cleanup.inc b/mysql-test/suite/perfschema/include/memory_aggregate_cleanup.inc new file mode 100644 index 00000000000..1e2cfa99e5c --- /dev/null +++ b/mysql-test/suite/perfschema/include/memory_aggregate_cleanup.inc @@ -0,0 +1,45 @@ +# Tests for the performance schema + +# =========================================== +# HELPER include/memory_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_memory_account; +drop prepare dump_memory_user; +drop prepare dump_memory_host; +drop prepare dump_memory_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; + +set global query_cache_size=0; + +update performance_schema.threads set instrumented='YES'; +update performance_schema.setup_instruments set enabled='YES', timed='YES'; + +--enable_query_log + diff --git a/mysql-test/suite/perfschema/include/memory_aggregate_load.inc b/mysql-test/suite/perfschema/include/memory_aggregate_load.inc new file mode 100644 index 00000000000..7a54d25216e --- /dev/null +++ b/mysql-test/suite/perfschema/include/memory_aggregate_load.inc @@ -0,0 +1,506 @@ +# Tests for the performance schema + +# ======================================== +# HELPER include/memory_aggregate_load.inc +# ======================================== + +echo "================== Step 1 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +# Notes about this test +# +# get_lock("marker") causes the following memory allocation: +# memory/sql/User_level_lock, 1 malloc, size 16 (size 8 for 32-bit systems). +# release_lock("marker") causes the following memory free: +# memory/sql/User_level_lock, 1 free, size 16 (size 8 for 32-bit systems). +# +# 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 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +--connection con1 + +set GLOBAL query_cache_size=1000*1024; +select get_lock("marker_1", 10); +select release_lock("marker_1"); +set @v1 = repeat("a", 1000); +set @v2 = repeat("b", 2000); +set @v3 = repeat("c", 4000); + +echo "================== con1 marker =================="; + +--connection default + +# Wait for the payload to complete +let $wait_condition= + select count(*) = 1 from performance_schema.events_waits_current + where EVENT_NAME= 'idle'; +--source include/wait_condition.inc + +echo "================== Step 3 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +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 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +--connection con2 + +set GLOBAL query_cache_size=2000*1024; +select get_lock("marker_2", 10); +select release_lock("marker_2"); +set @v1 = repeat("a", 1000); +set @v2 = repeat("b", 2000); +set @v3 = repeat("c", 4000); + +echo "================== con2 marker =================="; + +--connection default + +# Wait for the payload to complete +let $wait_condition= + select count(*) = 2 from performance_schema.events_waits_current + where EVENT_NAME= 'idle'; +--source include/wait_condition.inc + +echo "================== Step 5 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate table performance_schema.memory_summary_by_thread_by_event_name; + +echo "================== MEMORY_BY_THREAD truncated =================="; + +echo "================== Step 5b =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +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 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +--connection con3 + +set GLOBAL query_cache_size=500*1024; +select get_lock("marker_3", 10); +select release_lock("marker_3"); +set @v1 = repeat("a", 1000); +set @v2 = repeat("b", 2000); +set @v3 = repeat("c", 4000); + +echo "================== con3 marker =================="; + +--connection default + +# Wait for the payload to complete +let $wait_condition= + select count(*) = 3 from performance_schema.events_waits_current + where EVENT_NAME= 'idle'; +--source include/wait_condition.inc + +echo "================== Step 7 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +connect (con4, localhost, user4, , ); +connect (con5, localhost, user4, , ); + +echo "================== con4/con5 (both user4) connected =================="; + +--connection default + +# Wait for the connects to complete +let $wait_condition= + select count(*) = 2 from performance_schema.threads + where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user4'; +--source include/wait_condition.inc + +echo "================== Step 8 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +--connection con4 + +set GLOBAL query_cache_size=4000*1024; +select get_lock("marker_4", 10); +select release_lock("marker_4"); +set @v1 = repeat("a", 1000); +set @v2 = repeat("b", 2000); +set @v3 = repeat("c", 4000); + +--connection con5 +select get_lock("marker_5", 10); +select release_lock("marker_5"); +set @v1 = repeat("a", 1000); +set @v2 = repeat("b", 2000); +set @v3 = repeat("c", 4000); + +echo "================== con4/con5 marker =================="; + +--connection default + +# Wait for the payload to complete +let $wait_condition= + select count(*) = 5 from performance_schema.events_waits_current + where EVENT_NAME= 'idle'; +--source include/wait_condition.inc + +echo "================== Step 9 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +--disconnect con1 +--disconnect con5 + +--connection default + +# Wait for the disconnects to complete +let $wait_condition= + select count(*) = 0 from performance_schema.threads + where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user1'; +--source include/wait_condition.inc +let $wait_condition= + select count(*) = 1 from performance_schema.threads + where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user4'; +--source include/wait_condition.inc + +echo "================== con1/con5 disconnected =================="; + +echo "================== Step 10 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +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 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +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 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +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 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +--connection default + +truncate performance_schema.memory_summary_by_thread_by_event_name; + +echo "================== MEMORY_BY_THREAD truncated =================="; + +echo "================== Step 14 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate performance_schema.memory_summary_by_account_by_event_name; + +echo "================== MEMORY_BY_ACCOUNT truncated =================="; + +echo "================== Step 15 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate performance_schema.memory_summary_by_user_by_event_name; + +echo "================== MEMORY_BY_USER truncated =================="; + +echo "================== Step 16 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate performance_schema.memory_summary_by_host_by_event_name; + +echo "================== MEMORY_BY_HOST truncated =================="; + +echo "================== Step 17 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate performance_schema.memory_summary_global_by_event_name; + +echo "================== MEMORY_GLOBAL truncated =================="; + +echo "================== Step 18 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate performance_schema.accounts; + +echo "================== ACCOUNTS truncated =================="; + +echo "================== Step 19 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate performance_schema.users; + +echo "================== USERS truncated =================="; + +echo "================== Step 20 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + +truncate performance_schema.hosts; + +echo "================== HOSTS truncated =================="; + +echo "================== Step 21 =================="; +--vertical_results +call dump_thread(); +execute dump_memory_account; +execute dump_memory_user; +execute dump_memory_host; +execute dump_memory_global; +--horizontal_results +execute dump_accounts; +execute dump_users; +execute dump_hosts; + diff --git a/mysql-test/suite/perfschema/include/memory_aggregate_setup.inc b/mysql-test/suite/perfschema/include/memory_aggregate_setup.inc new file mode 100644 index 00000000000..6dbccaee9a0 --- /dev/null +++ b/mysql-test/suite/perfschema/include/memory_aggregate_setup.inc @@ -0,0 +1,207 @@ +# Tests for the performance schema + +# ============= +# DOCUMENTATION +# ============= + +# Verify how memory stats are aggregated into various tables +# +# In the thread dimension: +# - memory_summary_by_thread_by_event_name +# - memory_summary_by_account_by_event_name +# - memory_summary_by_user_by_event_name +# - memory_summary_by_host_by_event_name +# +# Globally: +# - memory_summary_global_by_event_name +# +# The tests are written with the following helpers: +# - include/memory_aggregate_setup.inc +# - include/memory_aggregate_load.inc +# - include/memory_aggregate_cleanup.inc +# +# Helpers are intended to be used as follows. +# +# A Typical test t/memory_aggregate_xxx.test will consist of: +# --source ../include/memory_aggregate_setup.inc +# --source ../include/memory_aggregate_load.inc +# --source ../include/memory_aggregate_cleanup.inc +# and a t/memory_aggregate_xxx-master.opt file +# +# Naming conventions for t/memory_aggregate_xxx.test are as follows: +# t/memory_aggregate_ +# +# 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 +# +# 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 +# +# 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/memory_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 + +set @orig_sql_mode= @@sql_mode; +set sql_mode= (select replace(@@sql_mode,'NO_AUTO_CREATE_USER','')); +grant ALL on *.* to user1@localhost; +grant ALL on *.* to user2@localhost; +grant ALL on *.* to user3@localhost; +grant ALL on *.* to user4@localhost; +set sql_mode= @orig_sql_mode; + +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; +--enable_warnings + +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 ('memory/sql/user_var_entry::value', + 'memory/sql/User_level_lock', + 'memory/sql/Query_cache', + 'idle'); + +# Start from a known clean state, to avoid noise from previous tests +flush tables; +flush status; +truncate performance_schema.memory_summary_by_thread_by_event_name; +truncate performance_schema.memory_summary_by_account_by_event_name; +truncate performance_schema.memory_summary_by_user_by_event_name; +truncate performance_schema.memory_summary_by_host_by_event_name; +truncate performance_schema.memory_summary_global_by_event_name; + +--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 LIMIT 1); + + if (my_thread_id is not null) then + select username, + EVENT_NAME, COUNT_ALLOC, COUNT_FREE, + SUM_NUMBER_OF_BYTES_ALLOC, SUM_NUMBER_OF_BYTES_FREE, + LOW_COUNT_USED, CURRENT_COUNT_USED, HIGH_COUNT_USED, + LOW_NUMBER_OF_BYTES_USED, CURRENT_NUMBER_OF_BYTES_USED, HIGH_NUMBER_OF_BYTES_USED + from performance_schema.memory_summary_by_thread_by_event_name + where event_name in ('memory/sql/user_var_entry::value', + 'memory/sql/User_level_lock', + 'memory/sql/Query_cache') + and thread_id = my_thread_id + order by event_name; + else + select username, "not found" as status; + end if; +end +$$ + +delimiter ;$$ + +prepare dump_memory_account from + "select * + from performance_schema.memory_summary_by_account_by_event_name + where user like \'user%\' + and event_name in ('memory/sql/user_var_entry::value', + 'memory/sql/User_level_lock', + 'memory/sql/Query_cache') + order by user, host, event_name;"; + +prepare dump_memory_user from + "select * + from performance_schema.memory_summary_by_user_by_event_name + where user like \'user%\' + and event_name in ('memory/sql/user_var_entry::value', + 'memory/sql/User_level_lock', + 'memory/sql/Query_cache') + order by user, event_name;"; + +prepare dump_memory_host from + "select * + from performance_schema.memory_summary_by_host_by_event_name + where host=\'localhost\' + and event_name in ('memory/sql/user_var_entry::value', + 'memory/sql/User_level_lock', + 'memory/sql/Query_cache') + order by host, event_name;"; + +prepare dump_memory_global from + "select * + from performance_schema.memory_summary_global_by_event_name + where event_name in ('memory/sql/user_var_entry::value', + 'memory/sql/User_level_lock', + 'memory/sql/Query_cache') + 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 + +# Make sure all the instrumentation is present +show global status like "performance_schema_memory_classes_lost"; + + diff --git a/mysql-test/suite/perfschema/include/prepared_stmts_deallocation.inc b/mysql-test/suite/perfschema/include/prepared_stmts_deallocation.inc new file mode 100644 index 00000000000..1601c027984 --- /dev/null +++ b/mysql-test/suite/perfschema/include/prepared_stmts_deallocation.inc @@ -0,0 +1,11 @@ +# +# Deallocates all the prepared statements +# created in prepares_stmts_setup.inc +# + +DEALLOCATE PREPARE st1; +DEALLOCATE PREPARE st2; +DEALLOCATE PREPARE st3; +DEALLOCATE PREPARE st4; + +DROP TABLE t1; diff --git a/mysql-test/suite/perfschema/include/prepared_stmts_execution.inc b/mysql-test/suite/perfschema/include/prepared_stmts_execution.inc new file mode 100644 index 00000000000..dbb0696f67c --- /dev/null +++ b/mysql-test/suite/perfschema/include/prepared_stmts_execution.inc @@ -0,0 +1,18 @@ +# +# Execution of all the prepared statements created in +# prepared_statements_setup.inc. +# + +SET @a = 3; +SET @b = 4; +EXECUTE st1 USING @a, @b; + +#SET @table = 't1'; +EXECUTE st2; + +SET @c=3; +EXECUTE st3 using @c; + +EXECUTE st4; + + diff --git a/mysql-test/suite/perfschema/include/prepared_stmts_setup.inc b/mysql-test/suite/perfschema/include/prepared_stmts_setup.inc new file mode 100644 index 00000000000..0fb14a36698 --- /dev/null +++ b/mysql-test/suite/perfschema/include/prepared_stmts_setup.inc @@ -0,0 +1,20 @@ +# +# Creating various prepared statements. +# HELPER include/prepared_stmts_setup.inc +# + +CREATE TABLE t1 (a INT NOT NULL); +INSERT INTO t1 VALUES (4), (8), (11), (32), (80); + +# Prepared statments + +PREPARE st1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse'; + +SET @table = 't1'; +SET @s = CONCAT('SELECT * FROM ', @table); +PREPARE st2 FROM @s; + +PREPARE st3 FROM 'INSERT INTO t1 SELECT * FROM t1 WHERE a<=?'; + +PREPARE st4 FROM + '(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a'; diff --git a/mysql-test/suite/perfschema/include/program_cleanup.inc b/mysql-test/suite/perfschema/include/program_cleanup.inc new file mode 100644 index 00000000000..ffcedccd937 --- /dev/null +++ b/mysql-test/suite/perfschema/include/program_cleanup.inc @@ -0,0 +1,31 @@ +# +# clean up of set-up created in +# suite/perfschema/include/program_setup.inc +# + +--disable_warnings +DROP PROCEDURE SampleProc1; +DROP PROCEDURE SampleProc2; +DROP PROCEDURE SampleProc3; +DROP PROCEDURE SampleProc4; + +DROP FUNCTION wt_avg; +DROP FUNCTION fac; +DROP FUNCTION append; + +DROP TRIGGER trg1; +DROP TRIGGER trg2; +DROP TRIGGER trg3; +DROP TRIGGER trg4; +DROP TRIGGER trg5; + +DROP EVENT IF EXISTS e1; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +DROP TABLE table_t; + +DROP DATABASE stored_programs; +--enable_warnings diff --git a/mysql-test/suite/perfschema/include/program_execution.inc b/mysql-test/suite/perfschema/include/program_execution.inc new file mode 100644 index 00000000000..8c0bc691898 --- /dev/null +++ b/mysql-test/suite/perfschema/include/program_execution.inc @@ -0,0 +1,54 @@ +# +# Execute the stored programs created in +# suite/perfschema/include/program_setup.inc +# + +--echo ##################### +--echo # Executing queries # +--echo ##################### +INSERT INTO t1 VALUES (10,20); +CALL SampleProc1(30,40,50); +SET @a=1; +SELECT @a; +CALL SampleProc2("Jwalamukhi",34); +SELECT @a; +CALL SampleProc3(); +CALL SampleProc4(); +SET @change=1; +SELECT @change; +UPDATE t2 SET id=22 WHERE name="Jwalamukhi"; +SELECT @change; +SET @del=1; +SELECT @del; +DELETE FROM t1 WHERE i=76; +SELECT @del; +SELECT wt_avg(1, 12, 1990, 1121990); +SELECT fac(5); +SELECT append("Bolly", "wood"); + +--echo # Event + +SET GLOBAL event_scheduler=ON; + +CREATE TABLE table_t(a INT); +DELIMITER |; +CREATE EVENT e1 ON SCHEDULE EVERY 2 SECOND DO +BEGIN + INSERT INTO table_t VALUES(1); +END| +DELIMITER ;| + +# Let e1 insert 1 record into the table table_t + +--let $wait_condition= select count(*) = 1 from table_t +--source include/wait_condition.inc +SELECT * FROM table_t; + +# Wait till the above one execution of event is instrumented. + +--let $wait_condition= select count(*) = 1 from performance_schema.events_statements_history_long where object_type='EVENT' +--source include/wait_condition.inc + +SET GLOBAL event_scheduler=OFF; +--source include/no_running_event_scheduler.inc + diff --git a/mysql-test/suite/perfschema/include/program_nested_cleanup.inc b/mysql-test/suite/perfschema/include/program_nested_cleanup.inc new file mode 100644 index 00000000000..0f5b26f3d1b --- /dev/null +++ b/mysql-test/suite/perfschema/include/program_nested_cleanup.inc @@ -0,0 +1,21 @@ +# +# clean up if set-up created in +# suite/perfschema/include/program_nested_setup.inc +# + +DROP PROCEDURE c4; +DROP PROCEDURE c3; +DROP PROCEDURE c2; +DROP PROCEDURE c1; +DROP PROCEDURE inc; +DROP PROCEDURE inc2; +DROP PROCEDURE iotest; +DROP FUNCTION mul; +DROP FUNCTION inc; +DROP FUNCTION fac; +DROP FUNCTION fun; +DROP PROCEDURE ifac; +DROP TRIGGER trg; +DROP TABLE t1,t2; + +DROP DATABASE nested_sp; diff --git a/mysql-test/suite/perfschema/include/program_nested_execution.inc b/mysql-test/suite/perfschema/include/program_nested_execution.inc new file mode 100644 index 00000000000..dbf0eafe123 --- /dev/null +++ b/mysql-test/suite/perfschema/include/program_nested_execution.inc @@ -0,0 +1,22 @@ +# +# Execute the nested stored programs created in +# suite/include/perfschema/program_nested_setup.inc +# + +--echo ##################### +--echo # Executing queries # +--echo ##################### + +CALL c1(42); +SELECT * FROM t1; +DELETE FROM t1; + +CALL iotest("io1", "io2", 1); +SELECT * FROM t1 ORDER BY data DESC; +DELETE FROM t1; + +SELECT fun(6,10); + +INSERT INTO t1 VALUES (20,13); + +SELECT * FROM t2; diff --git a/mysql-test/suite/perfschema/include/program_nested_setup.inc b/mysql-test/suite/perfschema/include/program_nested_setup.inc new file mode 100644 index 00000000000..bbf885988dd --- /dev/null +++ b/mysql-test/suite/perfschema/include/program_nested_setup.inc @@ -0,0 +1,87 @@ +# +# SET-UP - Creation of various nested stored programs +# + +--source include/no_protocol.inc + +--echo # SET-UP +CREATE DATABASE nested_sp; +USE nested_sp; + +CREATE TABLE t1( + id CHAR(16) NOT NULL DEFAULT '', + data INT NOT NULL +); + +CREATE TABLE t2( + n INT UNSIGNED NOT NULL, + f BIGINT UNSIGNED +); + +--echo ############################ +--echo # Creating Stored Programs # +--echo ############################ +DELIMITER |; + +# Nested Stored Procedure - 1 +CREATE PROCEDURE c1(x INT) + CALL c2("c", x)| +CREATE PROCEDURE c2(s CHAR(16), x INT) + CALL c3(x, s)| +CREATE PROCEDURE c3(x INT, s CHAR(16)) + CALL c4("level", x, s)| +CREATE PROCEDURE c4(l CHAR(8), x INT, s CHAR(16)) + INSERT INTO t1 VALUES (concat(l,s), x)| + +# Nested Stored Procedure - 2 +CREATE PROCEDURE iotest(x1 CHAR(16), x2 CHAR(16), y INT) +BEGIN + CALL inc2(x2, y); + INSERT INTO t1 VALUES (x1, y); +END| +CREATE PROCEDURE inc2(x CHAR(16), y INT) +BEGIN + CALL inc(y); + INSERT INTO t1 VALUES (x, y); +END| +CREATE PROCEDURE inc(inout io INT) + SET io = io + 1| + +# Nested Stored Function +CREATE FUNCTION mul(x INT, y INT) RETURNS INT + RETURN x*y| +CREATE FUNCTION inc(i INT) RETURNS INT + RETURN i+1| +CREATE FUNCTION fac(n INT UNSIGNED) RETURNS BIGINT UNSIGNED +BEGIN + DECLARE f BIGINT UNSIGNED DEFAULT 1; + WHILE n > 1 DO + SET f = f * n; + SET n = n - 1; + END WHILE; + RETURN f; +END| +CREATE FUNCTION fun(i INT, u INT UNSIGNED) RETURNS DOUBLE + RETURN mul(inc(i), fac(u))| +# +# A nested stored program +# +CREATE PROCEDURE ifac(n INT UNSIGNED) +BEGIN + DECLARE i BIGINT UNSIGNED DEFAULT 1; + + IF n > 20 THEN + SET n = 20; # bigint overflow otherwise + END IF; + WHILE i <= n DO + BEGIN + INSERT INTO t2 VALUES (i, fac(i)); + SET i = i + 1; + END; + END WHILE; +END| +CREATE TRIGGER trg AFTER INSERT ON t1 FOR EACH ROW + CALL ifac(10)| + +DELIMITER ;| + diff --git a/mysql-test/suite/perfschema/include/program_setup.inc b/mysql-test/suite/perfschema/include/program_setup.inc new file mode 100644 index 00000000000..0d7f1ef3058 --- /dev/null +++ b/mysql-test/suite/perfschema/include/program_setup.inc @@ -0,0 +1,135 @@ +# +# SET-UP - Creation of various non-nested stored programs +# + +--source include/no_protocol.inc + +--echo # SET-UP + +CREATE DATABASE stored_programs; +USE stored_programs; + +CREATE TABLE t1( + i INT NOT NULL, + j INT +); + +CREATE TABLE t2( + name CHAR(16) NOT NULL DEFAULT '', + id INT NOT NULL +); + +CREATE TABLE t3( + d DATE, + n INT, + f DOUBLE, + s VARCHAR(32) +); + +CREATE TABLE t4( + `k` int(10) unsigned NOT NULL AUTO_INCREMENT, + `word` varchar(100) NOT NULL, + `mean` varchar(300) NOT NULL, + PRIMARY KEY (`k`) +); + + +--echo ############################ +--echo # Creating Stored Programs # +--echo ############################ + +--echo # Stored Routine ( Procedure & Function ) + +DELIMITER |; +CREATE PROCEDURE SampleProc1(x1 INT, x2 INT, y INT) +BEGIN + INSERT INTO t1 VALUES (x1, y); + INSERT INTO t1 VALUES (x2, y); +END| + +CREATE PROCEDURE SampleProc2(x CHAR(16), y INT) +BEGIN + DECLARE z1, z2 INT; + SET z1 = y; + SET z2 = z1+2; + INSERT INTO t2 VALUES (x, z2); +END| + +CREATE PROCEDURE SampleProc3() +BEGIN + DECLARE ld DATE; + DECLARE li INT; + DECLARE lf DOUBLE; + DECLARE ls VARCHAR(32); + + SET ld = NULL, li = NULL, lf = NULL, ls = NULL; + INSERT INTO t3 VALUES (ld, li, lf, ls); + + INSERT INTO t3 (n, f, s) VALUES ((ld IS NULL), 1, "ld is null"), + ((li IS NULL), 1, "li is null"), + ((li = 0), NULL, "li = 0"), + ((lf IS NULL), 1, "lf is null"), + ((lf = 0), NULL, "lf = 0"), + ((ls IS NULL), 1, "ls is null"); +END| + + +CREATE PROCEDURE SampleProc4() +BEGIN + DECLARE x INT; + SET x = 1; + WHILE x <= 2 DO + INSERT INTO t4(word, mean) VALUES('a','a mean'); + SET x = x + 1; + END WHILE; +END| + +CREATE FUNCTION append(s1 CHAR(8), s2 CHAR(8)) RETURNS CHAR(16) + RETURN concat(s1, s2)| + +CREATE FUNCTION wt_avg(n1 INT, n2 INT, n3 INT, n4 INT) + RETURNS INT + DETERMINISTIC + BEGIN + DECLARE avg INT; + SET avg = (n1+n2+n3*2+n4*4)/8; + RETURN avg; + END| + +CREATE FUNCTION fac(n INT UNSIGNED) RETURNS BIGINT UNSIGNED +BEGIN + DECLARE f BIGINT UNSIGNED DEFAULT 1; + WHILE n > 1 DO + SET f = f * n; + SET n = n - 1; + END WHILE; + RETURN f; +END| + +--echo # Triggers + +# INSERT triggers +CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN + if isnull(new.j) then + SET new.j:= new.i * 10; + END if; +END| + +CREATE TRIGGER trg2 AFTER INSERT ON t2 FOR EACH ROW +BEGIN + UPDATE t1 SET i=new.id+i ; +END| + +# UPDATE trigger +CREATE TRIGGER trg3 AFTER UPDATE ON t2 FOR EACH ROW + SET @change:= @change + new.id - old.id| + +# DELETE triggers +CREATE TRIGGER trg4 BEFORE DELETE ON t1 FOR EACH ROW + SET @del:= @del + 1| + +CREATE TRIGGER trg5 AFTER DELETE ON t1 FOR EACH ROW + SET @del:= @del + 8 + old.j| + +DELIMITER ;| diff --git a/mysql-test/suite/perfschema/include/reset_transaction_gtid.inc b/mysql-test/suite/perfschema/include/reset_transaction_gtid.inc new file mode 100644 index 00000000000..c8eaf53afe9 --- /dev/null +++ b/mysql-test/suite/perfschema/include/reset_transaction_gtid.inc @@ -0,0 +1,20 @@ +# ==== Purpose ==== +# +# Auxiliary file used by transaction_gtid.test +# +# Invoked between transactions in order to reset the state: +# - set GTID_NEXT to AUTOMATIC since this is required after +# any transaction that has GTID_NEXT=UUID:NUMBER +# - RESET MASTER in order to clear @@global.gtid_executed, so +# that the same GTID can be executed again. +# - truncate the performance_schema.events_transaction_* tables +# +# All this is done on the connection 'server_1'. + +--disable_query_log +--connection server_1 +RESET MASTER; +TRUNCATE TABLE performance_schema.events_transactions_history; +TRUNCATE TABLE performance_schema.events_transactions_current; +--enable_query_log +--connection default diff --git a/mysql-test/suite/perfschema/include/schema.inc b/mysql-test/suite/perfschema/include/schema.inc index f5f23893d37..8a8be180e47 100644 --- a/mysql-test/suite/perfschema/include/schema.inc +++ b/mysql-test/suite/perfschema/include/schema.inc @@ -27,6 +27,14 @@ 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_transactions_current; +show create table events_transactions_history; +show create table events_transactions_history_long; +show create table events_transactions_summary_by_host_by_event_name; +show create table events_transactions_summary_by_thread_by_event_name; +show create table events_transactions_summary_by_user_by_event_name; +show create table events_transactions_summary_by_account_by_event_name; +show create table events_transactions_summary_global_by_event_name; show create table events_waits_current; show create table events_waits_history; show create table events_waits_history_long; @@ -36,6 +44,12 @@ 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 memory_summary_by_host_by_event_name; +show create table memory_summary_by_thread_by_event_name; +show create table memory_summary_by_user_by_event_name; +show create table memory_summary_by_account_by_event_name; +show create table memory_summary_global_by_event_name; +show create table metadata_locks; show create table file_instances; show create table file_summary_by_event_name; show create table file_summary_by_instance; @@ -53,6 +67,7 @@ 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_handles; 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; diff --git a/mysql-test/suite/perfschema/include/show_aggregate.inc b/mysql-test/suite/perfschema/include/show_aggregate.inc new file mode 100644 index 00000000000..a637e7b54dd --- /dev/null +++ b/mysql-test/suite/perfschema/include/show_aggregate.inc @@ -0,0 +1,125 @@ +############### suite/perfschema/include/show_aggregate.inc #################### +# # +# Gather status by thread, by user, by host, by account and global. # +# # +################################################################################ + +--echo #================= +--echo # Global results +--echo #================= +USE test; +UPDATE test.status_results sr, performance_schema.global_status sg + SET sr.stop = sg.variable_value + WHERE sr.variable_name = sg.variable_name + AND sg.variable_name IN ('handler_delete', 'handler_rollback'); +--echo +--echo # Global deltas: END - START. +UPDATE test.status_results sr + SET sr.delta = sr.stop - sr.start; + +#--echo DEBUG +#SELECT * FROM test.status_results; +#SELECT * from performance_schema.global_status where variable_name in ('handler_delete', 'handler_rollback'); + +--echo #================= +--echo # Status by thread +--echo #================= +--echo # Thread results from CON1. +UPDATE test.status_results sr, performance_schema.status_by_thread sbt + SET sr.t1 = sbt.variable_value + WHERE sr.variable_name = sbt.variable_name + AND sbt.variable_name IN ('handler_delete', 'handler_rollback') + AND sbt.thread_id = @con1_id; +--echo +--echo # Thread results from CON2. +UPDATE test.status_results sr, performance_schema.status_by_thread sbt + SET sr.t2 = sbt.variable_value + WHERE sr.variable_name = sbt.variable_name + AND sbt.variable_name IN ('handler_delete', 'handler_rollback') + AND sbt.thread_id = @con2_id; +--echo +--echo # Thread results from CON3. +UPDATE test.status_results sr, performance_schema.status_by_thread sbt + SET sr.t3 = sbt.variable_value + WHERE sr.variable_name = sbt.variable_name + AND sbt.variable_name IN ('handler_delete', 'handler_rollback') + AND sbt.thread_id = @con3_id; +--echo +--echo # Thread totals for 3 connections. +UPDATE test.status_results sr + SET sr.thread = sr.t1 + sr.t2 + sr.t3; + +--echo #================= +--echo # Status by user +--echo #================= +--echo # User1 +UPDATE test.status_results sr, performance_schema.status_by_user sbu + SET sr.u1 = sbu.variable_value + WHERE sr.variable_name = sbu.variable_name + AND sbu.variable_name IN ('handler_delete', 'handler_rollback') + AND sbu.user IN ('user1'); +--echo +--echo # User2 +UPDATE test.status_results sr, performance_schema.status_by_user sbu + SET sr.u2 = sbu.variable_value + WHERE sr.variable_name = sbu.variable_name + AND sbu.variable_name IN ('handler_delete', 'handler_rollback') + AND sbu.user IN ('user2'); +--echo +--echo # User3 +UPDATE test.status_results sr, performance_schema.status_by_user sbu + SET sr.u3 = sbu.variable_value + WHERE sr.variable_name = sbu.variable_name + AND sbu.variable_name IN ('handler_delete', 'handler_rollback') + AND sbu.user IN ('user3'); +--echo +--echo # Status totals for 3 users. +UPDATE test.status_results sr + SET sr.user = sr.u1 + sr.u2 + sr.u3; + +--echo #=========================== +--echo # Status by host (localhost) +--echo #=========================== +--echo +--echo # host1 = localhost +UPDATE test.status_results sr, performance_schema.status_by_host sbh + SET sr.h1 = sbh.variable_value + WHERE sr.variable_name = sbh.variable_name + AND sbh.variable_name IN ('handler_delete', 'handler_rollback') + AND sbh.host IN ('localhost'); +--echo +--echo # Status totals for 'localhost' only. +UPDATE test.status_results sr + SET sr.host = sr.h1 + sr.h2 + sr.h3; + +--echo #================== +--echo # Status by account +--echo #================== +--echo # User1@localhost +UPDATE test.status_results sr, performance_schema.status_by_account sba + SET sr.a1 = sba.variable_value + WHERE sr.variable_name = sba.variable_name + AND sba.variable_name IN ('handler_delete', 'handler_rollback') + AND sba.user IN ('user1'); +--echo +--echo # User2@localhost +UPDATE test.status_results sr, performance_schema.status_by_account sba + SET sr.a2 = sba.variable_value + WHERE sr.variable_name = sba.variable_name + AND sba.variable_name IN ('handler_delete', 'handler_rollback') + AND sba.user IN ('user2'); +--echo +--echo # User3@localhost +UPDATE test.status_results sr, performance_schema.status_by_account sba + SET sr.a3 = sba.variable_value + WHERE sr.variable_name = sba.variable_name + AND sba.variable_name IN ('handler_delete', 'handler_rollback') + AND sba.user IN ('user3'); +--echo +--echo +--echo # Status totals for 3 accounts. +UPDATE test.status_results sr + SET sr.acct = sr.a1 + sr.a2 + sr.a3; + +#--echo DEBUG +#SELECT * FROM test.status_results; diff --git a/mysql-test/suite/perfschema/include/show_plugin_verifier.inc b/mysql-test/suite/perfschema/include/show_plugin_verifier.inc new file mode 100644 index 00000000000..9705a1914c1 --- /dev/null +++ b/mysql-test/suite/perfschema/include/show_plugin_verifier.inc @@ -0,0 +1,29 @@ +--disable_warnings + +--echo +SHOW GLOBAL STATUS LIKE "example_%"; +--echo +SHOW SESSION STATUS LIKE "example_%"; +--echo +SHOW GLOBAL VARIABLES LIKE "example_%"; +--echo +SHOW SESSION VARIABLES LIKE "example_%"; +--echo +SELECT variable_name, variable_value FROM performance_schema.global_status WHERE variable_name LIKE "example_%"; +--echo +SELECT variable_name, variable_value FROM performance_schema.session_status WHERE variable_name LIKE "example_%"; +--echo +SELECT variable_name, variable_value FROM performance_schema.global_variables WHERE variable_name LIKE "example_%"; +--echo +SELECT variable_name, variable_value FROM performance_schema.session_variables WHERE variable_name LIKE "example_%"; + +# +# Force sync of local and global system variables. +# +--disable_result_log +--disable_query_log +SELECT variable_name, variable_value FROM performance_schema.variables_by_thread WHERE variable_name LIKE "example_%"; +--enable_query_log +--enable_result_log + +--enable_warnings diff --git a/mysql-test/suite/perfschema/include/show_plugin_verifier_56.inc b/mysql-test/suite/perfschema/include/show_plugin_verifier_56.inc new file mode 100644 index 00000000000..7e144899497 --- /dev/null +++ b/mysql-test/suite/perfschema/include/show_plugin_verifier_56.inc @@ -0,0 +1,29 @@ +--disable_warnings + +--echo +SHOW GLOBAL STATUS LIKE "example_%"; +--echo +SHOW SESSION STATUS LIKE "example_%"; +--echo +SHOW GLOBAL VARIABLES LIKE "example_%"; +--echo +SHOW SESSION VARIABLES LIKE "example_%"; +--echo +SELECT variable_name, variable_value FROM information_schema.global_status WHERE variable_name LIKE "example_%"; +--echo +SELECT variable_name, variable_value FROM information_schema.session_status WHERE variable_name LIKE "example_%"; +--echo +SELECT variable_name, variable_value FROM information_schema.global_variables WHERE variable_name LIKE "example_%"; +--echo +SELECT variable_name, variable_value FROM information_schema.session_variables WHERE variable_name LIKE "example_%"; + +# +# Force sync of local and global system variables. +# +--disable_result_log +--disable_query_log +SELECT variable_name, variable_value FROM performance_schema.variables_by_thread WHERE variable_name LIKE "example_%"; +--enable_query_log +--enable_result_log + +--enable_warnings diff --git a/mysql-test/suite/perfschema/include/show_transaction_gtid.inc b/mysql-test/suite/perfschema/include/show_transaction_gtid.inc new file mode 100644 index 00000000000..758354ea2b8 --- /dev/null +++ b/mysql-test/suite/perfschema/include/show_transaction_gtid.inc @@ -0,0 +1,29 @@ +# ==== Purpose ==== +# +# Auxiliary file used by transaction_gtid.test +# +# Invoked to check the contents of the +# performance_schema.events_transaction_[current|history] tables and +# write the result to the result log. This is executed on the +# 'server_1' connection and shows only status of transactions on the +# 'default' connection. + +--connection server_1 + +--replace_result $server_uuid SERVER_UUID aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa A +--let $history_result= `SELECT GTID FROM performance_schema.events_transactions_history WHERE THREAD_ID = $thread_id` +if ($history_result == '') +{ + --let $history_result= none +} + +--replace_result $server_uuid SERVER_UUID aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa A +--let $current_result= `SELECT GTID FROM performance_schema.events_transactions_current WHERE THREAD_ID = $thread_id` +if ($current_result == '') +{ + --let $current_result= none +} + +--echo - history=$history_result current=$current_result + +--connection default diff --git a/mysql-test/suite/perfschema/include/sizing_auto.inc b/mysql-test/suite/perfschema/include/sizing_auto.inc deleted file mode 100644 index 3bb4db2276f..00000000000 --- a/mysql-test/suite/perfschema/include/sizing_auto.inc +++ /dev/null @@ -1,24 +0,0 @@ - -show variables like "table_definition_cache"; -show variables like "table_open_cache"; -show variables like "max_connections"; -# open_files_limit depends on OS configuration (ulimit -n) -#show variables like "open_files_limit"; -show variables where - `Variable_name` != "performance_schema_max_statement_classes" and - `Variable_name` like "performance_schema%"; -show status like "%performance_schema%"; - -# Each test script should provide a different test.cnf file, -# with different settings. -# This output will show the sizes computed automatically. -# Note that this output is very dependent on the platform. -# The output of SHOW ENGINE PERFORMANCE_SCHEMA STATUS -# is very dependent on the platform, -# so it is not printed here to ensure stability of the .results files. -# To troubleshoot the performance schema memory consumption at different -# configuration settings, comment the following line. -# Debug only: - -# show engine performance_schema status; - diff --git a/mysql-test/suite/perfschema/include/start_server_common.inc b/mysql-test/suite/perfschema/include/start_server_common.inc index 8cbd40c2bc1..ec2912217cd 100644 --- a/mysql-test/suite/perfschema/include/start_server_common.inc +++ b/mysql-test/suite/perfschema/include/start_server_common.inc @@ -7,13 +7,13 @@ select count(*) from performance_schema.setup_consumers; # 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; +# wait/lock/metadata is a native instrument +select count(*) > 4 from performance_schema.setup_instruments; select count(*) from performance_schema.setup_timers; # Make sure we don't crash, no matter what the starting parameters are --disable_result_log ---disable_query_log select * from performance_schema.accounts; select * from performance_schema.cond_instances; select * from performance_schema.events_stages_current; @@ -33,6 +33,14 @@ 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_transactions_current; +select * from performance_schema.events_transactions_history; +select * from performance_schema.events_transactions_history_long; +select * from performance_schema.events_transactions_summary_by_account_by_event_name; +select * from performance_schema.events_transactions_summary_by_host_by_event_name; +select * from performance_schema.events_transactions_summary_by_thread_by_event_name; +select * from performance_schema.events_transactions_summary_by_user_by_event_name; +select * from performance_schema.events_transactions_summary_global_by_event_name; select * from performance_schema.events_waits_current; select * from performance_schema.events_waits_history; select * from performance_schema.events_waits_history_long; @@ -42,11 +50,22 @@ 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_user_by_event_name; select * from performance_schema.events_waits_summary_global_by_event_name; +select * from performance_schema.memory_summary_by_account_by_event_name; +select * from performance_schema.memory_summary_by_host_by_event_name; +select * from performance_schema.memory_summary_by_thread_by_event_name; +select * from performance_schema.memory_summary_by_user_by_event_name; +select * from performance_schema.memory_summary_global_by_event_name; select * from performance_schema.file_instances; select * from performance_schema.file_summary_by_event_name; select * from performance_schema.file_summary_by_instance; select * from performance_schema.host_cache; select * from performance_schema.hosts; +select * from performance_schema.memory_summary_by_account_by_event_name; +select * from performance_schema.memory_summary_by_host_by_event_name; +select * from performance_schema.memory_summary_by_thread_by_event_name; +select * from performance_schema.memory_summary_by_user_by_event_name; +select * from performance_schema.memory_summary_global_by_event_name; +select * from performance_schema.metadata_locks; select * from performance_schema.mutex_instances; select * from performance_schema.objects_summary_global_by_type; select * from performance_schema.performance_timers; @@ -61,13 +80,31 @@ select * from performance_schema.setup_timers; 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.table_handles; 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.users; +select * from performance_schema.replication_connection_configuration; +select * from performance_schema.replication_connection_status; +select * from performance_schema.replication_applier_configuration; +select * from performance_schema.replication_applier_status; +select * from performance_schema.replication_applier_status_by_coordinator; +select * from performance_schema.replication_applier_status_by_worker; +select * from performance_schema.global_status; +select * from performance_schema.status_by_thread; +select * from performance_schema.status_by_user; +select * from performance_schema.status_by_host; +select * from performance_schema.status_by_account; +select * from performance_schema.session_status; +select * from performance_schema.global_variables; +select * from performance_schema.variables_by_thread; +select * from performance_schema.session_variables; --enable_result_log ---enable_query_log + +# This has a stable output, printing the result: +show global variables like "performance_schema%"; # This has an unrepeatable output, it does depends too much on # - the platform hardware (sizeof structures, padding) @@ -78,6 +115,6 @@ select * from performance_schema.users; --disable_result_log show engine PERFORMANCE_SCHEMA status; -show status like "performance_schema%"; +show global status like "performance_schema%"; --enable_result_log diff --git a/mysql-test/suite/perfschema/include/table_aggregate_load.inc b/mysql-test/suite/perfschema/include/table_aggregate_load.inc index 80c622d77be..9d757617cad 100644 --- a/mysql-test/suite/perfschema/include/table_aggregate_load.inc +++ b/mysql-test/suite/perfschema/include/table_aggregate_load.inc @@ -2,6 +2,19 @@ # # See comments in include/table_aggregate_setup.inc +# +# Notes about the optimizer and query plans: +# The following statement +# SELECT * from t1 where b=5; +# can be executed either: +# - by using the index "index_b" on column b +# - by using a full table scan and the where clause. +# Which plan is used can be unpredictable. +# To ensure that the index is really used, +# so that table io against the index is measured, +# the payload in this test uses: +# SELECT * from t1 force index(index_b) where b=5; +# # Display the current setup used @@ -88,13 +101,34 @@ 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; +select * from test.t1 force index(index_b) where b=5; +select * from test.t2 force index(index_b) where b=5; +select * from test.t3 force index(index_b) where b=5; --connection default -echo "================== Step 3 =================="; +echo "================== Step 3-A =================="; +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 + +# This cause aggregation, so that index names are finally recorded +flush tables; + +echo "================== con1 FLUSH =================="; + +--connection default + +echo "================== Step 3-B =================="; call dump_thread(); execute dump_waits_account; execute dump_waits_user; @@ -147,9 +181,9 @@ 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; +select * from test.t1 force index(index_b) where b=5; +select * from test.t2 force index(index_b) where b=5; +select * from test.t3 force index(index_b) where b=5; --connection default @@ -202,9 +236,9 @@ 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; +select * from test.t1 force index(index_b) where b=5; +select * from test.t2 force index(index_b) where b=5; +select * from test.t3 force index(index_b) where b=5; --connection default @@ -257,9 +291,9 @@ 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; +select * from test.t1 force index(index_b) where b=5; +select * from test.t2 force index(index_b) where b=5; +select * from test.t3 force index(index_b) where b=5; --connection default @@ -494,4 +528,5 @@ execute dump_waits_table_lock; execute dump_objects_summary; # On test failures, may help to track the root cause -show status like "performance_schema%"; +show global status like "performance_schema%"; + diff --git a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc index 79aa5482838..79f7bd70a3f 100644 --- a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc +++ b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc @@ -222,7 +222,9 @@ prepare dump_waits_global from order by event_name;"; prepare dump_waits_history from - "select event_name, count(event_name), object_type, object_schema, object_name + "select event_name, + sum(if(number_of_bytes is null, 1, number_of_bytes)) as '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\', @@ -254,7 +256,7 @@ prepare dump_waits_table_lock from 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_low_priority, count_write_external from performance_schema.table_lock_waits_summary_by_table where object_type='TABLE' and object_schema='test' diff --git a/mysql-test/suite/perfschema/include/transaction_cleanup.inc b/mysql-test/suite/perfschema/include/transaction_cleanup.inc new file mode 100644 index 00000000000..3b8ed02d6b6 --- /dev/null +++ b/mysql-test/suite/perfschema/include/transaction_cleanup.inc @@ -0,0 +1,12 @@ +# Tests for the performance schema + +# ========================================== +# HELPER include/transaction_cleanup.inc +# ========================================== + +DROP PROCEDURE clear_transaction_tables; +DROP PROCEDURE clear_transaction_history; +DROP PROCEDURE clear_statement_history; +DROP PROCEDURE clear_history; +DROP PROCEDURE transaction_verifier; + diff --git a/mysql-test/suite/perfschema/include/transaction_nested_events_verifier.inc b/mysql-test/suite/perfschema/include/transaction_nested_events_verifier.inc new file mode 100644 index 00000000000..e81a42b4817 --- /dev/null +++ b/mysql-test/suite/perfschema/include/transaction_nested_events_verifier.inc @@ -0,0 +1,145 @@ +# Tests for the performance schema + +# ===================================================== +# HELPER include/transaction_nested_events_verifier.inc +# ===================================================== + +--connection default +--disable_query_log + +# Poll till the activity of the actor connection con1 caused by the last +# statement issued has finished. +let $wait_timeout= 10; +let $wait_condition= + SELECT COUNT(*) > 0 FROM performance_schema.threads + WHERE THREAD_ID = @con1_thread_id + AND (PROCESSLIST_STATE = 'Sleep' OR PROCESSLIST_STATE IS NULL); +--source include/wait_condition.inc +if(!$success) +{ + --echo The activity of connection con1 did not finish. + SELECT thread_id , PROCESSLIST_id, PROCESSLIST_STATE, PROCESSLIST_INFO + FROM performance_schema.threads + WHERE thread_id = @con1_thread_id; + --echo Abort. + exit; +} + +--echo #======================================================================== +--echo # Verify +--echo #======================================================================== + +SELECT event_id from performance_schema.events_transactions_history_long + where (THREAD_ID = @con1_thread_id) + order by event_id limit 1 + into @base_tx_event_id; + +SELECT event_id from performance_schema.events_statements_history_long + where (THREAD_ID = @con1_thread_id) + order by event_id limit 1 + into @base_stmt_event_id; + +select if(@base_tx_event_id < @base_stmt_event_id, + @base_tx_event_id - 1, + @base_stmt_event_id - 1) + into @base_event_id; + +# Debug helpers +# set @base_event_id = 0; +# select @base_tx_event_id, @base_stmt_event_id, @base_event_id; + +--echo EVENTS_TRANSACTIONS_CURRENT +--echo + +--replace_column 1 thread_id + +SELECT THREAD_ID, + LPAD(EVENT_ID - @base_event_id, 11, ' ') as R_EVENT_ID, + LPAD(END_EVENT_ID - @base_event_id, 11, ' ') as R_END_EVENT_ID, + RPAD(EVENT_NAME, 11, ' ') 'EVENT_NAME ', + RPAD(STATE, 11, ' ') 'STATE ', + RPAD(ACCESS_MODE, 11, ' ') ACCESS_MODE, + RPAD(ISOLATION_LEVEL, 16, ' ') 'ISOLATION_LEVEL ', + RPAD(AUTOCOMMIT, 4, ' ') AUTO, + LPAD(NESTING_EVENT_ID - @base_event_id, 19, ' ') as R_NESTING_EVENT_ID, + RPAD(IFNULL(NESTING_EVENT_TYPE, 'NULL'), 18, ' ') NESTING_EVENT_TYPE +FROM performance_schema.events_transactions_current +WHERE ((THREAD_ID = @con1_thread_id) OR (@all_threads = 1)) +ORDER BY thread_id, event_id; + +--echo +--echo EVENTS_TRANSACTIONS_HISTORY_LONG +--echo + +--replace_column 1 thread_id + +SELECT THREAD_ID, + LPAD(EVENT_ID - @base_event_id, 11, ' ') as R_EVENT_ID, + LPAD(END_EVENT_ID - @base_event_id, 11, ' ') as R_END_EVENT_ID, + RPAD(EVENT_NAME, 11, ' ') 'EVENT_NAME ', + RPAD(STATE, 11, ' ') 'STATE ', + RPAD(ACCESS_MODE, 11, ' ') ACCESS_MODE, + RPAD(ISOLATION_LEVEL, 16, ' ') 'ISOLATION_LEVEL ', + RPAD(AUTOCOMMIT, 4, ' ') AUTO, + LPAD(NESTING_EVENT_ID - @base_event_id, 19, ' ') as R_NESTING_EVENT_ID, + RPAD(IFNULL(NESTING_EVENT_TYPE, 'NULL'), 18, ' ') NESTING_EVENT_TYPE +FROM performance_schema.events_transactions_history_long +WHERE ((THREAD_ID = @con1_thread_id) OR (@all_threads = 1)) +ORDER BY thread_id, event_id; + +--echo +--echo EVENTS_STATEMENTS_HISTORY_LONG +--echo + +--replace_column 1 thread_id + +SELECT THREAD_ID, + LPAD(EVENT_ID - @base_event_id, 11, ' ') as R_EVENT_ID, + LPAD(END_EVENT_ID - @base_event_id, 11, ' ') as R_END_EVENT_ID, + RPAD(EVENT_NAME, 30, ' ') 'EVENT_NAME ', + RPAD(IFNULL(object_name, 'NULL'), 12, ' ') 'OBJECT_NAME ', + LPAD(IFNULL(NESTING_EVENT_ID - @base_event_id, 'NULL'), 19, ' ') as R_NESTING_EVENT_ID, + RPAD(IFNULL(NESTING_EVENT_TYPE, 'NULL'), 18, ' ') NESTING_EVENT_TYPE, + LPAD(NESTING_EVENT_LEVEL, 5, ' ') LEVEL, + SQL_TEXT +FROM performance_schema.events_statements_history_long +WHERE ((THREAD_ID = @con1_thread_id) OR (@all_threads = 1)) +ORDER BY thread_id, event_id; + +--echo +--echo ## Combined statement and transaction event history ordered by event id +--echo +--echo EVENTS_STATEMENTS_HISTORY_LONG + EVENTS_TRANSACTIONS_HISTORY_LONG +--echo + +--replace_column 1 thread_id + +SELECT THREAD_ID, + LPAD(EVENT_ID - @base_event_id, 11, ' ') as R_EVENT_ID, + LPAD(END_EVENT_ID - @base_event_id, 11, ' ') as R_END_EVENT_ID, + RPAD(EVENT_NAME, 25, ' ') 'EVENT_NAME ', + LPAD(NESTING_EVENT_ID - @base_event_id, 19, ' ') as R_NESTING_EVENT_ID, + RPAD(IFNULL(NESTING_EVENT_TYPE, 'NULL'), 18, ' ') NESTING_EVENT_TYPE, + '' AS SQL_TXT +FROM performance_schema.events_transactions_history_long t +WHERE (t.thread_id = @con1_thread_id) +UNION +SELECT THREAD_ID, + LPAD(EVENT_ID - @base_event_id, 11, ' ') as R_EVENT_ID, + LPAD(END_EVENT_ID - @base_event_id, 11, ' ') as R_END_EVENT_ID, + RPAD(EVENT_NAME, 25, ' ') 'EVENT_NAME ', + LPAD(IFNULL(NESTING_EVENT_ID - @base_event_id, 'NULL'), 19, ' ') as R_NESTING_EVENT_ID, + RPAD(IFNULL(NESTING_EVENT_TYPE, 'NULL'), 18, ' ') NESTING_EVENT_TYPE, + SQL_TEXT +FROM performance_schema.events_statements_history_long s +WHERE ((s.thread_id = @con1_thread_id) OR (@all_threads = 1)) +ORDER BY thread_id, r_event_id; + +--echo +--echo ## Clear statement and transaction history +--echo CALL test.clear_history(); +CALL test.clear_history(); +--enable_query_log +--echo ## Reset db.t1 +DELETE FROM db.t1; +--echo diff --git a/mysql-test/suite/perfschema/include/transaction_setup.inc b/mysql-test/suite/perfschema/include/transaction_setup.inc new file mode 100644 index 00000000000..78697425731 --- /dev/null +++ b/mysql-test/suite/perfschema/include/transaction_setup.inc @@ -0,0 +1,231 @@ +# Tests for the performance schema + +# ========================================== +# HELPER include/transaction_setup.inc +# ========================================== + +# +# UTILITY QUERIES +# +let $get_thread_id= + SELECT thread_id INTO @my_thread_id + FROM performance_schema.threads + WHERE processlist_id = connection_id(); + +let $disable_instruments= + UPDATE performance_schema.setup_instruments + SET enabled='no', timed='no' + WHERE name IN ('transaction'); + +let $enable_instruments= + UPDATE performance_schema.setup_instruments + SET enabled='yes', timed='yes' + WHERE name IN ('transaction'); + +let $def_count = -1; + +--disable_warnings +DROP PROCEDURE IF EXISTS clear_transaction_tables; +--enable_warnings + +--disable_result_log + +DELIMITER $$; +CREATE PROCEDURE clear_transaction_tables() +BEGIN + truncate table performance_schema.events_transactions_current; + truncate table performance_schema.events_transactions_history; + truncate table performance_schema.events_transactions_history_long; + truncate table performance_schema.events_transactions_summary_by_thread_by_event_name; + truncate table performance_schema.events_transactions_summary_by_account_by_event_name; + truncate table performance_schema.events_transactions_summary_by_host_by_event_name; + truncate table performance_schema.events_transactions_summary_by_user_by_event_name; + truncate table performance_schema.events_transactions_summary_global_by_event_name; +END$$ + +CREATE PROCEDURE clear_transaction_history() +BEGIN + truncate table performance_schema.events_transactions_current; + truncate table performance_schema.events_transactions_history; + truncate table performance_schema.events_transactions_history_long; +END$$ + +CREATE PROCEDURE clear_statement_history() +BEGIN + truncate table performance_schema.events_statements_current; + truncate table performance_schema.events_statements_history; + truncate table performance_schema.events_statements_history_long; +END$$ + +CREATE PROCEDURE clear_history() +BEGIN + truncate table performance_schema.events_statements_current; + truncate table performance_schema.events_statements_history; + truncate table performance_schema.events_statements_history_long; + truncate table performance_schema.events_transactions_current; + truncate table performance_schema.events_transactions_history; + truncate table performance_schema.events_transactions_history_long; +END$$ + +CREATE PROCEDURE transaction_verifier(IN i_table INT, + IN i_thread_id INT, + IN i_event_name VARCHAR(64), + IN i_state VARCHAR(32), + IN i_xid_format_id INT, + IN i_xid_gtrid VARCHAR(130), + IN i_xid_bqual VARCHAR(130), + IN i_xa_state VARCHAR(64), + IN i_gtid VARCHAR(64), + IN i_access_mode VARCHAR(32), + IN i_isolation_level VARCHAR(64), + IN i_autocommit VARCHAR(16), + IN i_savepoints INT, + IN i_rb_savepoint INT, + IN i_rel_savepoint INT, + IN i_expected INT) +BEGIN + DECLARE table_name VARCHAR(64); + SET @thread_id = i_thread_id; + SET @event_id = 0; + SET @event_name = i_event_name; + SET @state = i_state; + SET @xid_format_id = i_xid_format_id; + SET @xid_gtrid = i_xid_gtrid; + SET @xid_bqual = i_xid_bqual; + SET @xa_state = i_xa_state; + SET @gtid = i_gtid; + SET @access_mode = i_access_mode; + SET @isolation_level = i_isolation_level; + SET @autocommit = i_autocommit; + SET @savepoints = i_savepoints; + SET @rb_savepoint = i_rb_savepoint; + SET @rel_savepoint = i_rel_savepoint; + SET @expected = i_expected; + + # + # Build verification query based upon input parameters + # + + IF i_table = 0 THEN + SET table_name = 'performance_schema.events_transactions_current'; + ELSEIF i_table = 1 THEN + SET table_name = 'performance_schema.events_transactions_history'; + ELSEIF i_table = 2 THEN + SET table_name = 'performance_schema.events_transactions_history_long'; + ELSE + SET table_name = 'performance_schema.events_transactions_history'; + END IF; + + SET @query = CONCAT('SELECT COUNT(*) INTO @actual FROM ', table_name, ' WHERE'); + + IF i_thread_id != 0 THEN + SET @query = CONCAT(@query, ' (thread_id = @thread_id)'); + END IF; + IF i_event_name != '' THEN + SET @query = CONCAT(@query, ' AND (event_name = @event_name)'); + END IF; + IF i_state != '' THEN + SET @query = CONCAT(@query, ' AND (state = @state)'); + END IF; + IF i_xid_format_id != '' THEN + SET @query = CONCAT(@query, ' AND (xid_format_id = @xid_format_id)'); + END IF; + IF i_xid_gtrid != '' THEN + SET @query = CONCAT(@query, ' AND (xid_gtrid = @xid_gtrid)'); + END IF; + IF i_xid_bqual != '' THEN + SET @query = CONCAT(@query, ' AND (xid_bqual = @xid_bqual)'); + END IF; + IF i_xa_state != '' THEN + SET @query = CONCAT(@query, ' AND (xa_state = @xa_state)'); + END IF; + IF i_gtid = 'NULL' THEN + SET @query = CONCAT(@query, ' AND (gtid IS NULL)'); + ELSEIF i_gtid != '' THEN + SET @query = CONCAT(@query, ' AND (gtid = @gtid)'); + END IF; + IF i_access_mode != '' THEN + SET @query = CONCAT(@query, ' AND (access_mode = @access_mode)'); + END IF; + IF i_isolation_level != '' THEN + SET @query = CONCAT(@query, ' AND (isolation_level = @isolation_level)'); + END IF; + IF i_autocommit != '' THEN + SET @query = CONCAT(@query, ' AND (autocommit = @autocommit)'); + END IF; + IF i_savepoints != 0 THEN + SET @query = CONCAT(@query, ' AND (number_of_savepoints = @savepoints)'); + END IF; + IF i_rb_savepoint != 0 THEN + SET @query = CONCAT(@query, ' AND (number_of_rollback_to_savepoint = @rb_savepoint)'); + END IF; + IF i_rel_savepoint != 0 THEN + SET @query = CONCAT(@query, ' AND (number_of_release_savepoint = @rel_savepoint)'); + END IF; + + SET @query = CONCAT(@query, ' ORDER BY event_id;'); + + ## DEBUG ## SELECT * FROM performance_schema.events_transactions_history ORDER BY event_id; + ## SELECT @query AS "QUERY"; + PREPARE stmt1 FROM @query; + EXECUTE stmt1; + DEALLOCATE PREPARE stmt1; + + SELECT LPAD(@actual, 6, ' ') AS "ACTUAL", LPAD(@expected, 8, ' ') AS "EXPECTED"; + + IF @actual != @expected THEN + SELECT "" AS "ERROR: Row count mismatch"; + SELECT @query AS "VERIFIER QUERY:"; + SELECT ""; + + SET @columns = ' LPAD(@thread_id, 9, " ") AS thread_id,'; + SET @columns = CONCAT(@columns, ' LPAD(@event_id, 10, " ") AS "..event_id",'); + SET @columns = CONCAT(@columns, ' RPAD(@event_name, 11, " ") AS "event_name ",'); + SET @columns = CONCAT(@columns, ' RPAD(@state, 11, " ") AS "state ",'); + SET @columns = CONCAT(@columns, ' RPAD(@xid_format_id, 15, " ") AS "xid_format_id ",'); + SET @columns = CONCAT(@columns, ' RPAD(@xid_gtrid, 15, " ") AS "xid_gtrid ",'); + SET @columns = CONCAT(@columns, ' RPAD(@xid_bqual, 15, " ") AS "xid_bqual ",'); + SET @columns = CONCAT(@columns, ' RPAD(@xa_state, 12, " ") AS "xa_state ",'); + SET @columns = CONCAT(@columns, ' RPAD(@gtid, 38, " ") AS "gtid ",'); + SET @columns = CONCAT(@columns, ' RPAD(@access_mode, 11, " ") AS access_mode,'); + SET @columns = CONCAT(@columns, ' RPAD(@isolation_level, 16, " ") AS "isolation_level ",'); + SET @columns = CONCAT(@columns, ' RPAD(@autocommit, 10, " ") AS autocommit,'); + SET @columns = CONCAT(@columns, ' LPAD(@savepoints, 10, " ") AS savepoints,'); + SET @columns = CONCAT(@columns, ' LPAD(@rb_savepoint, 21, " ") AS rollback_to_savepoint,'); + SET @columns = CONCAT(@columns, ' LPAD(@rel_savepoint, 17, " ") AS release_savepoint'); + SET @query2 = CONCAT('SELECT', ' LPAD(@expected, 13, " ") AS ROWS_EXPECTED, ', @columns, ';'); +# SET @query2 = CONCAT('SELECT " " AS EXPECTED, ', @columns, ';'); + PREPARE stmt2 FROM @query2; + EXECUTE stmt2; + DEALLOCATE PREPARE stmt2; + + SET @columns = ' LPAD(thread_id, 9, " ") AS thread_id,'; + SET @columns = CONCAT(@columns, ' LPAD(event_id, 10, " ") AS "..event_id",'); + SET @columns = CONCAT(@columns, ' RPAD(event_name, 11, " ") AS "event_name ",'); + SET @columns = CONCAT(@columns, ' RPAD(state, 11, " ") AS "state ",'); + SET @columns = CONCAT(@columns, ' RPAD(IFNULL(xid_format_id, "NULL"), 15, " ") AS "xid_format_id ",'); + SET @columns = CONCAT(@columns, ' RPAD(IFNULL(xid_gtrid, "NULL"), 15, " ") AS "xid_gtrid ",'); + SET @columns = CONCAT(@columns, ' RPAD(IFNULL(xid_bqual, "NULL"), 15, " ") AS "xid_bqual ",'); + SET @columns = CONCAT(@columns, ' RPAD(IFNULL(xa_state, "NULL"), 12, " ") AS "xa_state ",'); + SET @columns = CONCAT(@columns, ' RPAD(IFNULL(gtid, "NULL"), 38, " ") AS "gtid ",'); + SET @columns = CONCAT(@columns, ' RPAD(access_mode, 11, " ") AS access_mode,'); + SET @columns = CONCAT(@columns, ' RPAD(isolation_level, 16, " ") AS "isolation_level ",'); + SET @columns = CONCAT(@columns, ' RPAD(autocommit, 10, " ") AS autocommit,'); + SET @columns = CONCAT(@columns, ' LPAD(number_of_savepoints, 10, " ") AS savepoints,'); + SET @columns = CONCAT(@columns, ' LPAD(number_of_rollback_to_savepoint, 21, " ") AS rollback_to_savepoint,'); + SET @columns = CONCAT(@columns, ' LPAD(number_of_release_savepoint, 17, " ") AS release_savepoint'); +# SET @query3 = CONCAT('SELECT " " AS "ACTUAL ", ', @columns, ' FROM ', table_name, ' ORDER BY event_id;'); + SET @query3 = CONCAT('SELECT', ' LPAD(@actual, 13, " ") AS "ROWS_ACTUAL ",', @columns, ' FROM ', table_name, ' ORDER BY event_id;'); + PREPARE stmt3 FROM @query3; + EXECUTE stmt3; + DEALLOCATE PREPARE stmt3; + + END IF; +END$$ + +DELIMITER ;$$ + +--enable_result_log + + + diff --git a/mysql-test/suite/perfschema/include/upgrade_check.inc b/mysql-test/suite/perfschema/include/upgrade_check.inc index 79a81311b05..7bc6d356175 100644 --- a/mysql-test/suite/perfschema/include/upgrade_check.inc +++ b/mysql-test/suite/perfschema/include/upgrade_check.inc @@ -14,3 +14,4 @@ --remove_file $MYSQLTEST_VARDIR/tmp/err_file --remove_file $MYSQLD_DATADIR/mysql_upgrade_info +--source include/mysql_upgrade_cleanup.inc \ No newline at end of file diff --git a/mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc b/mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc index a2ed41d9d1b..2375bdf1cac 100644 --- a/mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc +++ b/mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc @@ -14,7 +14,7 @@ let $wait_condition= # Because instrumentation is optional, we use "<=" here. let $wait_condition= - select count(*) <= 1 from performance_schema.threads + select count(*) <= 2 from performance_schema.threads where `TYPE`='FOREGROUND'; --source include/wait_condition.inc diff --git a/mysql-test/suite/perfschema/r/all_tests.result b/mysql-test/suite/perfschema/r/all_tests.result index 3f413ca9a1e..6b343d9d801 100644 --- a/mysql-test/suite/perfschema/r/all_tests.result +++ b/mysql-test/suite/perfschema/r/all_tests.result @@ -10,10 +10,13 @@ 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, "events_transactions_summary_", "ets_"); 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_"); +update t2 set test_name= replace(test_name, "memory_summary_", "mems_"); +update t2 set test_name= replace(test_name, "user_variables_", "uvar_"); 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 diff --git a/mysql-test/suite/perfschema/r/alter_table_progress.result b/mysql-test/suite/perfschema/r/alter_table_progress.result new file mode 100644 index 00000000000..6625f965079 --- /dev/null +++ b/mysql-test/suite/perfschema/r/alter_table_progress.result @@ -0,0 +1,79 @@ +drop table if exists t1; +create table t1(a int) engine = myisam; +insert into t1 values (1), (2), (3), (4), (5); +update performance_schema.threads +set instrumented = 'NO' + where processlist_id = connection_id(); +truncate table performance_schema.events_statements_history_long; +truncate table performance_schema.events_stages_history_long; +SET DEBUG_SYNC='RESET'; +SET DEBUG_SYNC='copy_data_between_tables_before SIGNAL found_row WAIT_FOR wait_row EXECUTE 5'; +ALTER TABLE t1 engine = innodb;; +SET DEBUG_SYNC='now WAIT_FOR found_row'; +select event_id from performance_schema.events_statements_current +where thread_id = @con1_thread_id into @con1_stmt_id; +select EVENT_NAME, WORK_COMPLETED, WORK_ESTIMATED +from performance_schema.events_stages_current +where (thread_id = @con1_thread_id); +EVENT_NAME WORK_COMPLETED WORK_ESTIMATED +stage/sql/copy to tmp table 0 5 +SET DEBUG_SYNC='now SIGNAL wait_row'; +SET DEBUG_SYNC='now WAIT_FOR found_row'; +select EVENT_NAME, WORK_COMPLETED, WORK_ESTIMATED +from performance_schema.events_stages_current +where (thread_id = @con1_thread_id); +EVENT_NAME WORK_COMPLETED WORK_ESTIMATED +stage/sql/copy to tmp table 1 5 +SET DEBUG_SYNC='now SIGNAL wait_row'; +SET DEBUG_SYNC='now WAIT_FOR found_row'; +select EVENT_NAME, WORK_COMPLETED, WORK_ESTIMATED +from performance_schema.events_stages_current +where (thread_id = @con1_thread_id); +EVENT_NAME WORK_COMPLETED WORK_ESTIMATED +stage/sql/copy to tmp table 2 5 +SET DEBUG_SYNC='now SIGNAL wait_row'; +SET DEBUG_SYNC='now WAIT_FOR found_row'; +select EVENT_NAME, WORK_COMPLETED, WORK_ESTIMATED +from performance_schema.events_stages_current +where (thread_id = @con1_thread_id); +EVENT_NAME WORK_COMPLETED WORK_ESTIMATED +stage/sql/copy to tmp table 3 5 +SET DEBUG_SYNC='now SIGNAL wait_row'; +SET DEBUG_SYNC='now WAIT_FOR found_row'; +select EVENT_NAME, WORK_COMPLETED, WORK_ESTIMATED +from performance_schema.events_stages_current +where (thread_id = @con1_thread_id); +EVENT_NAME WORK_COMPLETED WORK_ESTIMATED +stage/sql/copy to tmp table 4 5 +SET DEBUG_SYNC='now SIGNAL wait_row'; +select "After payload"; +After payload +After payload +Dumping ALTER TABLE stages +select EVENT_NAME, WORK_COMPLETED, WORK_ESTIMATED +from performance_schema.events_stages_history_long +where (thread_id = @con1_thread_id) +and (nesting_event_id = @con1_stmt_id) +order by thread_id, event_id; +EVENT_NAME WORK_COMPLETED WORK_ESTIMATED +stage/sql/starting NULL NULL +stage/sql/checking permissions NULL NULL +stage/sql/checking permissions NULL NULL +stage/sql/init NULL NULL +stage/sql/Opening tables NULL NULL +stage/sql/setup NULL NULL +stage/sql/creating table NULL NULL +stage/sql/After create NULL NULL +stage/sql/System lock NULL NULL +stage/sql/copy to tmp table 5 5 +stage/sql/rename result table NULL NULL +stage/sql/end NULL NULL +stage/sql/query end NULL NULL +stage/sql/closing tables NULL NULL +stage/sql/freeing items NULL NULL +stage/sql/cleaning up NULL NULL +SET DEBUG_SYNC='RESET'; +drop table t1; +update performance_schema.threads +set instrumented = 'YES' + where processlist_id = connection_id(); diff --git a/mysql-test/suite/perfschema/r/bad_option.result b/mysql-test/suite/perfschema/r/bad_option.result new file mode 100644 index 00000000000..7c61657af05 --- /dev/null +++ b/mysql-test/suite/perfschema/r/bad_option.result @@ -0,0 +1,4 @@ +# Server start with invalid startup option value 'performance-schema-enabled=maybe' : pass +# Server start with ambigous startup option 'performance-schema-max_=12' : pass +# Server start with invalid startup option '--performance-schema-unknown_99' : pass +# Server start with invalid startup option value '--datadir=bad_option_h_param' : pass diff --git a/mysql-test/suite/perfschema/r/bad_option_1.result b/mysql-test/suite/perfschema/r/bad_option_1.result deleted file mode 100644 index 05ff5663882..00000000000 --- a/mysql-test/suite/perfschema/r/bad_option_1.result +++ /dev/null @@ -1,4 +0,0 @@ -# Kill the server -Found: unknown variable 'performance-schema-enabled=maybe' -Found: Aborting -# restart diff --git a/mysql-test/suite/perfschema/r/bad_option_2.result b/mysql-test/suite/perfschema/r/bad_option_2.result deleted file mode 100644 index c2809525827..00000000000 --- a/mysql-test/suite/perfschema/r/bad_option_2.result +++ /dev/null @@ -1,3 +0,0 @@ -# Kill the server -FOUND 1 /ambiguous option '--performance-schema-max_=12'/ in bad_option_2.txt -# restart diff --git a/mysql-test/suite/perfschema/r/bad_option_3.result b/mysql-test/suite/perfschema/r/bad_option_3.result deleted file mode 100644 index 1981f0b2044..00000000000 --- a/mysql-test/suite/perfschema/r/bad_option_3.result +++ /dev/null @@ -1,4 +0,0 @@ -# Kill the server -Found: unknown option '-x' -Found: Aborting -# restart diff --git a/mysql-test/suite/perfschema/r/bad_option_4.result b/mysql-test/suite/perfschema/r/bad_option_4.result deleted file mode 100644 index 1d50a80be3d..00000000000 --- a/mysql-test/suite/perfschema/r/bad_option_4.result +++ /dev/null @@ -1,4 +0,0 @@ -# Kill the server -Found: Can't change dir to.*bad_option_h_param -Found: Aborting -# restart diff --git a/mysql-test/suite/perfschema/r/bad_option_5.result b/mysql-test/suite/perfschema/r/bad_option_5.result deleted file mode 100644 index 840717023ac..00000000000 --- a/mysql-test/suite/perfschema/r/bad_option_5.result +++ /dev/null @@ -1,4 +0,0 @@ -# Kill the server -Found: unknown option '-X' -Found: Aborting -# restart diff --git a/mysql-test/suite/perfschema/r/batch_table_io_func.result b/mysql-test/suite/perfschema/r/batch_table_io_func.result new file mode 100644 index 00000000000..9d923934c64 --- /dev/null +++ b/mysql-test/suite/perfschema/r/batch_table_io_func.result @@ -0,0 +1,186 @@ +UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES'; +UPDATE performance_schema.setup_instruments SET enabled = 'YES' +WHERE name in ('wait/io/table/sql/handler', +'wait/lock/table/sql/handler'); +drop procedure if exists before_payload; +drop procedure if exists after_payload; +create procedure before_payload() +begin +TRUNCATE TABLE performance_schema.table_io_waits_summary_by_index_usage; +TRUNCATE TABLE performance_schema.table_io_waits_summary_by_table; +TRUNCATE TABLE performance_schema.events_waits_history_long; +TRUNCATE TABLE performance_schema.events_waits_history; +TRUNCATE TABLE performance_schema.events_waits_current; +end +$$ +create procedure after_payload() +begin +select count(1) as number_seen, +OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME, INDEX_NAME, +OPERATION, NUMBER_OF_BYTES +from performance_schema.events_waits_history_long +where OBJECT_SCHEMA = "test" + group by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME, INDEX_NAME, OPERATION, NUMBER_OF_BYTES; +select OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME, INDEX_NAME, +COUNT_STAR, COUNT_READ, COUNT_WRITE +from performance_schema.table_io_waits_summary_by_index_usage +where OBJECT_SCHEMA = "test" + order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME, INDEX_NAME; +select OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME, +COUNT_STAR, COUNT_READ, COUNT_WRITE +from performance_schema.table_io_waits_summary_by_table +where OBJECT_SCHEMA = "test" + order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME; +end +$$ +drop table if exists t1; +drop table if exists t2; +drop table if exists t3; +create table t0(v int); +create table t1(id1 int, a int); +create table t2(id1 int, id2 int, b int); +create table t3(id2 int, id3 int, c int); +insert into t0 values +(0), (1), (2), (3), (4), +(5), (6), (7), (8), (9); +insert into t1(id1, a) +select v, 100*v from t0; +insert into t2(id1, id2, b) +select X.v, 10*X.v + Y.v, 100*X.v + 10*Y.v +from t0 X, t0 Y; +insert into t3(id2, id3, c) +select 10*X.v + Y.v, 100*X.v + 10*Y.v + Z.v, 100*X.v + 10*Y.v + Z.v +from t0 X, t0 Y, t0 Z; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +analyze table t3; +Table Op Msg_type Msg_text +test.t3 analyze status OK +select * from t1 order by a; +id1 a +0 0 +1 100 +2 200 +3 300 +4 400 +5 500 +6 600 +7 700 +8 800 +9 900 +select * from t2 +where (b >= 180) and (b <= 220) +order by b; +id1 id2 b +1 18 180 +1 19 190 +2 20 200 +2 21 210 +2 22 220 +select * from t3 +where (c >= 587) and (c <= 612) +order by c; +id2 id3 c +58 587 587 +58 588 588 +58 589 589 +59 590 590 +59 591 591 +59 592 592 +59 593 593 +59 594 594 +59 595 595 +59 596 596 +59 597 597 +59 598 598 +59 599 599 +60 600 600 +60 601 601 +60 602 602 +60 603 603 +60 604 604 +60 605 605 +60 606 606 +60 607 607 +60 608 608 +60 609 609 +61 610 610 +61 611 611 +61 612 612 +explain select t1.*, t2.*, t3.* +from t1 join t2 using (id1) join t3 using (id2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 100 10.00 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1000 10.00 Using where; Using join buffer (Block Nested Loop) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id1` AS `id1`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`id1` AS `id1`,`test`.`t2`.`id2` AS `id2`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`id2` AS `id2`,`test`.`t3`.`id3` AS `id3`,`test`.`t3`.`c` AS `c` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`id1` = `test`.`t1`.`id1`) and (`test`.`t3`.`id2` = `test`.`t2`.`id2`)) +call before_payload(); +select t1.*, t2.*, t3.* +from t1 join t2 using (id1) join t3 using (id2); +call after_payload(); +number_seen OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME INDEX_NAME OPERATION NUMBER_OF_BYTES +11 TABLE test t1 NULL fetch 1 +1 TABLE test t1 NULL read external NULL +101 TABLE test t2 NULL fetch 1 +1 TABLE test t2 NULL read external NULL +1 TABLE test t3 NULL fetch 1000 +1 TABLE test t3 NULL read external NULL +OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME INDEX_NAME COUNT_STAR COUNT_READ COUNT_WRITE +TABLE test t0 NULL 0 0 0 +TABLE test t1 NULL 11 11 0 +TABLE test t2 NULL 101 101 0 +TABLE test t3 NULL 1000 1000 0 +OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME COUNT_STAR COUNT_READ COUNT_WRITE +TABLE test t0 0 0 0 +TABLE test t1 11 11 0 +TABLE test t2 101 101 0 +TABLE test t3 1000 1000 0 +alter table t1 add unique index(id1); +alter table t2 add unique index(id2); +alter table t2 add index(id1); +alter table t3 add unique index(id3); +alter table t3 add index(id2); +explain select t1.*, t2.*, t3.* +from t1 join t2 using (id1) join t3 using (id2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL id1 NULL NULL NULL 10 100.00 Using where +1 SIMPLE t2 NULL ref id2,id1 id1 5 test.t1.id1 10 100.00 Using where +1 SIMPLE t3 NULL ref id2 id2 5 test.t2.id2 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id1` AS `id1`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`id1` AS `id1`,`test`.`t2`.`id2` AS `id2`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`id2` AS `id2`,`test`.`t3`.`id3` AS `id3`,`test`.`t3`.`c` AS `c` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`id1` = `test`.`t1`.`id1`) and (`test`.`t3`.`id2` = `test`.`t2`.`id2`)) +call before_payload(); +select t1.*, t2.*, t3.* +from t1 join t2 using (id1) join t3 using (id2); +call after_payload(); +number_seen OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME INDEX_NAME OPERATION NUMBER_OF_BYTES +11 TABLE test t1 NULL fetch 1 +1 TABLE test t1 id1 read external NULL +110 TABLE test t2 id1 fetch 1 +1 TABLE test t2 id2 read external NULL +100 TABLE test t3 id2 fetch 10 +1 TABLE test t3 id3 read external NULL +OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME INDEX_NAME COUNT_STAR COUNT_READ COUNT_WRITE +TABLE test t0 NULL 0 0 0 +TABLE test t1 NULL 11 11 0 +TABLE test t1 id1 0 0 0 +TABLE test t2 id1 110 110 0 +TABLE test t2 id2 0 0 0 +TABLE test t3 id2 1000 1000 0 +TABLE test t3 id3 0 0 0 +OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME COUNT_STAR COUNT_READ COUNT_WRITE +TABLE test t0 0 0 0 +TABLE test t1 11 11 0 +TABLE test t2 110 110 0 +TABLE test t3 1000 1000 0 +drop table t0; +drop table t1; +drop table t2; +drop table t3; +drop procedure before_payload; +drop procedure after_payload; +UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES'; diff --git a/mysql-test/suite/perfschema/r/binlog_edge_mix.result b/mysql-test/suite/perfschema/r/binlog_edge_mix.result index b9673e74855..e4b95cb69ff 100644 --- a/mysql-test/suite/perfschema/r/binlog_edge_mix.result +++ b/mysql-test/suite/perfschema/r/binlog_edge_mix.result @@ -84,19 +84,19 @@ Warnings: Note 1051 Unknown table 'test.marker_multi_delete' use my_replicated_db; insert into performance_schema.setup_actors -values ('FOO', 'FOO', 'FOO'); +values ('FOO', 'FOO', 'FOO', 'YES', 'YES'); delete my_tx_table.*, performance_schema.setup_actors.* from my_tx_table, performance_schema.setup_actors where my_tx_table.a != 1000 or performance_schema.setup_actors.role='FOO'; insert into performance_schema.setup_actors -values ('BAR', 'BAR', 'BAR'); +values ('BAR', 'BAR', 'BAR', 'YES', 'YES'); delete my_non_tx_table.*, performance_schema.setup_actors.* from my_non_tx_table, performance_schema.setup_actors where my_non_tx_table.a != 1000 or performance_schema.setup_actors.role='BAR'; insert into performance_schema.setup_actors -values ('BAZ', 'BAZ', 'BAZ'); +values ('BAZ', 'BAZ', 'BAZ', 'YES', 'YES'); delete my_bh_table.*, performance_schema.setup_actors.* from my_bh_table, performance_schema.setup_actors where my_bh_table.a != 1000 @@ -175,4 +175,4 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_end` /* generated by server */ master-bin.000001 # Query # # drop database my_replicated_db truncate table performance_schema.setup_actors; -insert into performance_schema.setup_actors values ('%', '%', '%'); +insert into performance_schema.setup_actors values ('%', '%', '%', 'YES', 'YES'); diff --git a/mysql-test/suite/perfschema/r/binlog_edge_row.result b/mysql-test/suite/perfschema/r/binlog_edge_row.result index 40595a804f7..52296de4bb9 100644 --- a/mysql-test/suite/perfschema/r/binlog_edge_row.result +++ b/mysql-test/suite/perfschema/r/binlog_edge_row.result @@ -86,19 +86,19 @@ Warnings: Note 1051 Unknown table 'test.marker_multi_delete' use my_replicated_db; insert into performance_schema.setup_actors -values ('FOO', 'FOO', 'FOO'); +values ('FOO', 'FOO', 'FOO', 'YES', 'YES'); delete my_tx_table.*, performance_schema.setup_actors.* from my_tx_table, performance_schema.setup_actors where my_tx_table.a != 1000 or performance_schema.setup_actors.role='FOO'; insert into performance_schema.setup_actors -values ('BAR', 'BAR', 'BAR'); +values ('BAR', 'BAR', 'BAR', 'YES', 'YES'); delete my_non_tx_table.*, performance_schema.setup_actors.* from my_non_tx_table, performance_schema.setup_actors where my_non_tx_table.a != 1000 or performance_schema.setup_actors.role='BAR'; insert into performance_schema.setup_actors -values ('BAZ', 'BAZ', 'BAZ'); +values ('BAZ', 'BAZ', 'BAZ', 'YES', 'YES'); delete my_bh_table.*, performance_schema.setup_actors.* from my_bh_table, performance_schema.setup_actors where my_bh_table.a != 1000 @@ -180,4 +180,4 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_end` /* generated by server */ master-bin.000001 # Query # # drop database my_replicated_db truncate table performance_schema.setup_actors; -insert into performance_schema.setup_actors values ('%', '%', '%'); +insert into performance_schema.setup_actors values ('%', '%', '%', 'YES', 'YES'); diff --git a/mysql-test/suite/perfschema/r/binlog_edge_stmt.result b/mysql-test/suite/perfschema/r/binlog_edge_stmt.result index fdbf34b07a2..2a09614179f 100644 --- a/mysql-test/suite/perfschema/r/binlog_edge_stmt.result +++ b/mysql-test/suite/perfschema/r/binlog_edge_stmt.result @@ -120,19 +120,19 @@ Warnings: Note 1051 Unknown table 'test.marker_multi_delete' use my_replicated_db; insert into performance_schema.setup_actors -values ('FOO', 'FOO', 'FOO'); +values ('FOO', 'FOO', 'FOO', 'YES', 'YES'); delete my_tx_table.*, performance_schema.setup_actors.* from my_tx_table, performance_schema.setup_actors where my_tx_table.a != 1000 or performance_schema.setup_actors.role='FOO'; insert into performance_schema.setup_actors -values ('BAR', 'BAR', 'BAR'); +values ('BAR', 'BAR', 'BAR', 'YES', 'YES'); delete my_non_tx_table.*, performance_schema.setup_actors.* from my_non_tx_table, performance_schema.setup_actors where my_non_tx_table.a != 1000 or performance_schema.setup_actors.role='BAR'; insert into performance_schema.setup_actors -values ('BAZ', 'BAZ', 'BAZ'); +values ('BAZ', 'BAZ', 'BAZ', 'YES', 'YES'); delete my_bh_table.*, performance_schema.setup_actors.* from my_bh_table, performance_schema.setup_actors where my_bh_table.a != 1000 @@ -255,4 +255,4 @@ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_multi_del master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_end` /* generated by server */ master-bin.000001 # Query # # drop database my_replicated_db truncate table performance_schema.setup_actors; -insert into performance_schema.setup_actors values ('%', '%', '%'); +insert into performance_schema.setup_actors values ('%', '%', '%', 'YES', 'YES'); diff --git a/mysql-test/suite/perfschema/r/binlog_ok_mix.result b/mysql-test/suite/perfschema/r/binlog_ok_mix.result index 3e6237e1256..cc2c08baa8d 100644 --- a/mysql-test/suite/perfschema/r/binlog_ok_mix.result +++ b/mysql-test/suite/perfschema/r/binlog_ok_mix.result @@ -43,10 +43,10 @@ values ('XXX', 'XXX', 'XXX'), ('ZZZ', 'ZZZ', 'ZZZ'); select * from performance_schema.setup_actors where user in ('XXX', 'YYY', 'ZZZ') order by user; -HOST USER ROLE -XXX XXX XXX -YYY YYY YYY -ZZZ ZZZ ZZZ +HOST USER ROLE ENABLED HISTORY +XXX XXX XXX YES YES +YYY YYY YYY YES YES +ZZZ ZZZ ZZZ YES YES insert into performance_schema.setup_objects (object_type, object_schema, object_name, enabled, timed) values ('TABLE', 'DB1', 'AAA', 'YES', 'YES'), diff --git a/mysql-test/suite/perfschema/r/binlog_ok_row.result b/mysql-test/suite/perfschema/r/binlog_ok_row.result index 5cf9062138c..0beea6ae878 100644 --- a/mysql-test/suite/perfschema/r/binlog_ok_row.result +++ b/mysql-test/suite/perfschema/r/binlog_ok_row.result @@ -43,10 +43,10 @@ values ('XXX', 'XXX', 'XXX'), ('ZZZ', 'ZZZ', 'ZZZ'); select * from performance_schema.setup_actors where user in ('XXX', 'YYY', 'ZZZ') order by user; -HOST USER ROLE -XXX XXX XXX -YYY YYY YYY -ZZZ ZZZ ZZZ +HOST USER ROLE ENABLED HISTORY +XXX XXX XXX YES YES +YYY YYY YYY YES YES +ZZZ ZZZ ZZZ YES YES insert into performance_schema.setup_objects (object_type, object_schema, object_name, enabled, timed) values ('TABLE', 'DB1', 'AAA', 'YES', 'YES'), diff --git a/mysql-test/suite/perfschema/r/binlog_ok_stmt.result b/mysql-test/suite/perfschema/r/binlog_ok_stmt.result index fe71c3024d1..9fd9af6c383 100644 --- a/mysql-test/suite/perfschema/r/binlog_ok_stmt.result +++ b/mysql-test/suite/perfschema/r/binlog_ok_stmt.result @@ -43,10 +43,10 @@ values ('XXX', 'XXX', 'XXX'), ('ZZZ', 'ZZZ', 'ZZZ'); select * from performance_schema.setup_actors where user in ('XXX', 'YYY', 'ZZZ') order by user; -HOST USER ROLE -XXX XXX XXX -YYY YYY YYY -ZZZ ZZZ ZZZ +HOST USER ROLE ENABLED HISTORY +XXX XXX XXX YES YES +YYY YYY YYY YES YES +ZZZ ZZZ ZZZ YES YES insert into performance_schema.setup_objects (object_type, object_schema, object_name, enabled, timed) values ('TABLE', 'DB1', 'AAA', 'YES', 'YES'), diff --git a/mysql-test/suite/perfschema/r/checksum.result b/mysql-test/suite/perfschema/r/checksum.result index f2a0f5a7713..1ed6e70e6de 100644 --- a/mysql-test/suite/perfschema/r/checksum.result +++ b/mysql-test/suite/perfschema/r/checksum.result @@ -16,6 +16,14 @@ checksum table performance_schema.events_statements_summary_by_host_by_event_nam 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_transactions_current; +checksum table performance_schema.events_transactions_history; +checksum table performance_schema.events_transactions_history_long; +checksum table performance_schema.events_transactions_summary_by_account_by_event_name; +checksum table performance_schema.events_transactions_summary_by_host_by_event_name; +checksum table performance_schema.events_transactions_summary_by_thread_by_event_name; +checksum table performance_schema.events_transactions_summary_by_user_by_event_name; +checksum table performance_schema.events_transactions_summary_global_by_event_name; checksum table performance_schema.events_waits_current; checksum table performance_schema.events_waits_history; checksum table performance_schema.events_waits_history_long; @@ -61,6 +69,14 @@ checksum table performance_schema.events_statements_summary_by_host_by_event_nam 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_transactions_current extended; +checksum table performance_schema.events_transactions_history extended; +checksum table performance_schema.events_transactions_history_long extended; +checksum table performance_schema.events_transactions_summary_by_account_by_event_name extended; +checksum table performance_schema.events_transactions_summary_by_host_by_event_name extended; +checksum table performance_schema.events_transactions_summary_by_thread_by_event_name extended; +checksum table performance_schema.events_transactions_summary_by_user_by_event_name extended; +checksum table performance_schema.events_transactions_summary_global_by_event_name extended; checksum table performance_schema.events_waits_current extended; checksum table performance_schema.events_waits_history extended; checksum table performance_schema.events_waits_history_long extended; diff --git a/mysql-test/suite/perfschema/r/cnf_option.result b/mysql-test/suite/perfschema/r/cnf_option.result index 85adfb5113d..c991311d136 100644 --- a/mysql-test/suite/perfschema/r/cnf_option.result +++ b/mysql-test/suite/perfschema/r/cnf_option.result @@ -1,6 +1,6 @@ -show variables like 'performance_schema_max_thread_classes'; +show global variables like 'performance_schema_max_thread_classes'; Variable_name Value performance_schema_max_thread_classes 12 -show variables like 'performance_schema_max_thread_instances'; +show global variables like 'performance_schema_max_thread_instances'; Variable_name Value performance_schema_max_thread_instances 318 diff --git a/mysql-test/suite/perfschema/r/connect_attrs.result b/mysql-test/suite/perfschema/r/connect_attrs.result index 5e45a4cd900..1ed8e16b6ca 100644 --- a/mysql-test/suite/perfschema/r/connect_attrs.result +++ b/mysql-test/suite/perfschema/r/connect_attrs.result @@ -37,10 +37,15 @@ SELECT COUNT(DISTINCT PROCESSLIST_ID) FROM performance_schema.session_connect_attrs; COUNT(DISTINCT PROCESSLIST_ID) 2 +<<<<<<< HEAD connection non_privileged_user; +======= +# must return 1 +>>>>>>> merge-perfschema-5.7 SELECT COUNT(DISTINCT PROCESSLIST_ID) FROM performance_schema.session_account_connect_attrs; -ERROR 42000: SELECT command denied to user 'wl5924'@'localhost' for table 'session_account_connect_attrs' +COUNT(DISTINCT PROCESSLIST_ID) +1 SELECT COUNT(DISTINCT PROCESSLIST_ID) FROM performance_schema.session_connect_attrs; ERROR 42000: SELECT command denied to user 'wl5924'@'localhost' for table 'session_connect_attrs' diff --git a/mysql-test/suite/perfschema/r/connection.result b/mysql-test/suite/perfschema/r/connection.result index 332b5a43466..d581e5b0b08 100644 --- a/mysql-test/suite/perfschema/r/connection.result +++ b/mysql-test/suite/perfschema/r/connection.result @@ -1,3 +1,17 @@ +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. call dump_all(); processlist_user processlist_host root localhost @@ -11,7 +25,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con1a, localhost, user1, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user1 in con1a" as status; status user1 in con1a @@ -31,7 +50,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con1b, localhost, user1, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user1 in con1b" as status; status user1 in con1b @@ -52,7 +76,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con1c, localhost, user1, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user1 in con1c" as status; status user1 in con1c @@ -74,7 +103,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con2a, localhost, user2, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user2 in con2a" as status; status user2 in con2a @@ -99,7 +133,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con2b, localhost, user2, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user2 in con2b" as status; status user2 in con2b @@ -125,7 +164,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con2c, localhost, user2, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user2 in con2c" as status; status user2 in con2c @@ -152,7 +196,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con3a, localhost, user3, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user3 in con3a" as status; status user3 in con3a @@ -182,7 +231,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con3b, localhost, user3, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user3 in con3b" as status; status user3 in con3b @@ -213,7 +267,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con3c, localhost, user3, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user3 in con3c" as status; status user3 in con3c @@ -245,8 +304,13 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connection default; disconnect con1a; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con1a disconnected" as status; status con1a disconnected @@ -277,7 +341,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con2a; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con2a disconnected" as status; status con2a disconnected @@ -307,7 +376,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con3a; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con3a disconnected" as status; status con3a disconnected @@ -336,6 +410,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.accounts; call dump_all(); processlist_user processlist_host @@ -362,6 +438,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.users; call dump_all(); processlist_user processlist_host @@ -388,6 +466,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.hosts; call dump_all(); processlist_user processlist_host @@ -414,7 +494,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con4a, localhost, user4, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user4 in con4a" as status; status user4 in con4a @@ -446,7 +531,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con4b, localhost, user4, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user4 in con4b" as status; status user4 in con4b @@ -479,7 +569,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con4c, localhost, user4, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user4 in con4c" as status; status user4 in con4c @@ -513,8 +608,13 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connection default; disconnect con1b; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con1b disconnected" as status; status con1b disconnected @@ -547,7 +647,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con2b; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con2b disconnected" as status; status con2b disconnected @@ -579,7 +684,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con3b; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con3b disconnected" as status; status con3b disconnected @@ -610,7 +720,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con1c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con1c disconnected" as status; status con1c disconnected @@ -640,7 +755,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con2c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con2c disconnected" as status; status con2c disconnected @@ -669,7 +789,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con3c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con3c disconnected" as status; status con3c disconnected @@ -697,6 +822,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.accounts; call dump_all(); processlist_user processlist_host @@ -719,6 +846,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.users; call dump_all(); processlist_user processlist_host @@ -738,6 +867,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.hosts; call dump_all(); processlist_user processlist_host @@ -757,7 +888,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con5a, localhost, user5, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user5 in con5a" as status; status user5 in con5a @@ -782,7 +918,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con5b, localhost, user5, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user5 in con5b" as status; status user5 in con5b @@ -808,7 +949,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con5c, localhost, user5, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user5 in con5c" as status; status user5 in con5c @@ -835,6 +981,7 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connection default; disconnect con4a; disconnect con4b; @@ -842,6 +989,10 @@ disconnect con4c; disconnect con5a; disconnect con5b; disconnect con5c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status; status con 5a, 5b, 5c, 6a, 6b, 6c disconnected @@ -862,6 +1013,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.hosts; call dump_all(); processlist_user processlist_host @@ -878,6 +1031,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.users; call dump_all(); processlist_user processlist_host @@ -892,6 +1047,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.accounts; call dump_all(); processlist_user processlist_host @@ -906,3 +1063,5 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead diff --git a/mysql-test/suite/perfschema/r/connection_3a.result b/mysql-test/suite/perfschema/r/connection_3a.result index e799864edfd..27c4c55de89 100644 --- a/mysql-test/suite/perfschema/r/connection_3a.result +++ b/mysql-test/suite/perfschema/r/connection_3a.result @@ -1,3 +1,17 @@ +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. call dump_all(); processlist_user processlist_host root localhost @@ -11,7 +25,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con1a, localhost, user1, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user1 in con1a" as status; status user1 in con1a @@ -31,7 +50,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con1b, localhost, user1, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user1 in con1b" as status; status user1 in con1b @@ -52,7 +76,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con1c, localhost, user1, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user1 in con1c" as status; status user1 in con1c @@ -74,7 +103,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con2a, localhost, user2, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user2 in con2a" as status; status user2 in con2a @@ -98,7 +132,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 1 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con2b, localhost, user2, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user2 in con2b" as status; status user2 in con2b @@ -123,7 +162,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 2 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con2c, localhost, user2, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user2 in con2c" as status; status user2 in con2c @@ -149,7 +193,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 3 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con3a, localhost, user3, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user3 in con3a" as status; status user3 in con3a @@ -177,7 +226,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 4 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con3b, localhost, user3, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user3 in con3b" as status; status user3 in con3b @@ -206,7 +260,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 5 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con3c, localhost, user3, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user3 in con3c" as status; status user3 in con3c @@ -236,8 +295,13 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connection default; disconnect con1a; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con1a disconnected" as status; status con1a disconnected @@ -266,7 +330,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con2a; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con2a disconnected" as status; status con2a disconnected @@ -294,7 +363,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con3a; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con3a disconnected" as status; status con3a disconnected @@ -321,6 +395,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.accounts; call dump_all(); processlist_user processlist_host @@ -345,6 +421,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.users; call dump_all(); processlist_user processlist_host @@ -369,6 +447,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.hosts; call dump_all(); processlist_user processlist_host @@ -393,7 +473,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con4a, localhost, user4, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user4 in con4a" as status; status user4 in con4a @@ -422,7 +507,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 7 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con4b, localhost, user4, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user4 in con4b" as status; status user4 in con4b @@ -452,7 +542,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 8 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con4c, localhost, user4, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user4 in con4c" as status; status user4 in con4c @@ -483,8 +578,13 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connection default; disconnect con1b; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con1b disconnected" as status; status con1b disconnected @@ -514,7 +614,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con2b; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con2b disconnected" as status; status con2b disconnected @@ -543,7 +648,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con3b; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con3b disconnected" as status; status con3b disconnected @@ -571,7 +681,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con1c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con1c disconnected" as status; status con1c disconnected @@ -598,7 +713,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con2c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con2c disconnected" as status; status con2c disconnected @@ -624,7 +744,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD disconnect con3c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con3c disconnected" as status; status con3c disconnected @@ -649,6 +774,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.accounts; call dump_all(); processlist_user processlist_host @@ -670,6 +797,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.users; call dump_all(); processlist_user processlist_host @@ -688,6 +817,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.hosts; call dump_all(); processlist_user processlist_host @@ -706,7 +837,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con5a, localhost, user5, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user5 in con5a" as status; status user5 in con5a @@ -730,7 +866,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con5b, localhost, user5, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user5 in con5b" as status; status user5 in con5b @@ -755,7 +896,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con5c, localhost, user5, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user5 in con5c" as status; status user5 in con5c @@ -781,6 +927,7 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connection default; disconnect con4a; disconnect con4b; @@ -788,6 +935,10 @@ disconnect con4c; disconnect con5a; disconnect con5b; disconnect con5c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status; status con 5a, 5b, 5c, 6a, 6b, 6c disconnected @@ -807,6 +958,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.hosts; call dump_all(); processlist_user processlist_host @@ -823,6 +976,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.users; call dump_all(); processlist_user processlist_host @@ -837,6 +992,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.accounts; call dump_all(); processlist_user processlist_host @@ -851,3 +1008,5 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead diff --git a/mysql-test/suite/perfschema/r/connection_3a_3u.result b/mysql-test/suite/perfschema/r/connection_3a_3u.result index a3758a6ace1..7308af46189 100644 --- a/mysql-test/suite/perfschema/r/connection_3a_3u.result +++ b/mysql-test/suite/perfschema/r/connection_3a_3u.result @@ -1,3 +1,17 @@ +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. call dump_all(); processlist_user processlist_host root localhost @@ -11,7 +25,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con1a, localhost, user1, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user1 in con1a" as status; status user1 in con1a @@ -31,7 +50,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con1b, localhost, user1, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user1 in con1b" as status; status user1 in con1b @@ -52,7 +76,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con1c, localhost, user1, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user1 in con1c" as status; status user1 in con1c @@ -74,7 +103,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con2a, localhost, user2, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user2 in con2a" as status; status user2 in con2a @@ -97,7 +131,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 1 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 1 +<<<<<<< HEAD connect con2b, localhost, user2, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user2 in con2b" as status; status user2 in con2b @@ -121,7 +160,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 2 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 2 +<<<<<<< HEAD connect con2c, localhost, user2, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user2 in con2c" as status; status user2 in con2c @@ -146,7 +190,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 3 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD connect con3a, localhost, user3, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user3 in con3a" as status; status user3 in con3a @@ -172,7 +221,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 4 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 4 +<<<<<<< HEAD connect con3b, localhost, user3, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user3 in con3b" as status; status user3 in con3b @@ -199,7 +253,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 5 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 5 +<<<<<<< HEAD connect con3c, localhost, user3, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user3 in con3c" as status; status user3 in con3c @@ -227,8 +286,13 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 6 +<<<<<<< HEAD connection default; disconnect con1a; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con1a disconnected" as status; status con1a disconnected @@ -255,7 +319,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 6 +<<<<<<< HEAD disconnect con2a; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con2a disconnected" as status; status con2a disconnected @@ -281,7 +350,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 6 +<<<<<<< HEAD disconnect con3a; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con3a disconnected" as status; status con3a disconnected @@ -306,6 +380,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 6 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.accounts; call dump_all(); processlist_user processlist_host @@ -328,6 +404,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 6 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.users; call dump_all(); processlist_user processlist_host @@ -350,6 +428,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 6 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.hosts; call dump_all(); processlist_user processlist_host @@ -372,7 +452,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 6 +<<<<<<< HEAD connect con4a, localhost, user4, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user4 in con4a" as status; status user4 in con4a @@ -398,7 +483,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 7 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 7 +<<<<<<< HEAD connect con4b, localhost, user4, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user4 in con4b" as status; status user4 in con4b @@ -425,7 +515,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 8 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 8 +<<<<<<< HEAD connect con4c, localhost, user4, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user4 in con4c" as status; status user4 in con4c @@ -453,8 +548,13 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +<<<<<<< HEAD connection default; disconnect con1b; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con1b disconnected" as status; status con1b disconnected @@ -481,7 +581,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +<<<<<<< HEAD disconnect con2b; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con2b disconnected" as status; status con2b disconnected @@ -507,7 +612,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +<<<<<<< HEAD disconnect con3b; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con3b disconnected" as status; status con3b disconnected @@ -532,7 +642,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +<<<<<<< HEAD disconnect con1c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con1c disconnected" as status; status con1c disconnected @@ -556,7 +671,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +<<<<<<< HEAD disconnect con2c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con2c disconnected" as status; status con2c disconnected @@ -579,7 +699,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +<<<<<<< HEAD disconnect con3c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con3c disconnected" as status; status con3c disconnected @@ -601,6 +726,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.accounts; call dump_all(); processlist_user processlist_host @@ -619,6 +746,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.users; call dump_all(); processlist_user processlist_host @@ -636,6 +765,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.hosts; call dump_all(); processlist_user processlist_host @@ -653,7 +784,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +<<<<<<< HEAD connect con5a, localhost, user5, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user5 in con5a" as status; status user5 in con5a @@ -676,7 +812,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +<<<<<<< HEAD connect con5b, localhost, user5, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user5 in con5b" as status; status user5 in con5b @@ -700,7 +841,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +<<<<<<< HEAD connect con5c, localhost, user5, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user5 in con5c" as status; status user5 in con5c @@ -725,6 +871,7 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +<<<<<<< HEAD connection default; disconnect con4a; disconnect con4b; @@ -732,6 +879,10 @@ disconnect con4c; disconnect con5a; disconnect con5b; disconnect con5c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status; status con 5a, 5b, 5c, 6a, 6b, 6c disconnected @@ -750,6 +901,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.hosts; call dump_all(); processlist_user processlist_host @@ -765,6 +918,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.users; call dump_all(); processlist_user processlist_host @@ -779,6 +934,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.accounts; call dump_all(); processlist_user processlist_host @@ -793,3 +950,5 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 9 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead diff --git a/mysql-test/suite/perfschema/r/connection_3u.result b/mysql-test/suite/perfschema/r/connection_3u.result index 7bb5691c7f6..4d46959a7af 100644 --- a/mysql-test/suite/perfschema/r/connection_3u.result +++ b/mysql-test/suite/perfschema/r/connection_3u.result @@ -1,3 +1,17 @@ +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. call dump_all(); processlist_user processlist_host root localhost @@ -11,7 +25,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con1a, localhost, user1, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user1 in con1a" as status; status user1 in con1a @@ -31,7 +50,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con1b, localhost, user1, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user1 in con1b" as status; status user1 in con1b @@ -52,7 +76,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con1c, localhost, user1, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user1 in con1c" as status; status user1 in con1c @@ -74,7 +103,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 0 +<<<<<<< HEAD connect con2a, localhost, user2, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user2 in con2a" as status; status user2 in con2a @@ -98,7 +132,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 1 +<<<<<<< HEAD connect con2b, localhost, user2, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user2 in con2b" as status; status user2 in con2b @@ -123,7 +162,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 1 +<<<<<<< HEAD connect con2c, localhost, user2, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user2 in con2c" as status; status user2 in con2c @@ -149,7 +193,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 1 +<<<<<<< HEAD connect con3a, localhost, user3, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user3 in con3a" as status; status user3 in con3a @@ -177,7 +226,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 2 +<<<<<<< HEAD connect con3b, localhost, user3, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user3 in con3b" as status; status user3 in con3b @@ -206,7 +260,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 2 +<<<<<<< HEAD connect con3c, localhost, user3, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user3 in con3c" as status; status user3 in con3c @@ -236,8 +295,13 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 2 +<<<<<<< HEAD connection default; disconnect con1a; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con1a disconnected" as status; status con1a disconnected @@ -266,7 +330,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 2 +<<<<<<< HEAD disconnect con2a; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con2a disconnected" as status; status con2a disconnected @@ -294,7 +363,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 2 +<<<<<<< HEAD disconnect con3a; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con3a disconnected" as status; status con3a disconnected @@ -321,6 +395,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 2 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.accounts; call dump_all(); processlist_user processlist_host @@ -345,6 +421,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 2 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.users; call dump_all(); processlist_user processlist_host @@ -369,6 +447,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 2 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.hosts; call dump_all(); processlist_user processlist_host @@ -393,7 +473,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 2 +<<<<<<< HEAD connect con4a, localhost, user4, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user4 in con4a" as status; status user4 in con4a @@ -422,7 +507,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD connect con4b, localhost, user4, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user4 in con4b" as status; status user4 in con4b @@ -452,7 +542,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD connect con4c, localhost, user4, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user4 in con4c" as status; status user4 in con4c @@ -483,8 +578,13 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD connection default; disconnect con1b; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con1b disconnected" as status; status con1b disconnected @@ -514,7 +614,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD disconnect con2b; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con2b disconnected" as status; status con2b disconnected @@ -543,7 +648,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD disconnect con3b; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con3b disconnected" as status; status con3b disconnected @@ -571,7 +681,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD disconnect con1c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con1c disconnected" as status; status con1c disconnected @@ -598,7 +713,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD disconnect con2c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con2c disconnected" as status; status con2c disconnected @@ -624,7 +744,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD disconnect con3c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con3c disconnected" as status; status con3c disconnected @@ -649,6 +774,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.accounts; call dump_all(); processlist_user processlist_host @@ -668,6 +795,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.users; call dump_all(); processlist_user processlist_host @@ -686,6 +815,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.hosts; call dump_all(); processlist_user processlist_host @@ -704,7 +835,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD connect con5a, localhost, user5, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user5 in con5a" as status; status user5 in con5a @@ -728,7 +864,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD connect con5b, localhost, user5, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user5 in con5b" as status; status user5 in con5b @@ -753,7 +894,12 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD connect con5c, localhost, user5, , ; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "user5 in con5c" as status; status user5 in con5c @@ -779,6 +925,7 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +<<<<<<< HEAD connection default; disconnect con4a; disconnect con4b; @@ -786,6 +933,10 @@ disconnect con4c; disconnect con5a; disconnect con5b; disconnect con5c; +======= +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead +>>>>>>> merge-perfschema-5.7 select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status; status con 5a, 5b, 5c, 6a, 6b, 6c disconnected @@ -805,6 +956,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.hosts; call dump_all(); processlist_user processlist_host @@ -820,6 +973,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.users; call dump_all(); processlist_user processlist_host @@ -834,6 +989,8 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead truncate table performance_schema.accounts; call dump_all(); processlist_user processlist_host @@ -848,3 +1005,5 @@ variable_name variable_value PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0 PERFORMANCE_SCHEMA_HOSTS_LOST 0 PERFORMANCE_SCHEMA_USERS_LOST 3 +Warnings: +Warning 1287 'INFORMATION_SCHEMA.GLOBAL_STATUS' is deprecated and will be removed in a future release. Please use performance_schema.global_status instead diff --git a/mysql-test/suite/perfschema/r/connection_type_notwin.result b/mysql-test/suite/perfschema/r/connection_type_notwin.result new file mode 100644 index 00000000000..c859809cdf0 --- /dev/null +++ b/mysql-test/suite/perfschema/r/connection_type_notwin.result @@ -0,0 +1,74 @@ +"Default connection" +select NAME, PROCESSLIST_USER, PROCESSLIST_HOST, CONNECTION_TYPE +from performance_schema.threads +where PROCESSLIST_ID = connection_id(); +NAME thread/sql/one_connection +PROCESSLIST_USER root +PROCESSLIST_HOST localhost +CONNECTION_TYPE Socket +create user 'root'@'santa.claus.ipv4.example.com'; +grant select on *.* to 'root'@'santa.claus.ipv4.example.com'; +create user 'rootssl'@'santa.claus.ipv4.example.com' + require SSL; +grant select on *.* to 'rootssl'@'santa.claus.ipv4.example.com'; +set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4"; +TRUNCATE TABLE mysql.general_log; +SET @old_log_output= @@global.log_output; +SET @old_general_log= @@global.general_log; +SET @old_general_log_file= @@global.general_log_file; +SET GLOBAL general_log_file = '.../log/rewrite_general_con.log'; +SET GLOBAL log_output = 'FILE,TABLE'; +SET GLOBAL general_log= 'ON'; +"Connection con1" +select NAME, PROCESSLIST_USER, PROCESSLIST_HOST, CONNECTION_TYPE +from performance_schema.threads +where PROCESSLIST_ID = connection_id(); +NAME thread/sql/one_connection +PROCESSLIST_USER root +PROCESSLIST_HOST localhost +CONNECTION_TYPE Socket +"Connection con2" +select NAME, PROCESSLIST_USER, PROCESSLIST_HOST, CONNECTION_TYPE +from performance_schema.threads +where PROCESSLIST_ID = connection_id(); +NAME thread/sql/one_connection +PROCESSLIST_USER root +PROCESSLIST_HOST santa.claus.ipv4.example.com +CONNECTION_TYPE TCP/IP +"Connection con3" +select NAME, PROCESSLIST_USER, PROCESSLIST_HOST, CONNECTION_TYPE +from performance_schema.threads +where PROCESSLIST_ID = connection_id(); +NAME thread/sql/one_connection +PROCESSLIST_USER rootssl +PROCESSLIST_HOST santa.claus.ipv4.example.com +CONNECTION_TYPE SSL/TLS +SET GLOBAL general_log= 'OFF'; +CREATE TABLE test_log (argument TEXT); +LOAD DATA LOCAL INFILE '.../log/rewrite_general_con.log' + INTO TABLE test_log FIELDS TERMINATED BY '\n' LINES TERMINATED BY '\n'; +select user_host, command_type, argument from mysql.general_log +where command_type = "Connect"; +user_host [root] @ localhost [] +command_type Connect +argument root@localhost on test using Socket +user_host [root] @ santa.claus.ipv4.example.com [192.0.2.4] +command_type Connect +argument root@santa.claus.ipv4.example.com on test using TCP/IP +user_host [rootssl] @ santa.claus.ipv4.example.com [192.0.2.4] +command_type Connect +argument rootssl@santa.claus.ipv4.example.com on test using SSL/TLS +select substring(argument, locate("Connect", argument)) from test_log +where argument like "%Connect%on test%"; +substring(argument, locate("Connect", argument)) Connect root@localhost on test using Socket +substring(argument, locate("Connect", argument)) Connect root@santa.claus.ipv4.example.com on test using TCP/IP +substring(argument, locate("Connect", argument)) Connect rootssl@santa.claus.ipv4.example.com on test using SSL/TLS +DROP TABLE test_log; +SET GLOBAL general_log_file= @old_general_log_file; +SET GLOBAL general_log= @old_general_log; +SET GLOBAL log_output= @old_log_output; +set global debug= default; +revoke select on *.* from 'root'@'santa.claus.ipv4.example.com'; +drop user 'root'@'santa.claus.ipv4.example.com'; +revoke select on *.* from 'rootssl'@'santa.claus.ipv4.example.com'; +drop user 'rootssl'@'santa.claus.ipv4.example.com'; diff --git a/mysql-test/suite/perfschema/r/connection_type_win.result b/mysql-test/suite/perfschema/r/connection_type_win.result new file mode 100644 index 00000000000..1fa24c810c2 --- /dev/null +++ b/mysql-test/suite/perfschema/r/connection_type_win.result @@ -0,0 +1,74 @@ +"Default connection" +select NAME, PROCESSLIST_USER, PROCESSLIST_HOST, CONNECTION_TYPE +from performance_schema.threads +where PROCESSLIST_ID = connection_id(); +NAME thread/sql/one_connection +PROCESSLIST_USER root +PROCESSLIST_HOST localhost +CONNECTION_TYPE TCP/IP +create user 'root'@'santa.claus.ipv4.example.com'; +grant select on *.* to 'root'@'santa.claus.ipv4.example.com'; +create user 'rootssl'@'santa.claus.ipv4.example.com' + require SSL; +grant select on *.* to 'rootssl'@'santa.claus.ipv4.example.com'; +set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4"; +TRUNCATE TABLE mysql.general_log; +SET @old_log_output= @@global.log_output; +SET @old_general_log= @@global.general_log; +SET @old_general_log_file= @@global.general_log_file; +SET GLOBAL general_log_file = '.../log/rewrite_general_con.log'; +SET GLOBAL log_output = 'FILE,TABLE'; +SET GLOBAL general_log= 'ON'; +"Connection con1" +select NAME, PROCESSLIST_USER, PROCESSLIST_HOST, CONNECTION_TYPE +from performance_schema.threads +where PROCESSLIST_ID = connection_id(); +NAME thread/sql/one_connection +PROCESSLIST_USER root +PROCESSLIST_HOST santa.claus.ipv4.example.com +CONNECTION_TYPE TCP/IP +"Connection con2" +select NAME, PROCESSLIST_USER, PROCESSLIST_HOST, CONNECTION_TYPE +from performance_schema.threads +where PROCESSLIST_ID = connection_id(); +NAME thread/sql/one_connection +PROCESSLIST_USER root +PROCESSLIST_HOST santa.claus.ipv4.example.com +CONNECTION_TYPE TCP/IP +"Connection con3" +select NAME, PROCESSLIST_USER, PROCESSLIST_HOST, CONNECTION_TYPE +from performance_schema.threads +where PROCESSLIST_ID = connection_id(); +NAME thread/sql/one_connection +PROCESSLIST_USER rootssl +PROCESSLIST_HOST santa.claus.ipv4.example.com +CONNECTION_TYPE SSL/TLS +SET GLOBAL general_log= 'OFF'; +CREATE TABLE test_log (argument TEXT); +LOAD DATA LOCAL INFILE '.../log/rewrite_general_con.log' + INTO TABLE test_log FIELDS TERMINATED BY '\n' LINES TERMINATED BY '\n'; +select user_host, command_type, argument from mysql.general_log +where command_type = "Connect"; +user_host [root] @ santa.claus.ipv4.example.com [192.0.2.4] +command_type Connect +argument root@santa.claus.ipv4.example.com on test using TCP/IP +user_host [root] @ santa.claus.ipv4.example.com [192.0.2.4] +command_type Connect +argument root@santa.claus.ipv4.example.com on test using TCP/IP +user_host [rootssl] @ santa.claus.ipv4.example.com [192.0.2.4] +command_type Connect +argument rootssl@santa.claus.ipv4.example.com on test using SSL/TLS +select substring(argument, locate("Connect", argument)) from test_log +where argument like "%Connect%on test%"; +substring(argument, locate("Connect", argument)) Connect root@santa.claus.ipv4.example.com on test using TCP/IP +substring(argument, locate("Connect", argument)) Connect root@santa.claus.ipv4.example.com on test using TCP/IP +substring(argument, locate("Connect", argument)) Connect rootssl@santa.claus.ipv4.example.com on test using SSL/TLS +DROP TABLE test_log; +SET GLOBAL general_log_file= @old_general_log_file; +SET GLOBAL general_log= @old_general_log; +SET GLOBAL log_output= @old_log_output; +set global debug= default; +revoke select on *.* from 'root'@'santa.claus.ipv4.example.com'; +drop user 'root'@'santa.claus.ipv4.example.com'; +revoke select on *.* from 'rootssl'@'santa.claus.ipv4.example.com'; +drop user 'rootssl'@'santa.claus.ipv4.example.com'; diff --git a/mysql-test/suite/perfschema/r/csv_table_io.result b/mysql-test/suite/perfschema/r/csv_table_io.result index 84b39119dd8..7fad123e35c 100644 --- a/mysql-test/suite/perfschema/r/csv_table_io.result +++ b/mysql-test/suite/perfschema/r/csv_table_io.result @@ -70,6 +70,7 @@ 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 +<<<<<<< HEAD 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 @@ -113,6 +114,42 @@ 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 where Variable_name like 'performance_schema_%' and Variable_name not like 'performance_schema_%_classes_lost'; +======= +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert 1 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert 1 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab insert 1 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch 3 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab update 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch 1 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch 2 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab delete 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch 1 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch 2 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch 2 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +wait/io/table/sql/handler handler.cc: TABLE test marker insert 1 +show global status like 'performance_schema_%'; +>>>>>>> 258e16fa2de... WIP 5.7 P_S Variable_name Value Performance_schema_accounts_lost 0 Performance_schema_cond_instances_lost 0 @@ -120,13 +157,30 @@ Performance_schema_digest_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 +Performance_schema_index_stat_lost 0 Performance_schema_locker_lost 0 +<<<<<<< HEAD Performance_schema_mutex_instances_lost 0 +======= +Performance_schema_memory_classes_lost 0 +Performance_schema_metadata_lock_lost 0 +Performance_schema_mutex_classes_lost 0 +Performance_schema_mutex_instances_lost 0 +Performance_schema_nested_statement_lost 0 +Performance_schema_prepared_statements_lost 0 +Performance_schema_program_lost 0 +Performance_schema_rwlock_classes_lost 0 +>>>>>>> 258e16fa2de... WIP 5.7 P_S Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 Performance_schema_socket_instances_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 +<<<<<<< HEAD +======= +Performance_schema_table_lock_stat_lost 0 +Performance_schema_thread_classes_lost 0 +>>>>>>> 258e16fa2de... WIP 5.7 P_S Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/ddl_esms_by_program.result b/mysql-test/suite/perfschema/r/ddl_esms_by_program.result new file mode 100644 index 00000000000..66e49f8aeea --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_esms_by_program.result @@ -0,0 +1,9 @@ +alter table performance_schema.events_statements_summary_by_program +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.events_statements_summary_by_program; +ALTER TABLE performance_schema.events_statements_summary_by_program ADD INDEX test_index(OBJECT_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.events_statements_summary_by_program(OBJECT_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_ets_by_account_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_ets_by_account_by_event_name.result new file mode 100644 index 00000000000..23bd048d8a6 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_ets_by_account_by_event_name.result @@ -0,0 +1,10 @@ +alter table performance_schema.events_transactions_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_transactions_summary_by_account_by_event_name; +ALTER TABLE performance_schema.events_transactions_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_transactions_summary_by_account_by_event_name(USERNAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_ets_by_host_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_ets_by_host_by_event_name.result new file mode 100644 index 00000000000..7e3b5ccd70c --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_ets_by_host_by_event_name.result @@ -0,0 +1,10 @@ +alter table performance_schema.events_transactions_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_transactions_summary_by_host_by_event_name; +ALTER TABLE performance_schema.events_transactions_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_transactions_summary_by_host_by_event_name(HOSTNAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_ets_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_ets_by_thread_by_event_name.result new file mode 100644 index 00000000000..bd3c57f9257 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_ets_by_thread_by_event_name.result @@ -0,0 +1,9 @@ +alter table performance_schema.events_transactions_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_transactions_summary_by_thread_by_event_name; +ALTER TABLE performance_schema.events_transactions_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_transactions_summary_by_thread_by_event_name(THREAD_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_ets_by_user_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_ets_by_user_by_event_name.result new file mode 100644 index 00000000000..981de1a7b19 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_ets_by_user_by_event_name.result @@ -0,0 +1,10 @@ +alter table performance_schema.events_transactions_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_transactions_summary_by_user_by_event_name; +ALTER TABLE performance_schema.events_transactions_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_transactions_summary_by_user_by_event_name(USERNAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_ets_global_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_ets_global_by_event_name.result new file mode 100644 index 00000000000..13606ace640 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_ets_global_by_event_name.result @@ -0,0 +1,10 @@ +alter table performance_schema.events_transactions_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_transactions_summary_global_by_event_name; +ALTER TABLE performance_schema.events_transactions_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_transactions_summary_global_by_event_name(EVENT_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_events_stages_current.result b/mysql-test/suite/perfschema/r/ddl_events_stages_current.result index d9094ffb366..137301234bb 100644 --- a/mysql-test/suite/perfschema/r/ddl_events_stages_current.result +++ b/mysql-test/suite/perfschema/r/ddl_events_stages_current.result @@ -5,3 +5,6 @@ ALTER TABLE performance_schema.events_stages_current ADD INDEX test_index(EVENT_ ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' CREATE UNIQUE INDEX test_index ON performance_schema.events_stages_current(EVENT_ID); ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT GENERATION_EXPRESSION +def performance_schema events_stages_current WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references +def performance_schema events_stages_current WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references diff --git a/mysql-test/suite/perfschema/r/ddl_events_stages_history.result b/mysql-test/suite/perfschema/r/ddl_events_stages_history.result index 0b6d6df06d2..7d30c7e8ff4 100644 --- a/mysql-test/suite/perfschema/r/ddl_events_stages_history.result +++ b/mysql-test/suite/perfschema/r/ddl_events_stages_history.result @@ -5,3 +5,6 @@ ALTER TABLE performance_schema.events_stages_history ADD INDEX test_index(EVENT_ ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' CREATE UNIQUE INDEX test_index ON performance_schema.events_stages_history(EVENT_ID); ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT GENERATION_EXPRESSION +def performance_schema events_stages_history WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references +def performance_schema events_stages_history WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references diff --git a/mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result b/mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result index 7843f61aa0d..84651664b96 100644 --- a/mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result +++ b/mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result @@ -5,3 +5,6 @@ ALTER TABLE performance_schema.events_stages_history_long ADD INDEX test_index(E ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' CREATE UNIQUE INDEX test_index ON performance_schema.events_stages_history_long(EVENT_ID); ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT GENERATION_EXPRESSION +def performance_schema events_stages_history_long WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references +def performance_schema events_stages_history_long WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references diff --git a/mysql-test/suite/perfschema/r/ddl_events_transactions_current.result b/mysql-test/suite/perfschema/r/ddl_events_transactions_current.result new file mode 100644 index 00000000000..6d4d280118f --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_events_transactions_current.result @@ -0,0 +1,7 @@ +alter table performance_schema.events_transactions_current add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.events_transactions_current; +ALTER TABLE performance_schema.events_transactions_current ADD INDEX test_index(EVENT_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.events_transactions_current(EVENT_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_events_transactions_history.result b/mysql-test/suite/perfschema/r/ddl_events_transactions_history.result new file mode 100644 index 00000000000..dbbac3ea9df --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_events_transactions_history.result @@ -0,0 +1,7 @@ +alter table performance_schema.events_transactions_history add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.events_transactions_history; +ALTER TABLE performance_schema.events_transactions_history ADD INDEX test_index(EVENT_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.events_transactions_history(EVENT_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_events_transactions_history_long.result b/mysql-test/suite/perfschema/r/ddl_events_transactions_history_long.result new file mode 100644 index 00000000000..7a4a5f0542e --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_events_transactions_history_long.result @@ -0,0 +1,7 @@ +alter table performance_schema.events_transactions_history_long add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.events_transactions_history_long; +ALTER TABLE performance_schema.events_transactions_history_long ADD INDEX test_index(EVENT_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.events_transactions_history_long(EVENT_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_global_status.result b/mysql-test/suite/perfschema/r/ddl_global_status.result new file mode 100644 index 00000000000..10af700eadd --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_global_status.result @@ -0,0 +1,10 @@ +alter table performance_schema.global_status +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.global_status; +ALTER TABLE performance_schema.global_status +ADD INDEX test_index(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.global_status(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_global_variables.result b/mysql-test/suite/perfschema/r/ddl_global_variables.result new file mode 100644 index 00000000000..32422267266 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_global_variables.result @@ -0,0 +1,11 @@ +alter table performance_schema.global_variables +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.global_variables; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.global_variables +ADD INDEX test_index(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.global_variables(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_mems_by_account_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_mems_by_account_by_event_name.result new file mode 100644 index 00000000000..4d7581a7c2e --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_mems_by_account_by_event_name.result @@ -0,0 +1,10 @@ +alter table performance_schema.memory_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.memory_summary_by_account_by_event_name; +ALTER TABLE performance_schema.memory_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.memory_summary_by_account_by_event_name(USERNAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_mems_by_host_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_mems_by_host_by_event_name.result new file mode 100644 index 00000000000..dae5dd2445c --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_mems_by_host_by_event_name.result @@ -0,0 +1,10 @@ +alter table performance_schema.memory_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.memory_summary_by_host_by_event_name; +ALTER TABLE performance_schema.memory_summary_by_host_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.memory_summary_by_host_by_event_name(USERNAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_mems_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_mems_by_thread_by_event_name.result new file mode 100644 index 00000000000..eae9e7020e3 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_mems_by_thread_by_event_name.result @@ -0,0 +1,10 @@ +alter table performance_schema.memory_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.memory_summary_by_thread_by_event_name; +ALTER TABLE performance_schema.memory_summary_by_thread_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.memory_summary_by_thread_by_event_name(USERNAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_mems_by_user_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_mems_by_user_by_event_name.result new file mode 100644 index 00000000000..de6d52b69e6 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_mems_by_user_by_event_name.result @@ -0,0 +1,10 @@ +alter table performance_schema.memory_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.memory_summary_by_user_by_event_name; +ALTER TABLE performance_schema.memory_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.memory_summary_by_user_by_event_name(USERNAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_mems_global_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_mems_global_by_event_name.result new file mode 100644 index 00000000000..9ed8b2b6dab --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_mems_global_by_event_name.result @@ -0,0 +1,10 @@ +alter table performance_schema.memory_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.memory_summary_global_by_event_name; +ALTER TABLE performance_schema.memory_summary_global_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.memory_summary_global_by_event_name(USERNAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_metadata_locks.result b/mysql-test/suite/perfschema/r/ddl_metadata_locks.result new file mode 100644 index 00000000000..4a7e11c63e0 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_metadata_locks.result @@ -0,0 +1,8 @@ +alter table performance_schema.metadata_locks add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.metadata_locks; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.metadata_locks ADD INDEX test_index(TIMER_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.metadata_locks(TIMER_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_prepared_statements_instances.result b/mysql-test/suite/perfschema/r/ddl_prepared_statements_instances.result new file mode 100644 index 00000000000..d71e6c1ebf4 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_prepared_statements_instances.result @@ -0,0 +1,9 @@ +alter table performance_schema.prepared_statements_instances +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.prepared_statements_instances; +ALTER TABLE performance_schema.prepared_statements_instances ADD INDEX test_index(OWNER_OBJECT_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.prepared_statements_instances(OWNER_OBJECT_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_replication_applier_configuration.result b/mysql-test/suite/perfschema/r/ddl_replication_applier_configuration.result new file mode 100644 index 00000000000..6b6b9a988bc --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_replication_applier_configuration.result @@ -0,0 +1,11 @@ +ALTER TABLE performance_schema.replication_applier_configuration +ADD COLUMN foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +TRUNCATE TABLE performance_schema.replication_applier_configuration; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.replication_applier_configuration +ADD INDEX test_index(desired_delay); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON +performance_schema.replication_applier_configuration(desired_delay); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_replication_applier_status.result b/mysql-test/suite/perfschema/r/ddl_replication_applier_status.result new file mode 100644 index 00000000000..99328acce5a --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_replication_applier_status.result @@ -0,0 +1,11 @@ +ALTER TABLE performance_schema.replication_applier_status +ADD COLUMN foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +TRUNCATE TABLE performance_schema.replication_applier_status; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.replication_applier_status +ADD INDEX test_index(remaining_delay); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON +performance_schema.replication_applier_status(remaining_delay); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_replication_applier_status_by_coordinator.result b/mysql-test/suite/perfschema/r/ddl_replication_applier_status_by_coordinator.result new file mode 100644 index 00000000000..86bedb29451 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_replication_applier_status_by_coordinator.result @@ -0,0 +1,11 @@ +ALTER TABLE performance_schema.replication_applier_status_by_coordinator +ADD COLUMN foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +TRUNCATE TABLE performance_schema.replication_applier_status_by_coordinator; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.replication_applier_status_by_coordinator +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.replication_applier_status_by_coordinator(thread_id); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_replication_applier_status_by_worker.result b/mysql-test/suite/perfschema/r/ddl_replication_applier_status_by_worker.result new file mode 100644 index 00000000000..e13b4f978e1 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_replication_applier_status_by_worker.result @@ -0,0 +1,11 @@ +ALTER TABLE performance_schema.replication_applier_status_by_worker +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +TRUNCATE TABLE performance_schema.replication_applier_status_by_worker; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.replication_applier_status_by_worker +ADD INDEX test_index(worker_id); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON +performance_schema.replication_applier_status_by_worker(worker_id); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_replication_connection_configuration.result b/mysql-test/suite/perfschema/r/ddl_replication_connection_configuration.result new file mode 100644 index 00000000000..8eea531a0c3 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_replication_connection_configuration.result @@ -0,0 +1,11 @@ +ALTER TABLE performance_schema.replication_connection_configuration +ADD COLUMN foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +TRUNCATE TABLE performance_schema.replication_connection_configuration; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.replication_connection_configuration +ADD INDEX test_index(HOST); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.replication_connection_configuration(HOST); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_replication_connection_status.result b/mysql-test/suite/perfschema/r/ddl_replication_connection_status.result new file mode 100644 index 00000000000..4c650b030ed --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_replication_connection_status.result @@ -0,0 +1,11 @@ +ALTER TABLE performance_schema.replication_connection_status +ADD COLUMN foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +TRUNCATE TABLE performance_schema.replication_connection_status; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.replication_connection_status +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.replication_connection_status(Thread_Id); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_replication_group_member_stats.result b/mysql-test/suite/perfschema/r/ddl_replication_group_member_stats.result new file mode 100644 index 00000000000..cab3b0874fa --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_replication_group_member_stats.result @@ -0,0 +1,11 @@ +ALTER TABLE performance_schema.replication_group_member_stats +ADD COLUMN foo INTEGER; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +TRUNCATE TABLE performance_schema.replication_group_member_stats; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.replication_group_member_stats +ADD INDEX test_index(Member_Id); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.replication_group_member_stats(Member_Id); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_replication_group_members.result b/mysql-test/suite/perfschema/r/ddl_replication_group_members.result new file mode 100644 index 00000000000..25ed912a11a --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_replication_group_members.result @@ -0,0 +1,11 @@ +ALTER TABLE performance_schema.replication_group_members +ADD COLUMN foo INTEGER; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +TRUNCATE TABLE performance_schema.replication_group_members; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.replication_group_members +ADD INDEX test_index(Member_Id); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.replication_group_members(Member_Id); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_session_status.result b/mysql-test/suite/perfschema/r/ddl_session_status.result new file mode 100644 index 00000000000..39731f8a253 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_session_status.result @@ -0,0 +1,11 @@ +alter table performance_schema.session_status +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.session_status; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.session_status +ADD INDEX test_index(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.session_status(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_session_variables.result b/mysql-test/suite/perfschema/r/ddl_session_variables.result new file mode 100644 index 00000000000..26bf8e1d2d7 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_session_variables.result @@ -0,0 +1,11 @@ +alter table performance_schema.session_variables +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.session_variables; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.session_variables +ADD INDEX test_index(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.session_variables(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_setup_actors.result b/mysql-test/suite/perfschema/r/ddl_setup_actors.result index 753632eb62d..c17314e4362 100644 --- a/mysql-test/suite/perfschema/r/ddl_setup_actors.result +++ b/mysql-test/suite/perfschema/r/ddl_setup_actors.result @@ -14,3 +14,5 @@ ALTER TABLE performance_schema.setup_actors ADD INDEX test_index(HOST); ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' CREATE UNIQUE INDEX test_index ON performance_schema.setup_actors(HOST); ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +ALTER TABLE performance_schema.setup_actors ADD KEY ENA(ENABLED); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_status_by_account.result b/mysql-test/suite/perfschema/r/ddl_status_by_account.result new file mode 100644 index 00000000000..d21b7ed1e0b --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_status_by_account.result @@ -0,0 +1,10 @@ +alter table performance_schema.status_by_account +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.status_by_account; +ALTER TABLE performance_schema.status_by_account +ADD INDEX test_index(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.status_by_account(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_status_by_host.result b/mysql-test/suite/perfschema/r/ddl_status_by_host.result new file mode 100644 index 00000000000..5e4ba3573e6 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_status_by_host.result @@ -0,0 +1,10 @@ +alter table performance_schema.status_by_host +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.status_by_host; +ALTER TABLE performance_schema.status_by_host +ADD INDEX test_index(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.status_by_host(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_status_by_thread.result b/mysql-test/suite/perfschema/r/ddl_status_by_thread.result new file mode 100644 index 00000000000..2333af91c10 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_status_by_thread.result @@ -0,0 +1,10 @@ +alter table performance_schema.status_by_thread +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.status_by_thread; +ALTER TABLE performance_schema.status_by_thread +ADD INDEX test_index(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.status_by_thread(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_status_by_user.result b/mysql-test/suite/perfschema/r/ddl_status_by_user.result new file mode 100644 index 00000000000..c7d396db225 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_status_by_user.result @@ -0,0 +1,10 @@ +alter table performance_schema.status_by_user +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.status_by_user; +ALTER TABLE performance_schema.status_by_user +ADD INDEX test_index(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.status_by_user(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_table_handles.result b/mysql-test/suite/perfschema/r/ddl_table_handles.result new file mode 100644 index 00000000000..8c81ccad952 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_table_handles.result @@ -0,0 +1,8 @@ +alter table performance_schema.table_handles add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.table_handles; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.table_handles ADD INDEX test_index(TIMER_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.table_handles(TIMER_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_uvar_by_thread.result b/mysql-test/suite/perfschema/r/ddl_uvar_by_thread.result new file mode 100644 index 00000000000..bb887a38122 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_uvar_by_thread.result @@ -0,0 +1,11 @@ +alter table performance_schema.user_variables_by_thread +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.user_variables_by_thread; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.user_variables_by_thread +ADD INDEX test_index(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.user_variables_by_thread(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_variables_by_thread.result b/mysql-test/suite/perfschema/r/ddl_variables_by_thread.result new file mode 100644 index 00000000000..c910de84c62 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_variables_by_thread.result @@ -0,0 +1,11 @@ +alter table performance_schema.variables_by_thread +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.variables_by_thread; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.variables_by_thread +ADD INDEX test_index(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.variables_by_thread(VARIABLE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/digest_table_full.result b/mysql-test/suite/perfschema/r/digest_table_full.result index 5c8d2eb23d1..f2a16620638 100644 --- a/mysql-test/suite/perfschema/r/digest_table_full.result +++ b/mysql-test/suite/perfschema/r/digest_table_full.result @@ -111,10 +111,17 @@ DROP TRIGGER trg; #################################### SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS, SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest; +<<<<<<< HEAD SCHEMA_NAME DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS NULL NULL 55 32 1 2 statements_digest TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 0 0 0 SHOW VARIABLES LIKE "performance_schema_digests_size"; +======= +SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS +NULL NULL NULL 55 32 1 2 +statements_digest d24da32343f2b799f8a7ba1bdc45f83b TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 0 0 0 +SHOW GLOBAL VARIABLES LIKE "performance_schema_digests_size"; +>>>>>>> merge-perfschema-5.7 Variable_name Value performance_schema_digests_size 2 SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest; diff --git a/mysql-test/suite/perfschema/r/dml_esms_by_program.result b/mysql-test/suite/perfschema/r/dml_esms_by_program.result new file mode 100644 index 00000000000..b8c86fe3e45 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_esms_by_program.result @@ -0,0 +1,27 @@ +select * from performance_schema.events_statements_summary_by_program +where object_name like 'XXYYZZ%' limit 1; +OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT COUNT_STATEMENTS SUM_STATEMENTS_WAIT MIN_STATEMENTS_WAIT AVG_STATEMENTS_WAIT MAX_STATEMENTS_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED +select * from performance_schema.events_statements_summary_by_program +where object_name='XXYYZZ'; +OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT COUNT_STATEMENTS SUM_STATEMENTS_WAIT MIN_STATEMENTS_WAIT AVG_STATEMENTS_WAIT MAX_STATEMENTS_WAIT SUM_LOCK_TIME SUM_ERRORS SUM_WARNINGS SUM_ROWS_AFFECTED SUM_ROWS_SENT SUM_ROWS_EXAMINED SUM_CREATED_TMP_DISK_TABLES SUM_CREATED_TMP_TABLES SUM_SELECT_FULL_JOIN SUM_SELECT_FULL_RANGE_JOIN SUM_SELECT_RANGE SUM_SELECT_RANGE_CHECK SUM_SELECT_SCAN SUM_SORT_MERGE_PASSES SUM_SORT_RANGE SUM_SORT_ROWS SUM_SORT_SCAN SUM_NO_INDEX_USED SUM_NO_GOOD_INDEX_USED +insert into performance_schema.events_statements_summary_by_program +set object_name='XXYYZZ', count_star=1, sum_timer_wait=2, min_timer_wait=3, +avg_timer_wait=4, max_timer_wait=5; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_statements_summary_by_program' +update performance_schema.events_statements_summary_by_program +set count_star=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_program' +update performance_schema.events_statements_summary_by_program +set count_star=12 where object_name like "XXYYZZ"; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_program' +delete from performance_schema.events_statements_summary_by_program +where count_star=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_program' +delete from performance_schema.events_statements_summary_by_program; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_statements_summary_by_program' +LOCK TABLES performance_schema.events_statements_summary_by_program READ; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_program' +UNLOCK TABLES; +LOCK TABLES performance_schema.events_statements_summary_by_program WRITE; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_program' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_ets_by_account_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ets_by_account_by_event_name.result new file mode 100644 index 00000000000..66a0f733d19 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_ets_by_account_by_event_name.result @@ -0,0 +1,26 @@ +select * from performance_schema.events_transactions_summary_by_account_by_event_name +where event_name in ('transaction') limit 1; +select * from performance_schema.events_transactions_summary_by_account_by_event_name +where event_name='FOO'; +insert into performance_schema.events_transactions_summary_by_account_by_event_name +set event_name='FOO', user='BAR', host='BAZ', +count_star=1, sum_timer_wait=2, min_timer_wait=3, +avg_timer_wait=4, max_timer_wait=5; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_account_by_event_name' +update performance_schema.events_transactions_summary_by_account_by_event_name +set count_star=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_account_by_event_name' +update performance_schema.events_transactions_summary_by_account_by_event_name +set count_star=12 where event_name like "FOO"; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_account_by_event_name' +delete from performance_schema.events_transactions_summary_by_account_by_event_name +where count_star=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_account_by_event_name' +delete from performance_schema.events_transactions_summary_by_account_by_event_name; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_account_by_event_name' +LOCK TABLES performance_schema.events_transactions_summary_by_account_by_event_name READ; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_account_by_event_name' +UNLOCK TABLES; +LOCK TABLES performance_schema.events_transactions_summary_by_account_by_event_name WRITE; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_account_by_event_name' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_ets_by_host_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ets_by_host_by_event_name.result new file mode 100644 index 00000000000..194d8ff0b4b --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_ets_by_host_by_event_name.result @@ -0,0 +1,26 @@ +select * from performance_schema.events_transactions_summary_by_host_by_event_name +where event_name in ('transaction') limit 1; +select * from performance_schema.events_transactions_summary_by_host_by_event_name +where event_name='FOO'; +insert into performance_schema.events_transactions_summary_by_host_by_event_name +set event_name='FOO', thread_id=1, +count_star=1, sum_timer_wait=2, min_timer_wait=3, +avg_timer_wait=4, max_timer_wait=5; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_host_by_event_name' +update performance_schema.events_transactions_summary_by_host_by_event_name +set count_star=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_host_by_event_name' +update performance_schema.events_transactions_summary_by_host_by_event_name +set count_star=12 where event_name like "FOO"; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_host_by_event_name' +delete from performance_schema.events_transactions_summary_by_host_by_event_name +where count_star=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_host_by_event_name' +delete from performance_schema.events_transactions_summary_by_host_by_event_name; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_host_by_event_name' +LOCK TABLES performance_schema.events_transactions_summary_by_host_by_event_name READ; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_host_by_event_name' +UNLOCK TABLES; +LOCK TABLES performance_schema.events_transactions_summary_by_host_by_event_name WRITE; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_host_by_event_name' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_ets_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ets_by_thread_by_event_name.result new file mode 100644 index 00000000000..f096d265457 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_ets_by_thread_by_event_name.result @@ -0,0 +1,26 @@ +select * from performance_schema.events_transactions_summary_by_thread_by_event_name +where event_name in ('transaction') limit 1; +select * from performance_schema.events_transactions_summary_by_thread_by_event_name +where event_name='FOO'; +insert into performance_schema.events_transactions_summary_by_thread_by_event_name +set event_name='FOO', thread_id=1, +count_star=1, sum_timer_wait=2, min_timer_wait=3, +avg_timer_wait=4, max_timer_wait=5; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_thread_by_event_name' +update performance_schema.events_transactions_summary_by_thread_by_event_name +set count_star=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_thread_by_event_name' +update performance_schema.events_transactions_summary_by_thread_by_event_name +set count_star=12 where event_name like "FOO"; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_thread_by_event_name' +delete from performance_schema.events_transactions_summary_by_thread_by_event_name +where count_star=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_thread_by_event_name' +delete from performance_schema.events_transactions_summary_by_thread_by_event_name; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_thread_by_event_name' +LOCK TABLES performance_schema.events_transactions_summary_by_thread_by_event_name READ; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_thread_by_event_name' +UNLOCK TABLES; +LOCK TABLES performance_schema.events_transactions_summary_by_thread_by_event_name WRITE; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_thread_by_event_name' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_ets_by_user_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ets_by_user_by_event_name.result new file mode 100644 index 00000000000..11d455a35a7 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_ets_by_user_by_event_name.result @@ -0,0 +1,26 @@ +select * from performance_schema.events_transactions_summary_by_user_by_event_name +where event_name in ('transaction') limit 1; +select * from performance_schema.events_transactions_summary_by_user_by_event_name +where event_name='FOO'; +insert into performance_schema.events_transactions_summary_by_user_by_event_name +set event_name='FOO', user='BAR', +count_star=1, sum_timer_wait=2, min_timer_wait=3, +avg_timer_wait=4, max_timer_wait=5; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_user_by_event_name' +update performance_schema.events_transactions_summary_by_user_by_event_name +set count_star=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_user_by_event_name' +update performance_schema.events_transactions_summary_by_user_by_event_name +set count_star=12 where event_name like "FOO"; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_user_by_event_name' +delete from performance_schema.events_transactions_summary_by_user_by_event_name +where count_star=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_user_by_event_name' +delete from performance_schema.events_transactions_summary_by_user_by_event_name; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_user_by_event_name' +LOCK TABLES performance_schema.events_transactions_summary_by_user_by_event_name READ; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_user_by_event_name' +UNLOCK TABLES; +LOCK TABLES performance_schema.events_transactions_summary_by_user_by_event_name WRITE; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_summary_by_user_by_event_name' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_ets_global_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ets_global_by_event_name.result new file mode 100644 index 00000000000..0f2bd599af8 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_ets_global_by_event_name.result @@ -0,0 +1,25 @@ +select * from performance_schema.events_transactions_summary_global_by_event_name +where event_name in ('transaction') limit 1; +select * from performance_schema.events_transactions_summary_global_by_event_name +where event_name='FOO'; +insert into performance_schema.events_transactions_summary_global_by_event_name +set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3, +avg_timer_wait=4, max_timer_wait=5; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_transactions_summary_global_by_event_name' +update performance_schema.events_transactions_summary_global_by_event_name +set count_star=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_summary_global_by_event_name' +update performance_schema.events_transactions_summary_global_by_event_name +set count_star=12 where event_name like "FOO"; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_summary_global_by_event_name' +delete from performance_schema.events_transactions_summary_global_by_event_name +where count_star=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_summary_global_by_event_name' +delete from performance_schema.events_transactions_summary_global_by_event_name; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_summary_global_by_event_name' +LOCK TABLES performance_schema.events_transactions_summary_global_by_event_name READ; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_summary_global_by_event_name' +UNLOCK TABLES; +LOCK TABLES performance_schema.events_transactions_summary_global_by_event_name WRITE; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_summary_global_by_event_name' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_events_transactions_current.result b/mysql-test/suite/perfschema/r/dml_events_transactions_current.result new file mode 100644 index 00000000000..9a6c4f3bd58 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_events_transactions_current.result @@ -0,0 +1,25 @@ +select * from performance_schema.events_transactions_current +where event_name in ('transaction') limit 1; +select * from performance_schema.events_transactions_current +where event_name='FOO'; +insert into performance_schema.events_transactions_current +set thread_id='1', event_id=1, +event_name='FOO', timer_start=1, timer_end=2, timer_wait=3; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_transactions_current' +update performance_schema.events_transactions_current +set timer_start=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_current' +update performance_schema.events_transactions_current +set timer_start=12 where thread_id=0; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_current' +delete from performance_schema.events_transactions_current +where thread_id=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_current' +delete from performance_schema.events_transactions_current; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_current' +LOCK TABLES performance_schema.events_transactions_current READ; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_current' +UNLOCK TABLES; +LOCK TABLES performance_schema.events_transactions_current WRITE; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_current' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_events_transactions_history.result b/mysql-test/suite/perfschema/r/dml_events_transactions_history.result new file mode 100644 index 00000000000..000e6a26753 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_events_transactions_history.result @@ -0,0 +1,29 @@ +select * from performance_schema.events_transactions_history +where event_name in ('transaction') limit 1; +select * from performance_schema.events_transactions_history +where event_name='FOO'; +select * from performance_schema.events_transactions_history +where event_name in ('transaction') order by timer_wait limit 1; +select * from performance_schema.events_transactions_history +where event_name in ('transaction') order by timer_wait desc limit 1; +insert into performance_schema.events_transactions_history +set thread_id='1', event_id=1, +event_name='FOO', timer_start=1, timer_end=2, timer_wait=3; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_transactions_history' +update performance_schema.events_transactions_history +set timer_start=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_history' +update performance_schema.events_transactions_history +set timer_start=12 where thread_id=0; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_history' +delete from performance_schema.events_transactions_history +where thread_id=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_history' +delete from performance_schema.events_transactions_history; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_history' +LOCK TABLES performance_schema.events_transactions_history READ; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_history' +UNLOCK TABLES; +LOCK TABLES performance_schema.events_transactions_history WRITE; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_history' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_events_transactions_history_long.result b/mysql-test/suite/perfschema/r/dml_events_transactions_history_long.result new file mode 100644 index 00000000000..e954bcd1be1 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_events_transactions_history_long.result @@ -0,0 +1,29 @@ +select * from performance_schema.events_transactions_history_long +where event_name in ('transaction') limit 1; +select * from performance_schema.events_transactions_history_long +where event_name='FOO'; +select * from performance_schema.events_transactions_history_long +where event_name in ('transaction') order by timer_wait limit 1; +select * from performance_schema.events_transactions_history_long +where event_name in ('transaction') order by timer_wait desc limit 1; +insert into performance_schema.events_transactions_history_long +set thread_id='1', event_id=1, +event_name='FOO', timer_start=1, timer_end=2, timer_wait=3; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_transactions_history_long' +update performance_schema.events_transactions_history_long +set timer_start=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_history_long' +update performance_schema.events_transactions_history_long +set timer_start=12 where thread_id=0; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_transactions_history_long' +delete from performance_schema.events_transactions_history_long +where thread_id=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_history_long' +delete from performance_schema.events_transactions_history_long; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_transactions_history_long' +LOCK TABLES performance_schema.events_transactions_history_long READ; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_history_long' +UNLOCK TABLES; +LOCK TABLES performance_schema.events_transactions_history_long WRITE; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_transactions_history_long' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_file_instances.result b/mysql-test/suite/perfschema/r/dml_file_instances.result index d2564cb58dd..a13c570a5ad 100644 --- a/mysql-test/suite/perfschema/r/dml_file_instances.result +++ b/mysql-test/suite/perfschema/r/dml_file_instances.result @@ -18,3 +18,62 @@ UNLOCK TABLES; LOCK TABLES performance_schema.file_instances WRITE; ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'file_instances' UNLOCK TABLES; +### +### Bug#26152751: INNODB LEAKS MEMORY, PERFORMANCE_SCHEMA FILE_INSTANCES +### #SQL-IB3129987-252773.IBD +### +CREATE DATABASE db_26152751; +USE db_26152751; +SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%"; +FILE_NAME +CREATE TABLE t_db_26152751 (a INT) ENGINE=MYISAM; +SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%"; +FILE_NAME +t_db_26152751.frm +t_db_26152751.MYI +t_db_26152751.MYD +RENAME TABLE t_db_26152751 to t_db_26152751_new; +SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%"; +FILE_NAME +t_db_26152751_new.frm +t_db_26152751_new.MYI +t_db_26152751_new.MYD +RENAME TABLE t_db_26152751_new to t_db_26152751; +SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%"; +FILE_NAME +t_db_26152751.frm +t_db_26152751.MYI +t_db_26152751.MYD +ALTER TABLE t_db_26152751 ADD COLUMN b INT; +SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%"; +FILE_NAME +t_db_26152751.frm +t_db_26152751.MYI +t_db_26152751.MYD +DROP TABLE t_db_26152751; +SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%"; +FILE_NAME +CREATE TABLE t_db_26152751 (a INT) ENGINE=INNODB; +SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%"; +FILE_NAME +t_db_26152751.frm +t_db_26152751.ibd +RENAME TABLE t_db_26152751 to t_db_26152751_new; +SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%"; +FILE_NAME +t_db_26152751_new.frm +t_db_26152751_new.ibd +RENAME TABLE t_db_26152751_new to t_db_26152751; +SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%"; +FILE_NAME +t_db_26152751.frm +t_db_26152751.ibd +ALTER TABLE t_db_26152751 ADD COLUMN b INT; +SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%"; +FILE_NAME +t_db_26152751.frm +t_db_26152751.ibd +DROP TABLE t_db_26152751; +SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%"; +FILE_NAME +DROP DATABASE db_26152751; diff --git a/mysql-test/suite/perfschema/r/dml_global_status.result b/mysql-test/suite/perfschema/r/dml_global_status.result new file mode 100644 index 00000000000..90b7ac8147f --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_global_status.result @@ -0,0 +1,21 @@ +select * from performance_schema.global_status +where variable_name like 'bytes_%' limit 1; +select * from performance_schema.global_status +where variable_name='FOO'; +insert into performance_schema.global_status +set variable_name='FOO', variable_value='BAR'; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'global_status' +update performance_schema.global_status +set variable_name='FOO', variable_value='BAR'; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'global_status' +delete from performance_schema.global_status +where variable_name <> 'FOO'; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'global_status' +delete from performance_schema.global_status; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'global_status' +LOCK TABLES performance_schema.global_status READ; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'global_status' +UNLOCK TABLES; +LOCK TABLES performance_schema.global_status WRITE; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'global_status' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_global_variables.result b/mysql-test/suite/perfschema/r/dml_global_variables.result new file mode 100644 index 00000000000..08d15af34d3 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_global_variables.result @@ -0,0 +1,21 @@ +select * from performance_schema.global_variables +where variable_name like 'autocommit%' limit 1; +select * from performance_schema.global_variables +where variable_name='FOO'; +insert into performance_schema.global_variables +set variable_name='FOO', variable_value='BAR'; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'global_variables' +update performance_schema.global_variables +set variable_name='FOO', variable_value='BAR'; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'global_variables' +delete from performance_schema.global_variables +where variable_name <> 'FOO'; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'global_variables' +delete from performance_schema.global_variables; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'global_variables' +LOCK TABLES performance_schema.global_variables READ; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'global_variables' +UNLOCK TABLES; +LOCK TABLES performance_schema.global_variables WRITE; +ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'global_variables' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_handler.result b/mysql-test/suite/perfschema/r/dml_handler.result index ce0f87e7733..3dd969528be 100644 --- a/mysql-test/suite/perfschema/r/dml_handler.result +++ b/mysql-test/suite/perfschema/r/dml_handler.result @@ -12,8 +12,12 @@ Warning 1287 ' INTO ;' is deprecated and will be removed in a future release. Please use 'SELECT