Commit 4e46d8e5 authored by Sergei Golubchik's avatar Sergei Golubchik

merge with xtradb-5.5.15

fix test cases
parents 9a02c69f d4d7a8fa
...@@ -149,7 +149,7 @@ fi ...@@ -149,7 +149,7 @@ fi
# Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro # Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro
# LINT_INIT(), which is only useful for silencing spurious warnings # LINT_INIT(), which is only useful for silencing spurious warnings
# of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind. # of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind.
valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify " valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify -DHAVE_valgrind "
valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
valgrind_configs="--with-valgrind" valgrind_configs="--with-valgrind"
# #
......
#! /bin/sh #!/bin/sh
# #
# Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved. # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
# #
# This program is free software; you can redistribute it and/or modify it under # 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 # the terms of the GNU General Public License as published by the Free Software
...@@ -15,10 +15,11 @@ ...@@ -15,10 +15,11 @@
# Place, Suite 330, Boston, MA 02111-1307 USA # Place, Suite 330, Boston, MA 02111-1307 USA
# #
path=`dirname $0` # we assume this script is in storage/innobase/
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $fast_cflags -g" MYSQL_ROOT="$(dirname ${0})/../.."
extra_configs="$pentium_configs $static_link --with-plugins=innobase"
. "$path/FINISH.sh" cd ${MYSQL_ROOT}
cmake -DWITH_INNOBASE_STORAGE_ENGINE:BOOL=ON
make -j$(nproc)
#! /bin/sh
#
# Copyright (c) 2005, 2009, Innobase Oy. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA
#
path=`dirname $0`
. "$path/SETUP.sh" $@ --with-debug=full
extra_flags="$pentium_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs --with-plugins=innobase"
. "$path/FINISH.sh"
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define IF_VALGRIND(A,B) B #define IF_VALGRIND(A,B) B
#endif #endif
#if defined(HAVE_valgrind) && defined(HAVE_VALGRIND_MEMCHECK_H) #if defined(HAVE_VALGRIND) && defined(HAVE_VALGRIND_MEMCHECK_H)
# include <valgrind/memcheck.h> # include <valgrind/memcheck.h>
# define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len) # define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len)
# define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len) # define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len)
......
...@@ -44,7 +44,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ...@@ -44,7 +44,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql-common/client_plugin.c ../sql-common/client_plugin.c
../sql/password.c ../sql/discover.cc ../sql/derror.cc ../sql/password.c ../sql/discover.cc ../sql/derror.cc
../sql/field.cc ../sql/field_conv.cc ../sql/field.cc ../sql/field_conv.cc
../sql/filesort.cc ../sql/gstream.cc ../sql/filesort.cc ../sql/gstream.cc ../sql/slave.cc
../sql/handler.cc ../sql/hash_filo.cc ../sql/hostname.cc ../sql/handler.cc ../sql/hash_filo.cc ../sql/hostname.cc
../sql/init.cc ../sql/item_buff.cc ../sql/item_cmpfunc.cc ../sql/init.cc ../sql/item_buff.cc ../sql/item_cmpfunc.cc
../sql/item.cc ../sql/item_create.cc ../sql/item_func.cc ../sql/item.cc ../sql/item_create.cc ../sql/item_func.cc
......
--loose-innodb --loose-innodb
--plugin-load=$HA_INNODB_SO --plugin-load=$HA_XTRADB_SO
--source include/have_innodb.inc
if (!`SELECT count(*) FROM information_schema.plugins WHERE if (!`SELECT count(*) FROM information_schema.plugins WHERE
plugin_name = 'innodb' AND plugin_status = 'active' AND plugin_name = 'innodb' AND plugin_status = 'active' AND
plugin_description LIKE '%xtradb%'`){ plugin_description LIKE '%xtradb%'`){
......
...@@ -1120,6 +1120,11 @@ INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1); ...@@ -1120,6 +1120,11 @@ INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1; INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
# should be range access # should be range access
#
# InnoDB uses "where", while xtradb "index condition"
#
--replace_regex /where/index condition/
EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
# should produce '8 7 6 5 4' for a # should produce '8 7 6 5 4' for a
......
...@@ -22,7 +22,7 @@ perl; ...@@ -22,7 +22,7 @@ perl;
# Plugins which may or may not be there: # Plugins which may or may not be there:
@plugins=qw/innodb ndb archive blackhole federated partition ndbcluster debug temp-pool ssl des-key-file @plugins=qw/innodb ndb archive blackhole federated partition ndbcluster debug temp-pool ssl des-key-file
thread-concurrency super-large-pages mutex-deadlock-detector null-audit maria aria pbxt oqgraph sphinx/; xtradb thread-concurrency super-large-pages mutex-deadlock-detector null-audit maria aria pbxt oqgraph sphinx/;
# And substitute the content some environment variables with their # And substitute the content some environment variables with their
# names: # names:
...@@ -39,7 +39,7 @@ perl; ...@@ -39,7 +39,7 @@ perl;
next if /Value \(after reading options\)/; # skip table header next if /Value \(after reading options\)/; # skip table header
next if /^($re1) /; next if /^($re1) /;
next if /^($re2)-/; next if /^($re2)-/;
$skip=0 if /^ -/; $skip=0 if /^ -/ or /^$/;
$skip=1 if / --($re2)\b/; $skip=1 if / --($re2)\b/;
y!\\!/!; y!\\!/!;
s/[ ]+/ /; # squeeze spaces to remove table formatting s/[ ]+/ /; # squeeze spaces to remove table formatting
......
SELECT SLEEP(0.31);
SELECT SLEEP(0.32);
SELECT SLEEP(0.33);
SELECT SLEEP(0.34);
SELECT SLEEP(0.35);
SELECT SLEEP(0.36);
SELECT SLEEP(0.37);
SELECT SLEEP(0.38);
SELECT SLEEP(0.39);
SELECT SLEEP(0.40);
SELECT SLEEP(1.1);
SELECT SLEEP(1.2);
SELECT SLEEP(1.3);
SELECT SLEEP(1.5);
SELECT SLEEP(1.4);
SELECT SLEEP(0.5);
SELECT SLEEP(2.1);
SELECT SLEEP(2.3);
SELECT SLEEP(2.5);
...@@ -862,7 +862,7 @@ x_double_precision NULL NULL ...@@ -862,7 +862,7 @@ x_double_precision NULL NULL
drop table t1; drop table t1;
grant select on test.* to mysqltest_4@localhost; grant select on test.* to mysqltest_4@localhost;
SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME='TABLE_NAME'; where COLUMN_NAME='TABLE_NAME' and table_name not like 'innodb%';
TABLE_NAME COLUMN_NAME PRIVILEGES TABLE_NAME COLUMN_NAME PRIVILEGES
COLUMNS TABLE_NAME select COLUMNS TABLE_NAME select
COLUMN_PRIVILEGES TABLE_NAME select COLUMN_PRIVILEGES TABLE_NAME select
...@@ -1250,12 +1250,12 @@ f1() ...@@ -1250,12 +1250,12 @@ f1()
DROP FUNCTION f1; DROP FUNCTION f1;
DROP PROCEDURE p1; DROP PROCEDURE p1;
DROP USER mysql_bug20230@localhost; DROP USER mysql_bug20230@localhost;
SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test'); SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test') and table_name not like 'xtradb%';
MAX(table_name) MAX(table_name)
VIEWS VIEWS
SELECT table_name from information_schema.tables SELECT table_name from information_schema.tables
WHERE table_name=(SELECT MAX(table_name) WHERE table_name=(SELECT MAX(table_name)
FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test')); FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test') and table_name not like 'xtradb%');
table_name table_name
VIEWS VIEWS
DROP TABLE IF EXISTS bug23037; DROP TABLE IF EXISTS bug23037;
......
Variable_name Value
innodb_stats_sample_pages 1
drop table if exists t1;
set session transaction isolation level read committed;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
create table t2 like t1;
insert into t2 values (1),(2),(3),(4),(5),(6),(7);
set autocommit=0;
begin;
replace into t1 select * from t2;
set session transaction isolation level read committed;
set autocommit=0;
delete from t2 where a=5;
commit;
delete from t2;
commit;
commit;
begin;
insert into t1 select * from t2;
set session transaction isolation level read committed;
set autocommit=0;
delete from t2 where a=5;
commit;
delete from t2;
commit;
commit;
select * from t1;
a
1
2
3
4
5
6
7
drop table t1;
drop table t2;
create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb default charset=ucs2;
insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
commit;
alter table t1 add unique index (b);
ERROR 23000: Duplicate entry '2' for key 'b'
insert into t1 values(8,9,'fff','fff');
select * from t1;
a b c d
1 1 ab ab
2 2 ac ac
3 2 ad ad
4 4 afe afe
8 9 fff fff
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
`c` char(10) DEFAULT NULL,
`d` varchar(20) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=ucs2
alter table t1 add index (b);
insert into t1 values(10,10,'kkk','iii');
select * from t1;
a b c d
1 1 ab ab
2 2 ac ac
3 2 ad ad
4 4 afe afe
8 9 fff fff
10 10 kkk iii
select * from t1 force index(b) order by b;
a b c d
1 1 ab ab
2 2 ac ac
3 2 ad ad
4 4 afe afe
8 9 fff fff
10 10 kkk iii
explain select * from t1 force index(b) order by b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL b 5 NULL 6
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
`c` char(10) DEFAULT NULL,
`d` varchar(20) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=ucs2
alter table t1 add unique index (c), add index (d);
insert into t1 values(11,11,'aaa','mmm');
select * from t1;
a b c d
1 1 ab ab
2 2 ac ac
3 2 ad ad
4 4 afe afe
8 9 fff fff
10 10 kkk iii
11 11 aaa mmm
select * from t1 force index(b) order by b;
a b c d
1 1 ab ab
2 2 ac ac
3 2 ad ad
4 4 afe afe
8 9 fff fff
10 10 kkk iii
11 11 aaa mmm
select * from t1 force index(c) order by c;
a b c d
11 11 aaa mmm
1 1 ab ab
2 2 ac ac
3 2 ad ad
4 4 afe afe
8 9 fff fff
10 10 kkk iii
select * from t1 force index(d) order by d;
a b c d
1 1 ab ab
2 2 ac ac
3 2 ad ad
4 4 afe afe
8 9 fff fff
10 10 kkk iii
11 11 aaa mmm
explain select * from t1 force index(b) order by b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL b 5 NULL 7
explain select * from t1 force index(c) order by c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL c 21 NULL 7
explain select * from t1 force index(d) order by d;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL d 43 NULL 7
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
`c` char(10) DEFAULT NULL,
`d` varchar(20) DEFAULT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `c` (`c`),
KEY `b` (`b`),
KEY `d` (`d`)
) ENGINE=InnoDB DEFAULT CHARSET=ucs2
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
drop table if exists t1;
create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=innodb;
select * from t1;
c1 c2 stamp
replace delayed into t1 (c1, c2) values ( "text1","11");
ERROR HY000: DELAYED option not supported for table 't1'
select * from t1;
c1 c2 stamp
replace delayed into t1 (c1, c2) values ( "text1","12");
ERROR HY000: DELAYED option not supported for table 't1'
select * from t1;
c1 c2 stamp
drop table t1;
set global innodb_lock_wait_timeout=42;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
42
set innodb_lock_wait_timeout=1;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
42
set global innodb_lock_wait_timeout=347;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
42
set innodb_lock_wait_timeout=1;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
347
create table t1(a int primary key)engine=innodb;
begin;
insert into t1 values(1),(2),(3);
set innodb_lock_wait_timeout=5;
select * from t1 for update;
commit;
a
1
2
3
begin;
insert into t1 values(4);
set innodb_lock_wait_timeout=2;
set @a= current_timestamp();
select * from t1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
set @b= current_timestamp();
set @c= timestampdiff(SECOND, @a, @b);
select if(@c >= 1 and @c <= 10, 'OK', concat("NOT OK, time passed=", @c));
if(@c >= 1 and @c <= 10, 'OK', concat("NOT OK, time passed=", @c))
OK
commit;
drop table t1;
set global innodb_lock_wait_timeout=50;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=ON;
SET TX_ISOLATION='READ-COMMITTED';
CREATE TABLE bug40360 (a INT) engine=innodb;
INSERT INTO bug40360 VALUES (1);
DROP TABLE bug40360;
CREATE TABLE bug41904 (id INT PRIMARY KEY, uniquecol CHAR(15)) ENGINE=InnoDB;
INSERT INTO bug41904 VALUES (1,NULL), (2,NULL);
CREATE UNIQUE INDEX ui ON bug41904 (uniquecol);
DROP TABLE bug41904;
CREATE TABLE bug44571 (foo INT) ENGINE=InnoDB;
ALTER TABLE bug44571 CHANGE foo bar INT;
ALTER TABLE bug44571 ADD INDEX bug44571b (foo);
ERROR 42000: Key column 'foo' doesn't exist in table
ALTER TABLE bug44571 ADD INDEX bug44571b (bar);
CREATE INDEX bug44571c ON bug44571 (bar);
DROP TABLE bug44571;
SET foreign_key_checks=0;
CREATE TABLE t1 (id int, foreign key (id) references t2(id)) ENGINE=INNODB;
CREATE TABLE t2 (id int, foreign key (id) references t1(id)) ENGINE=INNODB;
SET foreign_key_checks=1;
SELECT COUNT(*) FROM information_schema.key_column_usage WHERE REFERENCED_TABLE_NAME in ('t1', 't2');
COUNT(*)
2
SET foreign_key_checks=0;
DROP TABLE t1, t2;
lock_mode lock_type lock_table lock_index lock_rec lock_data
X RECORD `test`.```t'\"_str` `PRIMARY` 2 '1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc'''''
X RECORD `test`.```t'\"_str` `PRIMARY` 2 '1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc'''''
X RECORD `test`.```t'\"_str` `PRIMARY` 3 '2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""'
X RECORD `test`.```t'\"_str` `PRIMARY` 3 '2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""'
X RECORD `test`.```t'\"_str` `PRIMARY` 4 '3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\'
X RECORD `test`.```t'\"_str` `PRIMARY` 4 '3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\'
X RECORD `test`.```t'\"_str` `PRIMARY` 5 '4', 'abc', '\0abc', 'abc\0', 'a\0bc', 'a\0bc\0', 'a\0bc\0\0'
X RECORD `test`.```t'\"_str` `PRIMARY` 5 '4', 'abc', '\0abc', 'abc\0', 'a\0bc', 'a\0bc\0', 'a\0bc\0\0'
X RECORD `test`.`t_min` `PRIMARY` 2 -128, 0, -32768, 0, -8388608, 0, -2147483648, 0, -9223372036854775808, 0
X RECORD `test`.`t_min` `PRIMARY` 2 -128, 0, -32768, 0, -8388608, 0, -2147483648, 0, -9223372036854775808, 0
X RECORD `test`.`t_max` `PRIMARY` 2 127, 255, 32767, 65535, 8388607, 16777215, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615
X RECORD `test`.`t_max` `PRIMARY` 2 127, 255, 32767, 65535, 8388607, 16777215, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615
X RECORD `test`.```t'\"_str` `PRIMARY` 1 supremum pseudo-record
X RECORD `test`.```t'\"_str` `PRIMARY` 1 supremum pseudo-record
lock_table COUNT(*)
`test`.`t_max` 2
`test`.`t_min` 2
`test`.```t'\"_str` 10
lock_table COUNT(*)
"test"."t_max" 2
"test"."t_min" 2
"test"."`t'\""_str" 10
...@@ -1375,7 +1375,7 @@ INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1); ...@@ -1375,7 +1375,7 @@ INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1; INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range t1_b t1_b 5 NULL 8 Using where 1 SIMPLE t1 range t1_b t1_b 5 NULL 8 Using index condition
SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
a b c a b c
8 1 1 8 1 1
......
...@@ -114,7 +114,29 @@ Database: information_schema ...@@ -114,7 +114,29 @@ Database: information_schema
| USER_PRIVILEGES | | USER_PRIVILEGES |
| USER_STATISTICS | | USER_STATISTICS |
| VIEWS | | VIEWS |
| INNODB_CMPMEM_RESET |
| PBXT_STATISTICS | | PBXT_STATISTICS |
| INNODB_CMPMEM |
| INNODB_RSEG |
| INNODB_SYS_TABLESTATS |
| INNODB_LOCK_WAITS |
| INNODB_INDEX_STATS |
| INNODB_CMP |
| INNODB_SYS_FOREIGN_COLS |
| INNODB_CMP_RESET |
| INNODB_BUFFER_POOL_PAGES |
| INNODB_TRX |
| INNODB_BUFFER_POOL_PAGES_INDEX |
| INNODB_LOCKS |
| INNODB_BUFFER_POOL_PAGES_BLOB |
| INNODB_SYS_TABLES |
| INNODB_SYS_FIELDS |
| INNODB_SYS_COLUMNS |
| INNODB_TABLE_STATS |
| INNODB_SYS_STATS |
| INNODB_SYS_FOREIGN |
| INNODB_SYS_INDEXES |
| XTRADB_ADMIN_COMMAND |
+---------------------------------------+ +---------------------------------------+
Database: INFORMATION_SCHEMA Database: INFORMATION_SCHEMA
+---------------------------------------+ +---------------------------------------+
...@@ -155,7 +177,29 @@ Database: INFORMATION_SCHEMA ...@@ -155,7 +177,29 @@ Database: INFORMATION_SCHEMA
| USER_PRIVILEGES | | USER_PRIVILEGES |
| USER_STATISTICS | | USER_STATISTICS |
| VIEWS | | VIEWS |
| INNODB_CMPMEM_RESET |
| PBXT_STATISTICS | | PBXT_STATISTICS |
| INNODB_CMPMEM |
| INNODB_RSEG |
| INNODB_SYS_TABLESTATS |
| INNODB_LOCK_WAITS |
| INNODB_INDEX_STATS |
| INNODB_CMP |
| INNODB_SYS_FOREIGN_COLS |
| INNODB_CMP_RESET |
| INNODB_BUFFER_POOL_PAGES |
| INNODB_TRX |
| INNODB_BUFFER_POOL_PAGES_INDEX |
| INNODB_LOCKS |
| INNODB_BUFFER_POOL_PAGES_BLOB |
| INNODB_SYS_TABLES |
| INNODB_SYS_FIELDS |
| INNODB_SYS_COLUMNS |
| INNODB_TABLE_STATS |
| INNODB_SYS_STATS |
| INNODB_SYS_FOREIGN |
| INNODB_SYS_INDEXES |
| XTRADB_ADMIN_COMMAND |
+---------------------------------------+ +---------------------------------------+
Wildcard: inf_rmation_schema Wildcard: inf_rmation_schema
+--------------------+ +--------------------+
......
# Can't run test of external client with embedded server # Can't run test of external client with embedded server
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/have_innodb.inc
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t1,t2,test1,test2; DROP TABLE IF EXISTS t1,t2,test1,test2;
......
...@@ -16,7 +16,23 @@ percona_status_wait_query_cache_mutex: Feature not merged into MariaDB ...@@ -16,7 +16,23 @@ percona_status_wait_query_cache_mutex: Feature not merged into MariaDB
percona_slave_innodb_stats: Feature not merged into MariaDB percona_slave_innodb_stats: Feature not merged into MariaDB
percona_query_response_time-replication: Feature not merged into MariaDB percona_query_response_time-replication: Feature not merged into MariaDB
percona_server_variables: Feature not merged into MariaDB percona_server_variables: Feature not merged into MariaDB
percona_slow_query_log-log_slow_verbosity: InnoDB filtering information not fully merged into MariaDB percona_slow_query_log-log_slow_verbosity: InnoDB filtering information not fully merged into MariaDB
percona_innodb_buffer_pool_shm: Requires big shmmax not default on many systems percona_innodb_buffer_pool_shm: Requires big shmmax not default on many systems
percona_log_warnings_suppress: Feature not merged into MariaDB
percona_slow_extended-log_slow_sp_statements-cl: Feature not merged into MariaDB
percona_slow_extended-log_slow_verbosity-cl: Feature not merged into MariaDB
slow_query_log_use_global_control: Feature not merged into MariaDB
percona_slow_extended-use_global_control: Feature not merged into MariaDB
percona_slow_query_log-log_slow_verbosity: Feature not merged into MariaDB
percona_slow_extended-log_slow_verbosity: Feature not merged into MariaDB
percona_slow_extended-microseconds_in_slow_extended: Feature not merged into MariaDB
percona_slow_extended-use_global_long_query_time: Feature not merged into MariaDB
percona_slow_extended-slow_query_log_timestamp_always-cl: Feature not merged into MariaDB
percona_slow_extended-slow_query_log_microseconds_timestamp-cl: Feature not merged into MariaDB
percona_bug643149: Feature not merged into MariaDB
percona_processlist_row_stats: Feature not merged into MariaDB
percona_server_variables_debug: Feature not merged into MariaDB
percona_slow_extended-slave_statements: Feature not merged into MariaDB
percona_show_slave_status_nolock: Feature not merged into MariaDB
percona_slow_extended-slave_innodb_stats: Feature not merged into MariaDB
percona_slow_extended-slave_statements-and-use_global_long_query_time: Feature not merged into MariaDB
perl;
$file = $ENV{'grep_file'};
$pattern = $ENV{'grep_pattern'};
open(FILE, "$file")
or die("Cannot open file $file: $!\n");
$lines = 0;
while(<FILE>) {
$lines++ if (/$pattern/);
}
print "$lines\n";
close(FILE);
EOF
if (`SELECT @@have_response_time_distribution != 'YES'`)
{
--skip No response time distribution
}
SET @old_slow_query_log_file=@@global.slow_query_log_file;
SET GLOBAL slow_query_log=on;
SET LOCAL log_slow_verbosity='profiling';
SET LOCAL long_query_time=0;
SET GLOBAL slow_query_log_file='MYSQLTEST_VARDIR/percona_bug643149_slow.log';;
SELECT 1;
1
1
# User@Host: root[root] @ localhost []
# Thread_id: X Schema: test Last_errno: X Killed: X
# Query_time: X.X Lock_time: X.X Rows_sent: X Rows_examined: X Rows_affected: X Rows_read: X
# Bytes_sent: X Tmp_tables: X Tmp_disk_tables: X Tmp_table_sizes: X
# Profile_starting: X.X Profile_starting_cpu: X.X Profile_Opening_tables: X.X Profile_Opening_tables_cpu: X.X Profile_query_end: X.X Profile_query_end_cpu: X.X Profile_closing_tables: X.X Profile_closing_tables_cpu: X.X Profile_freeing_items: X.X Profile_freeing_items_cpu: X.X Profile_logging_slow_query: X.X Profile_logging_slow_query_cpu: X.X
# Profile_total: X.X Profile_total_cpu: X.X
# User@Host: root[root] @ localhost []
# Thread_id: X Schema: test Last_errno: X Killed: X
# Query_time: X.X Lock_time: X.X Rows_sent: X Rows_examined: X Rows_affected: X Rows_read: X
# Bytes_sent: X Tmp_tables: X Tmp_disk_tables: X Tmp_table_sizes: X
# Profile_starting: X.X Profile_starting_cpu: X.X Profile_checking_permissions: X.X Profile_checking_permissions_cpu: X.X Profile_Opening_tables: X.X Profile_Opening_tables_cpu: X.X Profile_init: X.X Profile_init_cpu: X.X Profile_optimizing: X.X Profile_optimizing_cpu: X.X Profile_executing: X.X Profile_executing_cpu: X.X Profile_end: X.X Profile_end_cpu: X.X Profile_query_end: X.X Profile_query_end_cpu: X.X Profile_closing_tables: X.X Profile_closing_tables_cpu: X.X Profile_freeing_items: X.X Profile_freeing_items_cpu: X.X Profile_logging_slow_query: X.X Profile_logging_slow_query_cpu: X.X
# Profile_total: X.X Profile_total_cpu: X.X
SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
#
# This test suffers from server
# Bug#38124 "general_log_file" variable silently unset when using expression
# In short:
# SET GLOBAL general_log_file = @<whatever>
# SET GLOBAL slow_query_log = @<whatever>
# cause that the value of these server system variables is set to default
# instead of the assigned values. There comes no error message or warning.
# If this bug is fixed please
# 1. try this test with "let $fixed_bug38124 = 0;"
# 2. remove all workarounds if 1. was successful.
--source include/have_profiling.inc
let $fixed_bug38124 = 0;
SET @old_slow_query_log_file=@@global.slow_query_log_file;
SET GLOBAL slow_query_log=on;
SET LOCAL log_slow_verbosity='profiling';
SET LOCAL long_query_time=0;
let slogfile=$MYSQLTEST_VARDIR/percona_bug643149_slow.log;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SET GLOBAL slow_query_log_file='$slogfile';
SELECT 1;
perl;
$slogfile= $ENV{'slogfile'};
open(FILE, "$slogfile") or
die("Unable to read slow query log file $slogfile: $!\n");
while(<FILE>) {
next if (!/^#/);
next if (/^# Time:/);
s/[0-9]+/X/g;
print;
}
close(FILE);
EOF
SET GLOBAL slow_query_log_file=@old_slow_query_log_file;
if(!$fixed_bug38124)
{
--disable_query_log
let $my_var = `SELECT @old_slow_query_log_file`;
eval SET @@global.slow_query_log_file = '$my_var';
--enable_query_log
}
show variables like 'innodb_buffer_pool_shm%'; show variables like 'innodb_buffer_pool_shm%';
Variable_name Value Variable_name Value
innodb_buffer_pool_shm_key 123456 innodb_buffer_pool_shm_checksum ON
show variables like 'innodb_buffer_pool_shm%';
Variable_name Value
innodb_buffer_pool_shm_key 123456 innodb_buffer_pool_shm_key 123456
--source include/have_innodb.inc --source include/have_xtradb.inc
show variables like 'innodb_buffer_pool_shm%'; show variables like 'innodb_buffer_pool_shm%';
#clean shutdown (restart_mysqld.inc is not clean if over 10 sec...)
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
wait
EOF
shutdown_server 120;
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
restart
EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
show variables like 'innodb_buffer_pool_shm%';
--sleep 1
--system ipcrm -M 123456
...@@ -11,18 +11,18 @@ insert into t values(1,2); ...@@ -11,18 +11,18 @@ insert into t values(1,2);
# Switch to connection con1 # Switch to connection con1
BEGIN; BEGIN;
SELECT b FROM t WHERE a=1 FOR UPDATE; SELECT b FROM t WHERE a=1 FOR UPDATE;
b
2
# Switch to connection con2 # Switch to connection con2
BEGIN; BEGIN;
SELECT b FROM t WHERE a=2 FOR UPDATE; SELECT b FROM t WHERE a=2 FOR UPDATE;
b
1
# Switch to connection con1 # Switch to connection con1
SELECT b FROM t WHERE a=2 FOR UPDATE; SELECT b FROM t WHERE a=2 FOR UPDATE;
# Switch to connection con2 # Switch to connection con2
SELECT b FROM t WHERE a=1 FOR UPDATE; SELECT b FROM t WHERE a=1 FOR UPDATE;
# Switch to connection con1
ROLLBACK;
# Switch to connection con2
ROLLBACK;
# Switch to connection con3 # Switch to connection con3
1 Deadlocks: 1
# Drop test table # Drop test table
drop table t; drop table t;
...@@ -9,7 +9,6 @@ connect (con3,localhost,root,,); ...@@ -9,7 +9,6 @@ connect (con3,localhost,root,,);
--disable_warnings --disable_warnings
drop table if exists t; drop table if exists t;
--enable_warnings --enable_warnings
disable_abort_on_error;
--echo # Create test table --echo # Create test table
create table t(a INT PRIMARY KEY, b INT) engine=InnoDB; create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
...@@ -20,12 +19,12 @@ insert into t values(1,2); ...@@ -20,12 +19,12 @@ insert into t values(1,2);
#--echo # Save current deadlock count #--echo # Save current deadlock count
let $current = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`; let $current = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
--disable_result_log
--echo # Switch to connection con1 --echo # Switch to connection con1
connection con1; connection con1;
BEGIN; SELECT b FROM t WHERE a=1 FOR UPDATE; BEGIN; SELECT b FROM t WHERE a=1 FOR UPDATE;
#show engine innodb status;
--echo # Switch to connection con2 --echo # Switch to connection con2
connection con2; connection con2;
BEGIN; SELECT b FROM t WHERE a=2 FOR UPDATE; BEGIN; SELECT b FROM t WHERE a=2 FOR UPDATE;
...@@ -38,12 +37,25 @@ SEND SELECT b FROM t WHERE a=2 FOR UPDATE; ...@@ -38,12 +37,25 @@ SEND SELECT b FROM t WHERE a=2 FOR UPDATE;
connection con2; connection con2;
SEND SELECT b FROM t WHERE a=1 FOR UPDATE; SEND SELECT b FROM t WHERE a=1 FOR UPDATE;
SLEEP 0.2; --echo # Switch to connection con1
connection con1;
--error 0, ER_LOCK_DEADLOCK
reap;
ROLLBACK;
--echo # Switch to connection con2
connection con2;
--error 0, ER_LOCK_DEADLOCK
reap;
ROLLBACK;
--echo # Switch to connection con3 --echo # Switch to connection con3
connection con3; connection con3;
let $result = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`; let $result = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
--enable_result_log
let $diff = `SELECT $result - $current`; let $diff = `SELECT $result - $current`;
echo $diff; echo Deadlocks: $diff;
--echo # Drop test table --echo # Drop test table
drop table t; drop table t;
...@@ -48,5 +48,7 @@ if(!`select LENGTH('$log_error_')`) ...@@ -48,5 +48,7 @@ if(!`select LENGTH('$log_error_')`)
# Assign env variable LOG_ERROR # Assign env variable LOG_ERROR
let LOG_ERROR=$log_error_; let LOG_ERROR=$log_error_;
let cmd=cat $log_error | grep "Too many connections" | wc -l; --let grep_file = $log_error
--let grep_pattern = Too many connections
--source grep.inc
exec $cmd; exec $cmd;
SET @old_log_warnings = @@log_warnings;
SET @old_log_warnings_suppress = @@log_warnings_suppress;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(20));
SET GLOBAL log_warnings_suppress='';
SET GLOBAL LOG_WARNINGS=0;
SHOW GLOBAL VARIABLES LIKE 'log_warnings_suppress';
Variable_name Value
log_warnings_suppress
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SET GLOBAL LOG_WARNINGS=1;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SET GLOBAL log_warnings_suppress='1592';
SET GLOBAL LOG_WARNINGS=0;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SET GLOBAL LOG_WARNINGS=1;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
DROP TABLE t1;
SET GLOBAL log_warnings = @old_log_warnings;
SET GLOBAL log_warnings_suppress = @old_log_warnings_suppress;
# Count the number of times the "Unsafe" message was printed
# to the error log.
Occurrences: 1
...@@ -2,26 +2,27 @@ ...@@ -2,26 +2,27 @@
-- source include/have_binlog_format_statement.inc -- source include/have_binlog_format_statement.inc
SET @old_log_warnings = @@log_warnings; SET @old_log_warnings = @@log_warnings;
SET @old_suppress_log_warning_1592 = @@suppress_log_warning_1592; SET @old_log_warnings_suppress = @@log_warnings_suppress;
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(20)); CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(20));
SET GLOBAL SUPPRESS_LOG_WARNING_1592 = 0; SET GLOBAL log_warnings_suppress='';
SET GLOBAL LOG_WARNINGS = 0; SET GLOBAL LOG_WARNINGS=0;
SHOW GLOBAL VARIABLES LIKE 'log_warnings_suppress';
INSERT INTO t1 VALUES(UUID(), 'suppress_1592'); INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
SET GLOBAL LOG_WARNINGS = 1; SET GLOBAL LOG_WARNINGS=1;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592'); INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
SET GLOBAL SUPPRESS_LOG_WARNING_1592 = 1; SET GLOBAL log_warnings_suppress='1592';
SET GLOBAL LOG_WARNINGS = 0; SET GLOBAL LOG_WARNINGS=0;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592'); INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
SET GLOBAL LOG_WARNINGS = 1; SET GLOBAL LOG_WARNINGS=1;
INSERT INTO t1 VALUES(UUID(), 'suppress_1592'); INSERT INTO t1 VALUES(UUID(), 'suppress_1592');
DROP TABLE t1; DROP TABLE t1;
SET GLOBAL log_warnings = @old_log_warnings; SET GLOBAL log_warnings = @old_log_warnings;
SET GLOBAL suppress_log_warning_1592 = @old_suppress_log_warning_1592; SET GLOBAL log_warnings_suppress = @old_log_warnings_suppress;
let $log_error_= `SELECT @@GLOBAL.log_error`; let $log_error_= `SELECT @@GLOBAL.log_error`;
if(!`select LENGTH('$log_error_')`) if(!`select LENGTH('$log_error_')`)
......
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (a INT);
INSERT INTO t2 VALUES(10);
INSERT INTO t2 VALUES(10);
INSERT INTO t2 VALUES(20);
INSERT INTO t2 VALUES(10);
INSERT INTO t2 VALUES(20);
Issuing operation that should not return any rows and stopping the thread #1
SET DEBUG_SYNC= 'locked_table_name SIGNAL thread1_ready WAIT_FOR threads_dumped';
CREATE TABLE t1 (a INT);
SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
Thread #1 stopped
Issuing row-returning query and stopping the thread #2 at the end of query
SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
SELECT a FROM t2 WHERE a > 15;
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
Thread #2 stopped
Look at thread states
SHOW PROCESSLIST;
Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
### root ### test Query ### ### SHOW PROCESSLIST 0 0 2
### root ### test Query ### ### CREATE TABLE t1 (a INT) 0 0 1
### root ### test Query ### ### SELECT a FROM t2 WHERE a > 15 2 5 6
SELECT id, info, rows_sent, rows_examined, rows_read FROM information_schema.processlist
ORDER BY id;
id info rows_sent rows_examined rows_read
### SELECT id, info, rows_sent, rows_examined, rows_read FROM information_schema.processlist
ORDER BY id 0 0 1
### CREATE TABLE t1 (a INT) 0 0 1
### SELECT a FROM t2 WHERE a > 15 2 5 6
Let threads #1 and #2 finish their job
SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
a
20
20
Issuing row-returning query and stopping the thread #2 in the middle of query
SET DEBUG_SYNC= 'sent_row SIGNAL thread2_ready WAIT_FOR threads_dumped';
SELECT a FROM t2 WHERE a > 15;
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
Thread #2 stopped, look at its state
SHOW PROCESSLIST;
Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
### root ### test Query ### ### SHOW PROCESSLIST 0 0 4
### root ### test Sleep ### ### NULL 0 0 1
### root ### test Query ### ### SELECT a FROM t2 WHERE a > 15 1 0 3
SELECT id,rows_sent,rows_examined,rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY Id;
id rows_sent rows_examined rows_read
### 0 0 1
### 0 0 1
### 1 0 3
SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
Let thread #2 finish its job
a
20
20
Issuing an UPDATE and stopping thread #2
SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
UPDATE t2 SET a = 15 WHERE a = 10;
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
Thread #2 stopped, look at its state
SHOW PROCESSLIST;
Id User Host db Command Time State Info Rows_sent Rows_examined Rows_read
### root ### test Query ### ### SHOW PROCESSLIST 0 0 4
### root ### test Sleep ### ### NULL 0 0 1
### root ### test Query ### ### UPDATE t2 SET a = 15 WHERE a = 10 0 5 6
SELECT id,rows_sent,rows_examined,rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY Id;
id rows_sent rows_examined rows_read
### 0 0 1
### 0 0 1
### 0 5 6
SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
Let thread #2 finish its job
DROP TABLES t1, t2;
# Testing of INFORMATION_SCHEMA.PROCESSLIST fields ROWS_SENT, ROWS_EXAMINED, ROWS_READ
--source include/have_debug_sync.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings
CREATE TABLE t2 (a INT);
INSERT INTO t2 VALUES(10);
INSERT INTO t2 VALUES(10);
INSERT INTO t2 VALUES(20);
INSERT INTO t2 VALUES(10);
INSERT INTO t2 VALUES(20);
connect (conn1, localhost, root, ,);
connect (conn2, localhost, root, ,);
--connection conn1
echo Issuing operation that should not return any rows and stopping the thread #1;
SET DEBUG_SYNC= 'locked_table_name SIGNAL thread1_ready WAIT_FOR threads_dumped';
send CREATE TABLE t1 (a INT);
--connection default
SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
--echo Thread #1 stopped
--connection conn2
echo Issuing row-returning query and stopping the thread #2 at the end of query;
SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
send SELECT a FROM t2 WHERE a > 15;
--connection default
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
--echo Thread #2 stopped
--echo Look at thread states
--replace_column 1 ### 3 ### 6 ### 7 ###
SHOW PROCESSLIST;
# The running threads are different between SHOW above and SELECT below. Thus select info too to
# show the difference. Results are in the same order as in SHOW.
--replace_column 1 ###
SELECT id, info, rows_sent, rows_examined, rows_read FROM information_schema.processlist
ORDER BY id;
echo Let threads #1 and #2 finish their job;
SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
--connection conn1
reap;
--connection conn2
reap;
echo Issuing row-returning query and stopping the thread #2 in the middle of query;
SET DEBUG_SYNC= 'sent_row SIGNAL thread2_ready WAIT_FOR threads_dumped';
send SELECT a FROM t2 WHERE a > 15;
--connection default
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
echo Thread #2 stopped, look at its state;
--replace_column 1 ### 3 ### 6 ### 7 ###
SHOW PROCESSLIST;
--replace_column 1 ###
SELECT id,rows_sent,rows_examined,rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY Id;
SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
echo Let thread #2 finish its job;
--connection conn2
reap;
echo Issuing an UPDATE and stopping thread #2;
SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
send UPDATE t2 SET a = 15 WHERE a = 10;
--connection default
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
echo Thread #2 stopped, look at its state;
--replace_column 1 ### 3 ### 6 ### 7 ###
SHOW PROCESSLIST;
--replace_column 1 ###
SELECT id,rows_sent,rows_examined,rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY Id;
SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
echo Let thread #2 finish its job;
--connection conn2
reap;
--connection default
disconnect conn1;
disconnect conn2;
DROP TABLES t1, t2;
--source include/percona_query_cache_with_comments_clear.inc --source percona_query_cache_with_comments_clear.inc
let $query=/* with comment first */select * from t1; let $query=/* with comment first */select * from t1;
eval $query; eval $query;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=# with comment first let $query=# with comment first
select * from t1; select * from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=-- with comment first let $query=-- with comment first
select * from t1; select * from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=/* with comment first and "quote" */select * from t1; let $query=/* with comment first and "quote" */select * from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=# with comment first and "quote" let $query=# with comment first and "quote"
select * from t1; select * from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=-- with comment first and "quote" let $query=-- with comment first and "quote"
select * from t1; select * from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query= let $query=
/* with comment and whitespaces first */select * from t1; /* with comment and whitespaces first */select * from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query= let $query=
# with comment and whitespaces first # with comment and whitespaces first
select * from t1; select * from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query= let $query=
-- with comment and whitespaces first -- with comment and whitespaces first
select * from t1; select * from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $internal=* internal comment *; let $internal=* internal comment *;
let $query=select * /$internal/ from t1; let $query=select * /$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select */$internal/ from t1; let $query=select */$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select */$internal/from t1; let $query=select */$internal/from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $internal=* internal comment with "quote" *; let $internal=* internal comment with "quote" *;
let $query=select * /$internal/ from t1; let $query=select * /$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select */$internal/ from t1; let $query=select */$internal/ from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select */$internal/from t1; let $query=select */$internal/from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select * from t1 let $query=select * from t1
; ;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select * from t1 ; let $query=select * from t1 ;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select * from t1 ; let $query=select * from t1 ;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select * from t1 let $query=select * from t1
/* comment in the end */; /* comment in the end */;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select * from t1 let $query=select * from t1
/* *\/ */; /* *\/ */;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select * from t1 let $query=select * from t1
/* comment in the end */ /* comment in the end */
; ;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select * from t1 #comment in the end; let $query=select * from t1 #comment in the end;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select * from t1 #comment in the end let $query=select * from t1 #comment in the end
; ;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select * from t1 -- comment in the end; let $query=select * from t1 -- comment in the end;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select * from t1 -- comment in the end let $query=select * from t1 -- comment in the end
; ;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
let $query=select ' \' ' from t1; let $query=select ' \' ' from t1;
--source include/percona_query_cache_with_comments_eval.inc --source percona_query_cache_with_comments_eval.inc
--disable_ps_protocol
set global query_cache_strip_comments=ON; set global query_cache_strip_comments=ON;
-- source include/percona_query_cache_with_comments_begin.inc -- source include/percona_query_cache_with_comments_begin.inc
-- source include/percona_query_cache_with_comments.inc -- source include/percona_query_cache_with_comments.inc
......
...@@ -9,4 +9,4 @@ drop table if exists t1; ...@@ -9,4 +9,4 @@ drop table if exists t1;
create table t1 (a int not null); create table t1 (a int not null);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
--source include/percona_query_cache_with_comments_clear.inc --source percona_query_cache_with_comments_clear.inc
echo -----------------------------------------------------; echo -----------------------------------------------------;
echo $query; echo $query;
echo -----------------------------------------------------; echo -----------------------------------------------------;
--source include/percona_query_cache_with_comments_show.inc --source percona_query_cache_with_comments_show.inc
eval $query; eval $query;
eval $query; eval $query;
--source include/percona_query_cache_with_comments_show.inc --source percona_query_cache_with_comments_show.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
CREATE TABLE t(id INT); CREATE TABLE t(id INT);
SELECT * from t; SELECT * from t;
...@@ -21,12 +17,16 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; ...@@ -21,12 +17,16 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value Variable_name Value
query_response_time_range_base 10 query_response_time_range_base 10
FLUSH QUERY_RESPONSE_TIME; FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=ON; SET GLOBAL QUERY_RESPONSE_TIME_STATS=ON;
INSERT INTO t VALUES(0); INSERT INTO t SELECT SLEEP(0.4);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
0 0
INSERT INTO t VALUES(1); INSERT INTO t SELECT SLEEP(0.4);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
0 0
...@@ -41,11 +41,15 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; ...@@ -41,11 +41,15 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value Variable_name Value
query_response_time_range_base 2 query_response_time_range_base 2
FLUSH QUERY_RESPONSE_TIME; FLUSH QUERY_RESPONSE_TIME;
INSERT INTO t VALUES(0); INSERT INTO t SELECT SLEEP(0.4);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
0 0
INSERT INTO t VALUES(1); INSERT INTO t SELECT SLEEP(0.4);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
0 0
...@@ -57,4 +61,6 @@ SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) ...@@ -57,4 +61,6 @@ SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
3 3
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=OFF; SET GLOBAL QUERY_RESPONSE_TIME_STATS=OFF;
STOP SLAVE;
include/wait_for_slave_to_stop.inc
--source include/have_response_time_distribution.inc
--source include/master-slave.inc --source include/master-slave.inc
--source include/have_binlog_format_statement.inc
--source include/have_debug.inc
--disable_query_log
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement:");
--enable_query_log
connection master; connection master;
-- disable_warnings -- disable_warnings
...@@ -16,12 +22,12 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; ...@@ -16,12 +22,12 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc; source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=ON; SET GLOBAL QUERY_RESPONSE_TIME_STATS=ON;
connection master; connection master;
INSERT INTO t VALUES(0); INSERT INTO t SELECT SLEEP(0.4);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
INSERT INTO t VALUES(1); INSERT INTO t SELECT SLEEP(0.4);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
sync_slave_with_master; sync_slave_with_master;
...@@ -34,9 +40,9 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; ...@@ -34,9 +40,9 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc; source include/percona_query_response_time_flush.inc;
connection master; connection master;
INSERT INTO t VALUES(0); INSERT INTO t SELECT SLEEP(0.4);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
INSERT INTO t VALUES(1); INSERT INTO t SELECT SLEEP(0.4);
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
sync_slave_with_master; sync_slave_with_master;
...@@ -49,4 +55,7 @@ DROP TABLE IF EXISTS t; ...@@ -49,4 +55,7 @@ DROP TABLE IF EXISTS t;
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=OFF; SET GLOBAL QUERY_RESPONSE_TIME_STATS=OFF;
STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc
SET GLOBAL debug="d,query_exec_time_debug";
CREATE FUNCTION test_f() CREATE FUNCTION test_f()
RETURNS CHAR(30) DETERMINISTIC RETURNS CHAR(30) DETERMINISTIC
BEGIN BEGIN
DECLARE first VARCHAR(5); SET SESSION debug="+d,query_exec_time_1.1";
DECLARE second VARCHAR(5); RETURN 'Hello, world!';
DECLARE result VARCHAR(20);
SELECT SLEEP(1.11) INTO first;
SET first= 'Hello';
SET second=', ';
SET result= CONCAT(first,second);
SET result= CONCAT(result,'world!');
RETURN result;
END/ END/
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1; SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
Warnings: Warnings:
...@@ -78,7 +72,7 @@ time ...@@ -78,7 +72,7 @@ time
4194304.00000 4194304.00000
8388608.00000 8388608.00000
TOO LONG TOO LONG
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f(); SELECT test_f();
test_f() test_f()
Hello, world! Hello, world!
...@@ -91,7 +85,7 @@ Hello, world! ...@@ -91,7 +85,7 @@ Hello, world!
SELECT test_f(); SELECT test_f();
test_f() test_f()
Hello, world! Hello, world!
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count, SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, (SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, (SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
...@@ -99,8 +93,7 @@ SELECT d.count, ...@@ -99,8 +93,7 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count (SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count count query_count query_total not_zero_region_count region_count
1 5 4 2 44 4 4 4 1 44
4 5 4 2 44
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count region_count
44 44
...@@ -158,11 +151,11 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; ...@@ -158,11 +151,11 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value Variable_name Value
query_response_time_range_base 10 query_response_time_range_base 10
FLUSH QUERY_RESPONSE_TIME; FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f(); SELECT test_f();
test_f() test_f()
Hello, world! Hello, world!
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count, SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, (SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, (SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
...@@ -170,8 +163,7 @@ SELECT d.count, ...@@ -170,8 +163,7 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count (SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count count query_count query_total not_zero_region_count region_count
1 2 1 2 14 1 1 1 1 14
1 2 1 2 14
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count region_count
14 14
...@@ -199,11 +191,11 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; ...@@ -199,11 +191,11 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value Variable_name Value
query_response_time_range_base 7 query_response_time_range_base 7
FLUSH QUERY_RESPONSE_TIME; FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f(); SELECT test_f();
test_f() test_f()
Hello, world! Hello, world!
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count, SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, (SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, (SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
...@@ -211,8 +203,7 @@ SELECT d.count, ...@@ -211,8 +203,7 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count (SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count count query_count query_total not_zero_region_count region_count
1 2 1 2 17 1 1 1 1 17
1 2 1 2 17
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count region_count
17 17
...@@ -243,11 +234,11 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; ...@@ -243,11 +234,11 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value Variable_name Value
query_response_time_range_base 156 query_response_time_range_base 156
FLUSH QUERY_RESPONSE_TIME; FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f(); SELECT test_f();
test_f() test_f()
Hello, world! Hello, world!
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count, SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, (SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, (SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
...@@ -255,8 +246,7 @@ SELECT d.count, ...@@ -255,8 +246,7 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count (SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count count query_count query_total not_zero_region_count region_count
1 2 1 2 7 1 1 1 1 7
1 2 1 2 7
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count region_count
7 7
...@@ -277,11 +267,11 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; ...@@ -277,11 +267,11 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value Variable_name Value
query_response_time_range_base 1000 query_response_time_range_base 1000
FLUSH QUERY_RESPONSE_TIME; FLUSH QUERY_RESPONSE_TIME;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f(); SELECT test_f();
test_f() test_f()
Hello, world! Hello, world!
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SELECT d.count, SELECT d.count,
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, (SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, (SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
...@@ -289,8 +279,7 @@ SELECT d.count, ...@@ -289,8 +279,7 @@ SELECT d.count,
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count (SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
count query_count query_total not_zero_region_count region_count count query_count query_total not_zero_region_count region_count
1 2 1 2 6 1 1 1 1 6
1 2 1 2 6
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
region_count region_count
6 6
...@@ -311,6 +300,7 @@ Warning 1292 Truncated incorrect query_response_time_range_base value: '1001' ...@@ -311,6 +300,7 @@ Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
Variable_name Value Variable_name Value
query_response_time_range_base 1000 query_response_time_range_base 1000
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10; SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
DROP FUNCTION test_f; DROP FUNCTION test_f;
SET GLOBAL debug=default;
source include/have_innodb.inc; --source include/have_response_time_distribution.inc
--source include/have_debug.inc
SET GLOBAL debug="d,query_exec_time_debug";
delimiter /; delimiter /;
CREATE FUNCTION test_f() CREATE FUNCTION test_f()
RETURNS CHAR(30) DETERMINISTIC RETURNS CHAR(30) DETERMINISTIC
BEGIN BEGIN
DECLARE first VARCHAR(5); SET SESSION debug="+d,query_exec_time_1.1";
DECLARE second VARCHAR(5); RETURN 'Hello, world!';
DECLARE result VARCHAR(20);
SELECT SLEEP(1.11) INTO first;
SET first= 'Hello';
SET second=', ';
SET result= CONCAT(first,second);
SET result= CONCAT(result,'world!');
RETURN result;
END/ END/
delimiter ;/ delimiter ;/
...@@ -24,12 +20,12 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; ...@@ -24,12 +20,12 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc; source include/percona_query_response_time_flush.inc;
source include/percona_query_response_time_show.inc; source include/percona_query_response_time_show.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f(); SELECT test_f();
SELECT test_f(); SELECT test_f();
SELECT test_f(); SELECT test_f();
SELECT test_f(); SELECT test_f();
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc; source include/percona_query_response_time_show.inc;
...@@ -38,9 +34,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; ...@@ -38,9 +34,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc; source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f(); SELECT test_f();
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc; source include/percona_query_response_time_show.inc;
...@@ -49,9 +45,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7; ...@@ -49,9 +45,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc; source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f(); SELECT test_f();
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc; source include/percona_query_response_time_show.inc;
...@@ -60,9 +56,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156; ...@@ -60,9 +56,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc; source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f(); SELECT test_f();
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc; source include/percona_query_response_time_show.inc;
...@@ -71,9 +67,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000; ...@@ -71,9 +67,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc; source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
SELECT test_f(); SELECT test_f();
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc; source include/percona_query_response_time_show.inc;
...@@ -81,7 +77,9 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; ...@@ -81,7 +77,9 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001; SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10; SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
DROP FUNCTION test_f; DROP FUNCTION test_f;
SET GLOBAL debug=default;
source include/have_innodb.inc; --source include/have_response_time_distribution.inc
--source include/have_debug.inc
SET GLOBAL debug="d,query_exec_time_debug";
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1; SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2; SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
...@@ -7,9 +11,9 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; ...@@ -7,9 +11,9 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc; source include/percona_query_response_time_flush.inc;
source include/percona_query_response_time_show.inc; source include/percona_query_response_time_show.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc; source include/percona_query_response_time_sleep.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc; source include/percona_query_response_time_show.inc;
...@@ -18,9 +22,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; ...@@ -18,9 +22,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc; source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc; source include/percona_query_response_time_sleep.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc; source include/percona_query_response_time_show.inc;
...@@ -29,9 +33,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7; ...@@ -29,9 +33,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc; source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc; source include/percona_query_response_time_sleep.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc; source include/percona_query_response_time_show.inc;
...@@ -40,9 +44,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156; ...@@ -40,9 +44,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc; source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc; source include/percona_query_response_time_sleep.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc; source include/percona_query_response_time_show.inc;
...@@ -51,9 +55,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000; ...@@ -51,9 +55,9 @@ SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
source include/percona_query_response_time_flush.inc; source include/percona_query_response_time_flush.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1; SET GLOBAL QUERY_RESPONSE_TIME_STATS=1;
source include/percona_query_response_time_sleep.inc; source include/percona_query_response_time_sleep.inc;
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
source include/percona_query_response_time_show.inc; source include/percona_query_response_time_show.inc;
...@@ -61,5 +65,7 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; ...@@ -61,5 +65,7 @@ SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001; SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0; SET GLOBAL QUERY_RESPONSE_TIME_STATS=0;
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10; SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
SET GLOBAL debug=default;
SET SESSION debug="+d,query_exec_time_0.31";
SET SESSION debug="+d,query_exec_time_0.32";
SET SESSION debug="+d,query_exec_time_0.33";
SET SESSION debug="+d,query_exec_time_0.34";
SET SESSION debug="+d,query_exec_time_0.35";
SET SESSION debug="+d,query_exec_time_0.36";
SET SESSION debug="+d,query_exec_time_0.37";
SET SESSION debug="+d,query_exec_time_0.38";
SET SESSION debug="+d,query_exec_time_0.39";
SET SESSION debug="+d,query_exec_time_0.4";
SET SESSION debug="+d,query_exec_time_1.1";
SET SESSION debug="+d,query_exec_time_1.2";
SET SESSION debug="+d,query_exec_time_1.3";
SET SESSION debug="+d,query_exec_time_1.5";
SET SESSION debug="+d,query_exec_time_1.4";
SET SESSION debug="+d,query_exec_time_0.5";
SET SESSION debug="+d,query_exec_time_2.1";
SET SESSION debug="+d,query_exec_time_2.3";
SET SESSION debug="+d,query_exec_time_2.5";
--source have_response_time_distribution.inc
--source include/have_xtradb.inc
SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
show variables;
Variable_name Value
auto_increment_increment Value
auto_increment_offset Value
autocommit Value
automatic_sp_privileges Value
back_log Value
basedir Value
big_tables Value
binlog_cache_size Value
binlog_direct_non_transactional_updates Value
binlog_format Value
bulk_insert_buffer_size Value
character_set_client Value
character_set_connection Value
character_set_database Value
character_set_filesystem Value
character_set_results Value
character_set_server Value
character_set_system Value
character_sets_dir Value
collation_connection Value
collation_database Value
collation_server Value
completion_type Value
concurrent_insert Value
connect_timeout Value
datadir Value
date_format Value
datetime_format Value
debug Value
debug_sync Value
default_week_format Value
delay_key_write Value
delayed_insert_limit Value
delayed_insert_timeout Value
delayed_queue_size Value
div_precision_increment Value
enable_query_response_time_stats Value
engine_condition_pushdown Value
error_count Value
event_scheduler Value
expire_logs_days Value
fast_index_creation Value
flush Value
flush_time Value
foreign_key_checks Value
ft_boolean_syntax Value
ft_max_word_len Value
ft_min_word_len Value
ft_query_expansion_limit Value
ft_stopword_file Value
general_log Value
general_log_file Value
group_concat_max_len Value
have_community_features Value
have_compress Value
have_crypt Value
have_csv Value
have_dynamic_loading Value
have_geometry Value
have_innodb Value
have_ndbcluster Value
have_openssl Value
have_partitioning Value
have_query_cache Value
have_rtree_keys Value
have_ssl Value
have_symlink Value
hostname Value
identity Value
ignore_builtin_innodb Value
init_connect Value
init_file Value
init_slave Value
innodb_adaptive_checkpoint Value
innodb_adaptive_flushing Value
innodb_adaptive_hash_index Value
innodb_additional_mem_pool_size Value
innodb_auto_lru_dump Value
innodb_autoextend_increment Value
innodb_autoinc_lock_mode Value
innodb_buffer_pool_shm_checksum Value
innodb_buffer_pool_shm_key Value
innodb_buffer_pool_size Value
innodb_change_buffering Value
innodb_checkpoint_age_target Value
innodb_checksums Value
innodb_commit_concurrency Value
innodb_concurrency_tickets Value
innodb_data_file_path Value
innodb_data_home_dir Value
innodb_dict_size_limit Value
innodb_doublewrite Value
innodb_doublewrite_file Value
innodb_enable_unsafe_group_commit Value
innodb_expand_import Value
innodb_extra_rsegments Value
innodb_extra_undoslots Value
innodb_fast_checksum Value
innodb_fast_recovery Value
innodb_fast_shutdown Value
innodb_file_format Value
innodb_file_format_check Value
innodb_file_per_table Value
innodb_flush_log_at_trx_commit Value
innodb_flush_log_at_trx_commit_session Value
innodb_flush_method Value
innodb_flush_neighbor_pages Value
innodb_force_recovery Value
innodb_ibuf_accel_rate Value
innodb_ibuf_active_contract Value
innodb_ibuf_max_size Value
innodb_io_capacity Value
innodb_lock_wait_timeout Value
innodb_locks_unsafe_for_binlog Value
innodb_log_buffer_size Value
innodb_log_file_size Value
innodb_log_files_in_group Value
innodb_log_group_home_dir Value
innodb_max_dirty_pages_pct Value
innodb_max_purge_lag Value
innodb_mirrored_log_groups Value
innodb_old_blocks_pct Value
innodb_old_blocks_time Value
innodb_open_files Value
innodb_overwrite_relay_log_info Value
innodb_page_size Value
innodb_pass_corrupt_table Value
innodb_read_ahead Value
innodb_read_ahead_threshold Value
innodb_read_io_threads Value
innodb_recovery_stats Value
innodb_replication_delay Value
innodb_rollback_on_timeout Value
innodb_show_locks_held Value
innodb_show_verbose_locks Value
innodb_spin_wait_delay Value
innodb_stats_auto_update Value
innodb_stats_method Value
innodb_stats_on_metadata Value
innodb_stats_sample_pages Value
innodb_stats_update_need_lock Value
innodb_strict_mode Value
innodb_support_xa Value
innodb_sync_spin_loops Value
innodb_table_locks Value
innodb_thread_concurrency Value
innodb_thread_concurrency_timer_based Value
innodb_thread_sleep_delay Value
innodb_use_purge_thread Value
innodb_use_sys_malloc Value
innodb_use_sys_stats_table Value
innodb_version Value
innodb_write_io_threads Value
insert_id Value
interactive_timeout Value
join_buffer_size Value
keep_files_on_create Value
key_buffer_size Value
key_cache_age_threshold Value
key_cache_block_size Value
key_cache_division_limit Value
language Value
large_files_support Value
large_page_size Value
large_pages Value
last_insert_id Value
lc_time_names Value
license Value
local_infile Value
locked_in_memory Value
log Value
log_bin Value
log_bin_trust_function_creators Value
log_bin_trust_routine_creators Value
log_error Value
log_output Value
log_queries_not_using_indexes Value
log_slave_updates Value
log_slow_filter Value
log_slow_queries Value
log_slow_rate_limit Value
log_slow_slave_statements Value
log_slow_sp_statements Value
log_slow_timestamp_every Value
log_slow_verbosity Value
log_warnings Value
long_query_time Value
low_priority_updates Value
lower_case_file_system Value
lower_case_table_names Value
max_allowed_packet Value
max_binlog_cache_size Value
max_binlog_size Value
max_connect_errors Value
max_connections Value
max_delayed_threads Value
max_error_count Value
max_heap_table_size Value
max_insert_delayed_threads Value
max_join_size Value
max_length_for_sort_data Value
max_prepared_stmt_count Value
max_relay_log_size Value
max_seeks_for_key Value
max_sort_length Value
max_sp_recursion_depth Value
max_tmp_tables Value
max_user_connections Value
max_write_lock_count Value
min_examined_row_limit Value
multi_range_count Value
myisam_data_pointer_size Value
myisam_max_sort_file_size Value
myisam_mmap_size Value
myisam_recover_options Value
myisam_repair_threads Value
myisam_sort_buffer_size Value
myisam_stats_method Value
myisam_use_mmap Value
net_buffer_length Value
net_read_timeout Value
net_retry_count Value
net_write_timeout Value
new Value
old Value
old_alter_table Value
old_passwords Value
open_files_limit Value
optimizer_fix Value
optimizer_prune_level Value
optimizer_search_depth Value
optimizer_switch Value
pid_file Value
plugin_dir Value
port Value
preload_buffer_size Value
profiling Value
profiling_history_size Value
profiling_server Value
profiling_use_getrusage Value
protocol_version Value
pseudo_thread_id Value
query_alloc_block_size Value
query_cache_limit Value
query_cache_min_res_unit Value
query_cache_size Value
query_cache_strip_comments Value
query_cache_type Value
query_cache_wlock_invalidate Value
query_prealloc_size Value
query_response_time_range_base Value
rand_seed1 Value
rand_seed2 Value
range_alloc_block_size Value
read_buffer_size Value
read_only Value
read_rnd_buffer_size Value
relay_log Value
relay_log_index Value
relay_log_info_file Value
relay_log_purge Value
relay_log_space_limit Value
report_host Value
report_password Value
report_port Value
report_user Value
rpl_recovery_rank Value
secure_auth Value
secure_file_priv Value
server_id Value
skip_external_locking Value
skip_name_resolve Value
skip_networking Value
skip_show_database Value
slave_compressed_protocol Value
slave_exec_mode Value
slave_load_tmpdir Value
slave_net_timeout Value
slave_skip_errors Value
slave_transaction_retries Value
slow_launch_time Value
slow_query_log Value
slow_query_log_file Value
slow_query_log_microseconds_timestamp Value
socket Value
sort_buffer_size Value
sql_auto_is_null Value
sql_big_selects Value
sql_big_tables Value
sql_buffer_result Value
sql_log_bin Value
sql_log_off Value
sql_log_update Value
sql_low_priority_updates Value
sql_max_join_size Value
sql_mode Value
sql_notes Value
sql_quote_show_create Value
sql_safe_updates Value
sql_select_limit Value
sql_slave_skip_counter Value
sql_warnings Value
ssl_ca Value
ssl_capath Value
ssl_cert Value
ssl_cipher Value
ssl_key Value
storage_engine Value
suppress_log_warning_1592 Value
sync_binlog Value
sync_frm Value
system_time_zone Value
table_definition_cache Value
table_lock_wait_timeout Value
table_open_cache Value
table_type Value
thread_cache_size Value
thread_handling Value
thread_stack Value
thread_statistics Value
time_format Value
time_zone Value
timed_mutexes Value
timestamp Value
tmp_table_size Value
tmpdir Value
transaction_alloc_block_size Value
transaction_prealloc_size Value
tx_isolation Value
unique_checks Value
updatable_views_with_limit Value
use_global_log_slow_control Value
use_global_long_query_time Value
userstat_running Value
version Value
version_comment Value
version_compile_machine Value
version_compile_os Value
wait_timeout Value
warning_count Value
--source include/have_innodb.inc
--source include/have_debug.inc
#check the list of variable names
--replace_column 2 Value
show variables;
SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
Variable_name
AUTOCOMMIT
AUTOMATIC_SP_PRIVILEGES
AUTO_INCREMENT_INCREMENT
AUTO_INCREMENT_OFFSET
BACK_LOG
BASEDIR
BIG_TABLES
BINLOG_CACHE_SIZE
BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
BINLOG_FORMAT
BINLOG_STMT_CACHE_SIZE
BULK_INSERT_BUFFER_SIZE
CHARACTER_SETS_DIR
CHARACTER_SET_CLIENT
CHARACTER_SET_CONNECTION
CHARACTER_SET_DATABASE
CHARACTER_SET_FILESYSTEM
CHARACTER_SET_RESULTS
CHARACTER_SET_SERVER
CHARACTER_SET_SYSTEM
COLLATION_CONNECTION
COLLATION_DATABASE
COLLATION_SERVER
COMPLETION_TYPE
CONCURRENT_INSERT
CONNECT_TIMEOUT
DATADIR
DATETIME_FORMAT
DATE_FORMAT
DEBUG
DEBUG_SYNC
DEFAULT_STORAGE_ENGINE
DEFAULT_WEEK_FORMAT
DELAYED_INSERT_LIMIT
DELAYED_INSERT_TIMEOUT
DELAYED_QUEUE_SIZE
DELAY_KEY_WRITE
DIV_PRECISION_INCREMENT
ENGINE_CONDITION_PUSHDOWN
ERROR_COUNT
EVENT_SCHEDULER
EXPIRE_LOGS_DAYS
EXTERNAL_USER
FAST_INDEX_CREATION
FLUSH
FLUSH_TIME
FOREIGN_KEY_CHECKS
FT_BOOLEAN_SYNTAX
FT_MAX_WORD_LEN
FT_MIN_WORD_LEN
FT_QUERY_EXPANSION_LIMIT
FT_STOPWORD_FILE
GENERAL_LOG
GENERAL_LOG_FILE
GROUP_CONCAT_MAX_LEN
HAVE_COMPRESS
HAVE_CRYPT
HAVE_CSV
HAVE_DYNAMIC_LOADING
HAVE_GEOMETRY
HAVE_INNODB
HAVE_NDBCLUSTER
HAVE_OPENSSL
HAVE_PARTITIONING
HAVE_PROFILING
HAVE_QUERY_CACHE
HAVE_RESPONSE_TIME_DISTRIBUTION
HAVE_RTREE_KEYS
HAVE_SSL
HAVE_SYMLINK
HOSTNAME
IDENTITY
IGNORE_BUILTIN_INNODB
INIT_CONNECT
INIT_FILE
INIT_SLAVE
INNODB_ADAPTIVE_FLUSHING
INNODB_ADAPTIVE_FLUSHING_METHOD
INNODB_ADAPTIVE_HASH_INDEX
INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS
INNODB_ADDITIONAL_MEM_POOL_SIZE
INNODB_AUTOEXTEND_INCREMENT
INNODB_AUTOINC_LOCK_MODE
INNODB_BUFFER_POOL_INSTANCES
INNODB_BUFFER_POOL_RESTORE_AT_STARTUP
INNODB_BUFFER_POOL_SHM_CHECKSUM
INNODB_BUFFER_POOL_SHM_KEY
INNODB_BUFFER_POOL_SIZE
INNODB_CHANGE_BUFFERING
INNODB_CHANGE_BUFFERING_DEBUG
INNODB_CHECKPOINT_AGE_TARGET
INNODB_CHECKSUMS
INNODB_COMMIT_CONCURRENCY
INNODB_CONCURRENCY_TICKETS
INNODB_CORRUPT_TABLE_ACTION
INNODB_DATA_FILE_PATH
INNODB_DATA_HOME_DIR
INNODB_DICT_SIZE_LIMIT
INNODB_DOUBLEWRITE
INNODB_DOUBLEWRITE_FILE
INNODB_FAST_CHECKSUM
INNODB_FAST_SHUTDOWN
INNODB_FILE_FORMAT
INNODB_FILE_FORMAT_CHECK
INNODB_FILE_FORMAT_MAX
INNODB_FILE_PER_TABLE
INNODB_FLUSH_LOG_AT_TRX_COMMIT
INNODB_FLUSH_METHOD
INNODB_FLUSH_NEIGHBOR_PAGES
INNODB_FORCE_RECOVERY
INNODB_IBUF_ACCEL_RATE
INNODB_IBUF_ACTIVE_CONTRACT
INNODB_IBUF_MAX_SIZE
INNODB_IMPORT_TABLE_FROM_XTRABACKUP
INNODB_IO_CAPACITY
INNODB_LAZY_DROP_TABLE
INNODB_LOCKS_UNSAFE_FOR_BINLOG
INNODB_LOCK_WAIT_TIMEOUT
INNODB_LOG_BLOCK_SIZE
INNODB_LOG_BUFFER_SIZE
INNODB_LOG_FILES_IN_GROUP
INNODB_LOG_FILE_SIZE
INNODB_LOG_GROUP_HOME_DIR
INNODB_MAX_DIRTY_PAGES_PCT
INNODB_MAX_PURGE_LAG
INNODB_MIRRORED_LOG_GROUPS
INNODB_OLD_BLOCKS_PCT
INNODB_OLD_BLOCKS_TIME
INNODB_OPEN_FILES
INNODB_PAGE_SIZE
INNODB_PURGE_BATCH_SIZE
INNODB_PURGE_THREADS
INNODB_READ_AHEAD
INNODB_READ_AHEAD_THRESHOLD
INNODB_READ_IO_THREADS
INNODB_RECOVERY_STATS
INNODB_RECOVERY_UPDATE_RELAY_LOG
INNODB_REPLICATION_DELAY
INNODB_ROLLBACK_ON_TIMEOUT
INNODB_ROLLBACK_SEGMENTS
INNODB_SHOW_LOCKS_HELD
INNODB_SHOW_VERBOSE_LOCKS
INNODB_SPIN_WAIT_DELAY
INNODB_STATS_AUTO_UPDATE
INNODB_STATS_METHOD
INNODB_STATS_ON_METADATA
INNODB_STATS_SAMPLE_PAGES
INNODB_STATS_UPDATE_NEED_LOCK
INNODB_STRICT_MODE
INNODB_SUPPORT_XA
INNODB_SYNC_SPIN_LOOPS
INNODB_TABLE_LOCKS
INNODB_THREAD_CONCURRENCY
INNODB_THREAD_CONCURRENCY_TIMER_BASED
INNODB_THREAD_SLEEP_DELAY
INNODB_USE_GLOBAL_FLUSH_LOG_AT_TRX_COMMIT
INNODB_USE_NATIVE_AIO
INNODB_USE_SYS_MALLOC
INNODB_USE_SYS_STATS_TABLE
INNODB_VERSION
INNODB_WRITE_IO_THREADS
INSERT_ID
INTERACTIVE_TIMEOUT
JOIN_BUFFER_SIZE
KEEP_FILES_ON_CREATE
KEY_BUFFER_SIZE
KEY_CACHE_AGE_THRESHOLD
KEY_CACHE_BLOCK_SIZE
KEY_CACHE_DIVISION_LIMIT
LARGE_FILES_SUPPORT
LARGE_PAGES
LARGE_PAGE_SIZE
LAST_INSERT_ID
LC_MESSAGES
LC_MESSAGES_DIR
LC_TIME_NAMES
LICENSE
LOCAL_INFILE
LOCKED_IN_MEMORY
LOCK_WAIT_TIMEOUT
LOG
LOG_BIN
LOG_BIN_TRUST_FUNCTION_CREATORS
LOG_ERROR
LOG_OUTPUT
LOG_QUERIES_NOT_USING_INDEXES
LOG_SLAVE_UPDATES
LOG_SLOW_FILTER
LOG_SLOW_QUERIES
LOG_SLOW_RATE_LIMIT
LOG_SLOW_SLAVE_STATEMENTS
LOG_SLOW_SP_STATEMENTS
LOG_SLOW_VERBOSITY
LOG_WARNINGS
LOG_WARNINGS_SUPPRESS
LONG_QUERY_TIME
LOWER_CASE_FILE_SYSTEM
LOWER_CASE_TABLE_NAMES
LOW_PRIORITY_UPDATES
MAX_ALLOWED_PACKET
MAX_BINLOG_CACHE_SIZE
MAX_BINLOG_SIZE
MAX_BINLOG_STMT_CACHE_SIZE
MAX_CONNECTIONS
MAX_CONNECT_ERRORS
MAX_DELAYED_THREADS
MAX_ERROR_COUNT
MAX_HEAP_TABLE_SIZE
MAX_INSERT_DELAYED_THREADS
MAX_JOIN_SIZE
MAX_LENGTH_FOR_SORT_DATA
MAX_LONG_DATA_SIZE
MAX_PREPARED_STMT_COUNT
MAX_RELAY_LOG_SIZE
MAX_SEEKS_FOR_KEY
MAX_SORT_LENGTH
MAX_SP_RECURSION_DEPTH
MAX_TMP_TABLES
MAX_USER_CONNECTIONS
MAX_WRITE_LOCK_COUNT
MIN_EXAMINED_ROW_LIMIT
MULTI_RANGE_COUNT
MYISAM_DATA_POINTER_SIZE
MYISAM_MAX_SORT_FILE_SIZE
MYISAM_MMAP_SIZE
MYISAM_RECOVER_OPTIONS
MYISAM_REPAIR_THREADS
MYISAM_SORT_BUFFER_SIZE
MYISAM_STATS_METHOD
MYISAM_USE_MMAP
NET_BUFFER_LENGTH
NET_READ_TIMEOUT
NET_RETRY_COUNT
NET_WRITE_TIMEOUT
NEW
OLD
OLD_ALTER_TABLE
OLD_PASSWORDS
OPEN_FILES_LIMIT
OPTIMIZER_FIX
OPTIMIZER_PRUNE_LEVEL
OPTIMIZER_SEARCH_DEPTH
OPTIMIZER_SWITCH
PERFORMANCE_SCHEMA
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
PERFORMANCE_SCHEMA_MAX_COND_CLASSES
PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
PID_FILE
PLUGIN_DIR
PORT
PRELOAD_BUFFER_SIZE
PROFILING
PROFILING_HISTORY_SIZE
PROTOCOL_VERSION
PROXY_USER
PSEUDO_THREAD_ID
QUERY_ALLOC_BLOCK_SIZE
QUERY_CACHE_LIMIT
QUERY_CACHE_MIN_RES_UNIT
QUERY_CACHE_SIZE
QUERY_CACHE_STRIP_COMMENTS
QUERY_CACHE_TYPE
QUERY_CACHE_WLOCK_INVALIDATE
QUERY_PREALLOC_SIZE
QUERY_RESPONSE_TIME_RANGE_BASE
QUERY_RESPONSE_TIME_STATS
RAND_SEED1
RAND_SEED2
RANGE_ALLOC_BLOCK_SIZE
READ_BUFFER_SIZE
READ_ONLY
READ_RND_BUFFER_SIZE
RELAY_LOG
RELAY_LOG_INDEX
RELAY_LOG_INFO_FILE
RELAY_LOG_PURGE
RELAY_LOG_RECOVERY
RELAY_LOG_SPACE_LIMIT
REPORT_HOST
REPORT_PASSWORD
REPORT_PORT
REPORT_USER
RPL_RECOVERY_RANK
SECURE_AUTH
SECURE_FILE_PRIV
SERVER_ID
SKIP_EXTERNAL_LOCKING
SKIP_NAME_RESOLVE
SKIP_NETWORKING
SKIP_SHOW_DATABASE
SLAVE_COMPRESSED_PROTOCOL
SLAVE_EXEC_MODE
SLAVE_LOAD_TMPDIR
SLAVE_NET_TIMEOUT
SLAVE_SKIP_ERRORS
SLAVE_TRANSACTION_RETRIES
SLAVE_TYPE_CONVERSIONS
SLOW_LAUNCH_TIME
SLOW_QUERY_LOG
SLOW_QUERY_LOG_FILE
SLOW_QUERY_LOG_TIMESTAMP_ALWAYS
SLOW_QUERY_LOG_TIMESTAMP_PRECISION
SLOW_QUERY_LOG_USE_GLOBAL_CONTROL
SOCKET
SORT_BUFFER_SIZE
SQL_AUTO_IS_NULL
SQL_BIG_SELECTS
SQL_BIG_TABLES
SQL_BUFFER_RESULT
SQL_LOG_BIN
SQL_LOG_OFF
SQL_LOW_PRIORITY_UPDATES
SQL_MAX_JOIN_SIZE
SQL_MODE
SQL_NOTES
SQL_QUOTE_SHOW_CREATE
SQL_SAFE_UPDATES
SQL_SELECT_LIMIT
SQL_SLAVE_SKIP_COUNTER
SQL_WARNINGS
SSL_CA
SSL_CAPATH
SSL_CERT
SSL_CIPHER
SSL_KEY
STORAGE_ENGINE
SYNC_BINLOG
SYNC_FRM
SYNC_MASTER_INFO
SYNC_RELAY_LOG
SYNC_RELAY_LOG_INFO
SYSTEM_TIME_ZONE
TABLE_DEFINITION_CACHE
TABLE_OPEN_CACHE
THREAD_CACHE_SIZE
THREAD_CONCURRENCY
THREAD_HANDLING
THREAD_STACK
THREAD_STATISTICS
TIMED_MUTEXES
TIMESTAMP
TIME_FORMAT
TIME_ZONE
TMPDIR
TMP_TABLE_SIZE
TRANSACTION_ALLOC_BLOCK_SIZE
TRANSACTION_PREALLOC_SIZE
TX_ISOLATION
UNIQUE_CHECKS
UPDATABLE_VIEWS_WITH_LIMIT
USERSTAT
VERSION
VERSION_COMMENT
VERSION_COMPILE_MACHINE
VERSION_COMPILE_OS
WAIT_TIMEOUT
WARNING_COUNT
--source include/have_debug.inc
--source percona_server_variables.inc
SELECT Variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES ORDER BY 1;
Variable_name
AUTOCOMMIT
AUTOMATIC_SP_PRIVILEGES
AUTO_INCREMENT_INCREMENT
AUTO_INCREMENT_OFFSET
BACK_LOG
BASEDIR
BIG_TABLES
BINLOG_CACHE_SIZE
BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
BINLOG_FORMAT
BINLOG_STMT_CACHE_SIZE
BULK_INSERT_BUFFER_SIZE
CHARACTER_SETS_DIR
CHARACTER_SET_CLIENT
CHARACTER_SET_CONNECTION
CHARACTER_SET_DATABASE
CHARACTER_SET_FILESYSTEM
CHARACTER_SET_RESULTS
CHARACTER_SET_SERVER
CHARACTER_SET_SYSTEM
COLLATION_CONNECTION
COLLATION_DATABASE
COLLATION_SERVER
COMPLETION_TYPE
CONCURRENT_INSERT
CONNECT_TIMEOUT
DATADIR
DATETIME_FORMAT
DATE_FORMAT
DEFAULT_STORAGE_ENGINE
DEFAULT_WEEK_FORMAT
DELAYED_INSERT_LIMIT
DELAYED_INSERT_TIMEOUT
DELAYED_QUEUE_SIZE
DELAY_KEY_WRITE
DIV_PRECISION_INCREMENT
ENGINE_CONDITION_PUSHDOWN
ERROR_COUNT
EVENT_SCHEDULER
EXPIRE_LOGS_DAYS
EXTERNAL_USER
FAST_INDEX_CREATION
FLUSH
FLUSH_TIME
FOREIGN_KEY_CHECKS
FT_BOOLEAN_SYNTAX
FT_MAX_WORD_LEN
FT_MIN_WORD_LEN
FT_QUERY_EXPANSION_LIMIT
FT_STOPWORD_FILE
GENERAL_LOG
GENERAL_LOG_FILE
GROUP_CONCAT_MAX_LEN
HAVE_COMPRESS
HAVE_CRYPT
HAVE_CSV
HAVE_DYNAMIC_LOADING
HAVE_GEOMETRY
HAVE_INNODB
HAVE_NDBCLUSTER
HAVE_OPENSSL
HAVE_PARTITIONING
HAVE_PROFILING
HAVE_QUERY_CACHE
HAVE_RESPONSE_TIME_DISTRIBUTION
HAVE_RTREE_KEYS
HAVE_SSL
HAVE_SYMLINK
HOSTNAME
IDENTITY
IGNORE_BUILTIN_INNODB
INIT_CONNECT
INIT_FILE
INIT_SLAVE
INNODB_ADAPTIVE_FLUSHING
INNODB_ADAPTIVE_FLUSHING_METHOD
INNODB_ADAPTIVE_HASH_INDEX
INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS
INNODB_ADDITIONAL_MEM_POOL_SIZE
INNODB_AUTOEXTEND_INCREMENT
INNODB_AUTOINC_LOCK_MODE
INNODB_BUFFER_POOL_INSTANCES
INNODB_BUFFER_POOL_RESTORE_AT_STARTUP
INNODB_BUFFER_POOL_SHM_CHECKSUM
INNODB_BUFFER_POOL_SHM_KEY
INNODB_BUFFER_POOL_SIZE
INNODB_CHANGE_BUFFERING
INNODB_CHECKPOINT_AGE_TARGET
INNODB_CHECKSUMS
INNODB_COMMIT_CONCURRENCY
INNODB_CONCURRENCY_TICKETS
INNODB_CORRUPT_TABLE_ACTION
INNODB_DATA_FILE_PATH
INNODB_DATA_HOME_DIR
INNODB_DICT_SIZE_LIMIT
INNODB_DOUBLEWRITE
INNODB_DOUBLEWRITE_FILE
INNODB_FAST_CHECKSUM
INNODB_FAST_SHUTDOWN
INNODB_FILE_FORMAT
INNODB_FILE_FORMAT_CHECK
INNODB_FILE_FORMAT_MAX
INNODB_FILE_PER_TABLE
INNODB_FLUSH_LOG_AT_TRX_COMMIT
INNODB_FLUSH_METHOD
INNODB_FLUSH_NEIGHBOR_PAGES
INNODB_FORCE_RECOVERY
INNODB_IBUF_ACCEL_RATE
INNODB_IBUF_ACTIVE_CONTRACT
INNODB_IBUF_MAX_SIZE
INNODB_IMPORT_TABLE_FROM_XTRABACKUP
INNODB_IO_CAPACITY
INNODB_LAZY_DROP_TABLE
INNODB_LOCKS_UNSAFE_FOR_BINLOG
INNODB_LOCK_WAIT_TIMEOUT
INNODB_LOG_BLOCK_SIZE
INNODB_LOG_BUFFER_SIZE
INNODB_LOG_FILES_IN_GROUP
INNODB_LOG_FILE_SIZE
INNODB_LOG_GROUP_HOME_DIR
INNODB_MAX_DIRTY_PAGES_PCT
INNODB_MAX_PURGE_LAG
INNODB_MIRRORED_LOG_GROUPS
INNODB_OLD_BLOCKS_PCT
INNODB_OLD_BLOCKS_TIME
INNODB_OPEN_FILES
INNODB_PAGE_SIZE
INNODB_PURGE_BATCH_SIZE
INNODB_PURGE_THREADS
INNODB_READ_AHEAD
INNODB_READ_AHEAD_THRESHOLD
INNODB_READ_IO_THREADS
INNODB_RECOVERY_STATS
INNODB_RECOVERY_UPDATE_RELAY_LOG
INNODB_REPLICATION_DELAY
INNODB_ROLLBACK_ON_TIMEOUT
INNODB_ROLLBACK_SEGMENTS
INNODB_SHOW_LOCKS_HELD
INNODB_SHOW_VERBOSE_LOCKS
INNODB_SPIN_WAIT_DELAY
INNODB_STATS_AUTO_UPDATE
INNODB_STATS_METHOD
INNODB_STATS_ON_METADATA
INNODB_STATS_SAMPLE_PAGES
INNODB_STATS_UPDATE_NEED_LOCK
INNODB_STRICT_MODE
INNODB_SUPPORT_XA
INNODB_SYNC_SPIN_LOOPS
INNODB_TABLE_LOCKS
INNODB_THREAD_CONCURRENCY
INNODB_THREAD_CONCURRENCY_TIMER_BASED
INNODB_THREAD_SLEEP_DELAY
INNODB_USE_GLOBAL_FLUSH_LOG_AT_TRX_COMMIT
INNODB_USE_NATIVE_AIO
INNODB_USE_SYS_MALLOC
INNODB_USE_SYS_STATS_TABLE
INNODB_VERSION
INNODB_WRITE_IO_THREADS
INSERT_ID
INTERACTIVE_TIMEOUT
JOIN_BUFFER_SIZE
KEEP_FILES_ON_CREATE
KEY_BUFFER_SIZE
KEY_CACHE_AGE_THRESHOLD
KEY_CACHE_BLOCK_SIZE
KEY_CACHE_DIVISION_LIMIT
LARGE_FILES_SUPPORT
LARGE_PAGES
LARGE_PAGE_SIZE
LAST_INSERT_ID
LC_MESSAGES
LC_MESSAGES_DIR
LC_TIME_NAMES
LICENSE
LOCAL_INFILE
LOCKED_IN_MEMORY
LOCK_WAIT_TIMEOUT
LOG
LOG_BIN
LOG_BIN_TRUST_FUNCTION_CREATORS
LOG_ERROR
LOG_OUTPUT
LOG_QUERIES_NOT_USING_INDEXES
LOG_SLAVE_UPDATES
LOG_SLOW_FILTER
LOG_SLOW_QUERIES
LOG_SLOW_RATE_LIMIT
LOG_SLOW_SLAVE_STATEMENTS
LOG_SLOW_SP_STATEMENTS
LOG_SLOW_VERBOSITY
LOG_WARNINGS
LOG_WARNINGS_SUPPRESS
LONG_QUERY_TIME
LOWER_CASE_FILE_SYSTEM
LOWER_CASE_TABLE_NAMES
LOW_PRIORITY_UPDATES
MAX_ALLOWED_PACKET
MAX_BINLOG_CACHE_SIZE
MAX_BINLOG_SIZE
MAX_BINLOG_STMT_CACHE_SIZE
MAX_CONNECTIONS
MAX_CONNECT_ERRORS
MAX_DELAYED_THREADS
MAX_ERROR_COUNT
MAX_HEAP_TABLE_SIZE
MAX_INSERT_DELAYED_THREADS
MAX_JOIN_SIZE
MAX_LENGTH_FOR_SORT_DATA
MAX_LONG_DATA_SIZE
MAX_PREPARED_STMT_COUNT
MAX_RELAY_LOG_SIZE
MAX_SEEKS_FOR_KEY
MAX_SORT_LENGTH
MAX_SP_RECURSION_DEPTH
MAX_TMP_TABLES
MAX_USER_CONNECTIONS
MAX_WRITE_LOCK_COUNT
MIN_EXAMINED_ROW_LIMIT
MULTI_RANGE_COUNT
MYISAM_DATA_POINTER_SIZE
MYISAM_MAX_SORT_FILE_SIZE
MYISAM_MMAP_SIZE
MYISAM_RECOVER_OPTIONS
MYISAM_REPAIR_THREADS
MYISAM_SORT_BUFFER_SIZE
MYISAM_STATS_METHOD
MYISAM_USE_MMAP
NET_BUFFER_LENGTH
NET_READ_TIMEOUT
NET_RETRY_COUNT
NET_WRITE_TIMEOUT
NEW
OLD
OLD_ALTER_TABLE
OLD_PASSWORDS
OPEN_FILES_LIMIT
OPTIMIZER_FIX
OPTIMIZER_PRUNE_LEVEL
OPTIMIZER_SEARCH_DEPTH
OPTIMIZER_SWITCH
PERFORMANCE_SCHEMA
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
PERFORMANCE_SCHEMA_MAX_COND_CLASSES
PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
PID_FILE
PLUGIN_DIR
PORT
PRELOAD_BUFFER_SIZE
PROFILING
PROFILING_HISTORY_SIZE
PROTOCOL_VERSION
PROXY_USER
PSEUDO_THREAD_ID
QUERY_ALLOC_BLOCK_SIZE
QUERY_CACHE_LIMIT
QUERY_CACHE_MIN_RES_UNIT
QUERY_CACHE_SIZE
QUERY_CACHE_STRIP_COMMENTS
QUERY_CACHE_TYPE
QUERY_CACHE_WLOCK_INVALIDATE
QUERY_PREALLOC_SIZE
QUERY_RESPONSE_TIME_RANGE_BASE
QUERY_RESPONSE_TIME_STATS
RAND_SEED1
RAND_SEED2
RANGE_ALLOC_BLOCK_SIZE
READ_BUFFER_SIZE
READ_ONLY
READ_RND_BUFFER_SIZE
RELAY_LOG
RELAY_LOG_INDEX
RELAY_LOG_INFO_FILE
RELAY_LOG_PURGE
RELAY_LOG_RECOVERY
RELAY_LOG_SPACE_LIMIT
REPORT_HOST
REPORT_PASSWORD
REPORT_PORT
REPORT_USER
RPL_RECOVERY_RANK
SECURE_AUTH
SECURE_FILE_PRIV
SERVER_ID
SKIP_EXTERNAL_LOCKING
SKIP_NAME_RESOLVE
SKIP_NETWORKING
SKIP_SHOW_DATABASE
SLAVE_COMPRESSED_PROTOCOL
SLAVE_EXEC_MODE
SLAVE_LOAD_TMPDIR
SLAVE_NET_TIMEOUT
SLAVE_SKIP_ERRORS
SLAVE_TRANSACTION_RETRIES
SLAVE_TYPE_CONVERSIONS
SLOW_LAUNCH_TIME
SLOW_QUERY_LOG
SLOW_QUERY_LOG_FILE
SLOW_QUERY_LOG_TIMESTAMP_ALWAYS
SLOW_QUERY_LOG_TIMESTAMP_PRECISION
SLOW_QUERY_LOG_USE_GLOBAL_CONTROL
SOCKET
SORT_BUFFER_SIZE
SQL_AUTO_IS_NULL
SQL_BIG_SELECTS
SQL_BIG_TABLES
SQL_BUFFER_RESULT
SQL_LOG_BIN
SQL_LOG_OFF
SQL_LOW_PRIORITY_UPDATES
SQL_MAX_JOIN_SIZE
SQL_MODE
SQL_NOTES
SQL_QUOTE_SHOW_CREATE
SQL_SAFE_UPDATES
SQL_SELECT_LIMIT
SQL_SLAVE_SKIP_COUNTER
SQL_WARNINGS
SSL_CA
SSL_CAPATH
SSL_CERT
SSL_CIPHER
SSL_KEY
STORAGE_ENGINE
SYNC_BINLOG
SYNC_FRM
SYNC_MASTER_INFO
SYNC_RELAY_LOG
SYNC_RELAY_LOG_INFO
SYSTEM_TIME_ZONE
TABLE_DEFINITION_CACHE
TABLE_OPEN_CACHE
THREAD_CACHE_SIZE
THREAD_CONCURRENCY
THREAD_HANDLING
THREAD_STACK
THREAD_STATISTICS
TIMED_MUTEXES
TIMESTAMP
TIME_FORMAT
TIME_ZONE
TMPDIR
TMP_TABLE_SIZE
TRANSACTION_ALLOC_BLOCK_SIZE
TRANSACTION_PREALLOC_SIZE
TX_ISOLATION
UNIQUE_CHECKS
UPDATABLE_VIEWS_WITH_LIMIT
USERSTAT
VERSION
VERSION_COMMENT
VERSION_COMPILE_MACHINE
VERSION_COMPILE_OS
WAIT_TIMEOUT
WARNING_COUNT
--source include/have_nodebug.inc
--source include/percona_server_variables.inc
include/master-slave.inc
[connection master]
DROP TABLE IF EXISTS t;
CREATE TABLE t(id INT);
INSERT INTO t SELECT SLEEP(10);
STOP SLAVE;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
master count(*)
master 1
slave count(*)
slave 0
SHOW SLAVE STATUS NOLOCK;
include/wait_for_slave_to_stop.inc
START SLAVE;
include/wait_for_slave_to_start.inc
slave count(*)
slave 1
DROP TABLE t;
STOP SLAVE;
include/wait_for_slave_to_stop.inc
--source include/master-slave.inc
--source include/have_binlog_format_statement.inc
--disable_query_log
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement:");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
--enable_query_log
connection master;
--disable_warnings
DROP TABLE IF EXISTS t;
--enable_warnings
CREATE TABLE t(id INT);
sync_slave_with_master;
connection master;
send INSERT INTO t SELECT SLEEP(10);
connection slave;
sleep 15;
send STOP SLAVE;
connection master;
reap;
--disable_query_log
select "master",count(*) from t;
--enable_query_log
connection slave1;
--disable_query_log
select "slave",count(*) from t;
--enable_query_log
--disable_result_log
SHOW SLAVE STATUS NOLOCK;
--enable_result_log
connection slave;
reap;
--source include/wait_for_slave_to_stop.inc
START SLAVE;
--source include/wait_for_slave_to_start.inc
--disable_query_log
select "slave",count(*) from t;
--enable_query_log
connection master;
DROP TABLE t;
sync_slave_with_master;
STOP SLAVE;
--source include/wait_for_slave_to_stop.inc
--slow-query-log-file=percona_slow_query_log-log_slow_filter.log --long-query-time=1 --slow-query-log-file=percona_slow_query_log-log_slow_filter.log --long-query-time=1 --slow_query_log=OFF
\ No newline at end of file
SET GLOBAL SLOW_QUERY_LOG=OFF;
drop table if exists t; drop table if exists t;
# Create test table # Create test table
create table t(id INT PRIMARY KEY) engine=InnoDB; create table t(id INT PRIMARY KEY) engine=InnoDB;
...@@ -20,6 +19,7 @@ sleep(2) ...@@ -20,6 +19,7 @@ sleep(2)
SELECT sleep(2); SELECT sleep(2);
sleep(2) sleep(2)
0 0
SET GLOBAL SLOW_QUERY_LOG=OFF;
drop table if exists t; drop table if exists t;
cat MYSQLD_DATADIR/percona_slow_query_log-log_slow_filter.log | grep -c Query_time FLUSH LOGS;
2 2
-- source include/not_windows.inc source include/have_xtradb.inc;
source include/have_innodb.inc;
SET GLOBAL SLOW_QUERY_LOG=OFF;
--disable_warnings --disable_warnings
drop table if exists t; drop table if exists t;
...@@ -24,12 +20,13 @@ set log_slow_filter=full_join; ...@@ -24,12 +20,13 @@ set log_slow_filter=full_join;
SELECT sleep(2) union select t2.id from t as t1,t as t2; SELECT sleep(2) union select t2.id from t as t1,t as t2;
SELECT sleep(2); SELECT sleep(2);
SET GLOBAL SLOW_QUERY_LOG=OFF;
--disable_warnings --disable_warnings
drop table if exists t; drop table if exists t;
--enable_warnings --enable_warnings
let $MYSQLD_DATADIR= `select @@datadir`; FLUSH LOGS;
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-log_slow_filter.log | grep -c Query_time; --let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-log_slow_filter.log
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR --let grep_pattern = Query_time
exec echo '$cmd'; --source grep.inc
exec $cmd;
show global variables like 'log_slow_sp_statements';
Variable_name Value
log_slow_sp_statements ON
show global variables like 'log_slow_verbosity';
Variable_name Value
log_slow_verbosity microtime,query_plan,innodb
show variables like 'log_slow_verbosity';
Variable_name Value
log_slow_verbosity microtime,query_plan,innodb
select @@log_slow_verbosity;
@@log_slow_verbosity
microtime,query_plan,innodb
show global variables like 'log_slow_verbosity';
show variables like 'log_slow_verbosity';
select @@log_slow_verbosity;
...@@ -5,5 +5,5 @@ set log_slow_verbosity=innodb; ...@@ -5,5 +5,5 @@ set log_slow_verbosity=innodb;
SELECT sleep(2); SELECT sleep(2);
sleep(2) sleep(2)
0 0
cat MYSQLD_DATADIR/percona_slow_query_log-log_slow_verbosity.log | grep -c "No InnoDB statistics available for this query" FLUSH LOGS;
1 1
source include/have_xtradb.inc;
SELECT sleep(2);
set log_slow_verbosity=innodb;
SELECT sleep(2);
FLUSH LOGS;
--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-log_slow_verbosity.log
--let grep_pattern = No InnoDB statistics available for this query
--source grep.inc
--slow-query-log-file=percona_slow_query_log-long_query_time.log --long-query-time=3 --slow-query-log-file=percona_slow_query_log-long_query_time.log --long-query-time=2 --slow-query-log=OFF
SET GLOBAL SLOW_QUERY_LOG=ON;
SELECT sleep(1);
sleep(1)
0
SELECT sleep(3);
sleep(3)
0
SELECT sleep(5);
sleep(5)
0
set long_query_time=4;
SELECT sleep(1);
sleep(1)
0
SELECT sleep(3);
sleep(3)
0
SELECT sleep(5);
sleep(5)
0
set long_query_time=2;
SET GLOBAL SLOW_QUERY_LOG=OFF;
FLUSH LOGS;
3
source include/have_xtradb.inc;
SET GLOBAL SLOW_QUERY_LOG=ON;
SELECT sleep(1);
SELECT sleep(3);
SELECT sleep(5);
set long_query_time=4;
SELECT sleep(1);
SELECT sleep(3);
SELECT sleep(5);
set long_query_time=2;
SET GLOBAL SLOW_QUERY_LOG=OFF;
FLUSH LOGS;
--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-long_query_time.log
--let grep_pattern = Query_time
--source grep.inc
--slow-query-log-file=percona_slow_query_log-microseconds_in_slow_query_log.log --long-query-time=1 --slow-query-log-file=percona_slow_query_log-microseconds_in_slow_query_log.log --long-query-time=1 --slow_query_log=OFF
\ No newline at end of file
SET GLOBAL SLOW_QUERY_LOG=ON;
SELECT sleep(2);
sleep(2)
0
set global slow_query_log_timestamp_precision='microsecond';
SELECT sleep(2);
sleep(2)
0
set global slow_query_log_timestamp_precision='second';
SET GLOBAL SLOW_QUERY_LOG=OFF;
FLUSH LOGS;
1
2
source include/have_xtradb.inc;
SET GLOBAL SLOW_QUERY_LOG=ON;
SELECT sleep(2);
set global slow_query_log_timestamp_precision='microsecond';
SELECT sleep(2);
set global slow_query_log_timestamp_precision='second';
SET GLOBAL SLOW_QUERY_LOG=OFF;
FLUSH LOGS;
--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log
--let grep_pattern = # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+.[0-9]+
--source grep.inc
--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log
--let grep_pattern = # Time: [0-9]+[ ]+[0-9]+:[0-9]+:[0-9]+
--source grep.inc
--slow-query-log-file=percona_slow_query_log-min_examined_row_limit.log --long-query-time=1 --slow-query-log-file=percona_slow_query_log-min_examined_row_limit.log --long-query-time=1 --slow-query-log=OFF
\ No newline at end of file
SET GLOBAL SLOW_QUERY_LOG=OFF;
drop table if exists t; drop table if exists t;
# Create test table # Create test table
create table t(id INT PRIMARY KEY) engine=InnoDB; create table t(id INT PRIMARY KEY) engine=InnoDB;
...@@ -20,6 +19,7 @@ sleep(2) ...@@ -20,6 +19,7 @@ sleep(2)
SELECT sleep(2); SELECT sleep(2);
sleep(2) sleep(2)
0 0
SET GLOBAL SLOW_QUERY_LOG=OFF;
drop table if exists t; drop table if exists t;
cat MYSQLD_DATADIR/percona_slow_query_log-min_examined_row_limit.log | grep -c Query_time FLUSH LOGS;
2 2
source include/not_windows.inc; source include/have_xtradb.inc;
source include/have_innodb.inc;
SET GLOBAL SLOW_QUERY_LOG=OFF;
--disable_warnings --disable_warnings
drop table if exists t; drop table if exists t;
...@@ -23,12 +20,13 @@ set min_examined_row_limit=5; ...@@ -23,12 +20,13 @@ set min_examined_row_limit=5;
SELECT sleep(2) union select t2.id from t as t1,t as t2; SELECT sleep(2) union select t2.id from t as t1,t as t2;
SELECT sleep(2); SELECT sleep(2);
SET GLOBAL SLOW_QUERY_LOG=OFF;
--disable_warnings --disable_warnings
drop table if exists t; drop table if exists t;
--enable_warnings --enable_warnings
let $MYSQLD_DATADIR= `select @@datadir`; FLUSH LOGS;
let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-min_examined_row_limit.log | grep -c Query_time; --let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_slow_query_log-min_examined_row_limit.log
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR --let grep_pattern = Query_time
exec echo '$cmd'; --source grep.inc
exec $cmd;
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
CREATE TABLE t(id INT,data CHAR(30)) ENGINE=InnoDB; CREATE TABLE t(id INT,data CHAR(30)) ENGINE=InnoDB;
INSERT INTO t VALUES INSERT INTO t VALUES
...@@ -15,7 +11,12 @@ INSERT INTO t VALUES ...@@ -15,7 +11,12 @@ INSERT INTO t VALUES
INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2;
INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2;
STOP SLAVE; STOP SLAVE;
include/wait_for_slave_to_stop.inc
START SLAVE; START SLAVE;
include/wait_for_slave_to_start.inc
INSERT INTO t SELECT t.id,t.data from t; INSERT INTO t SELECT t.id,t.data from t;
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
FLUSH LOGS;
4 4
STOP SLAVE;
include/wait_for_slave_to_stop.inc
source include/have_innodb.inc; -- source include/have_binlog_format_mixed_or_statement.inc
source include/master-slave.inc; -- source include/have_xtradb.inc
-- source include/master-slave.inc
connection master; connection master;
-- disable_warnings -- disable_warnings
...@@ -40,4 +41,11 @@ connection master; ...@@ -40,4 +41,11 @@ connection master;
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
sync_slave_with_master; sync_slave_with_master;
exec cat var/mysqld.2/mysqld-slow.log | grep InnoDB_IO_r_ops | wc -l; connection slave;
FLUSH LOGS;
--let grep_file = $MYSQLTEST_VARDIR/mysqld.2/mysqld-slow.log
--let grep_pattern = InnoDB_IO_r_ops
--source grep.inc
STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc
# Activate master-slave replication include/master-slave.inc
stop slave; [connection master]
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
# Make table t for test
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
CREATE TABLE t(id INT); CREATE TABLE t(id INT);
# Start slave replication
START SLAVE; START SLAVE;
include/wait_for_slave_to_start.inc
INSERT INTO t VALUES (1); INSERT INTO t VALUES (1);
# Read information about master binlog
# Sync(1) slave thread
# Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements'; show variables like 'log_slow_slave_statements';
Variable_name Value Variable_name Value
log_slow_slave_statements OFF log_slow_slave_statements OFF
...@@ -22,23 +13,20 @@ show variables like 'log_slow_slave_statements'; ...@@ -22,23 +13,20 @@ show variables like 'log_slow_slave_statements';
Variable_name Value Variable_name Value
log_slow_slave_statements ON log_slow_slave_statements ON
INSERT INTO t VALUES (2); INSERT INTO t VALUES (2);
# Read information about master binlog
# Sync slave(2) thread
# Restart slave
STOP SLAVE; STOP SLAVE;
include/wait_for_slave_to_stop.inc
START SLAVE; START SLAVE;
include/wait_for_slave_to_start.inc
INSERT INTO t VALUES (3); INSERT INTO t VALUES (3);
# Read information about master binlog
# Sync(3) slave thread
show variables like 'long_query_time'; show variables like 'long_query_time';
Variable_name Value Variable_name Value
long_query_time 1.000000 long_query_time 1.000000
show global variables like 'long_query_time'; show global variables like 'long_query_time';
Variable_name Value Variable_name Value
long_query_time 1.000000 long_query_time 1.000000
show global variables like 'use_global_long_query_time'; show global variables like 'slow_query_log_use_global_control';
Variable_name Value Variable_name Value
use_global_long_query_time OFF slow_query_log_use_global_control
set global long_query_time=0; set global long_query_time=0;
show variables like 'long_query_time'; show variables like 'long_query_time';
Variable_name Value Variable_name Value
...@@ -46,51 +34,49 @@ long_query_time 1.000000 ...@@ -46,51 +34,49 @@ long_query_time 1.000000
show global variables like 'long_query_time'; show global variables like 'long_query_time';
Variable_name Value Variable_name Value
long_query_time 0.000000 long_query_time 0.000000
show global variables like 'use_global_long_query_time'; show global variables like 'slow_query_log_use_global_control';
Variable_name Value Variable_name Value
use_global_long_query_time OFF slow_query_log_use_global_control
INSERT INTO t VALUES (4); INSERT INTO t VALUES (4);
# Read information about master binlog
# Sync slave(4) thread
show variables like 'long_query_time'; show variables like 'long_query_time';
Variable_name Value Variable_name Value
long_query_time 1.000000 long_query_time 1.000000
show global variables like 'long_query_time'; show global variables like 'long_query_time';
Variable_name Value Variable_name Value
long_query_time 0.000000 long_query_time 0.000000
show global variables like 'use_global_long_query_time'; show global variables like 'slow_query_log_use_global_control';
Variable_name Value Variable_name Value
use_global_long_query_time OFF slow_query_log_use_global_control
set global use_global_long_query_time=1; set global slow_query_log_use_global_control='long_query_time';
show variables like 'long_query_time'; show variables like 'long_query_time';
Variable_name Value Variable_name Value
long_query_time 0.000000 long_query_time 0.000000
show global variables like 'long_query_time'; show global variables like 'long_query_time';
Variable_name Value Variable_name Value
long_query_time 0.000000 long_query_time 0.000000
show global variables like 'use_global_long_query_time'; show global variables like 'slow_query_log_use_global_control';
Variable_name Value Variable_name Value
use_global_long_query_time ON slow_query_log_use_global_control long_query_time
INSERT INTO t VALUES (5); INSERT INTO t VALUES (5);
# Read information about master binlog
# Sync slave(5) thread
show variables like 'long_query_time'; show variables like 'long_query_time';
Variable_name Value Variable_name Value
long_query_time 0.000000 long_query_time 0.000000
show global variables like 'long_query_time'; show global variables like 'long_query_time';
Variable_name Value Variable_name Value
long_query_time 0.000000 long_query_time 0.000000
show global variables like 'use_global_long_query_time'; show global variables like 'slow_query_log_use_global_control';
Variable_name Value Variable_name Value
use_global_long_query_time ON slow_query_log_use_global_control long_query_time
set global long_query_time=1; set global long_query_time=1;
set global use_global_long_query_time=0; set global slow_query_log_use_global_control='';
FLUSH LOGS;
# Analyse master slow_query_log # Analyse master slow_query_log
0 0
0 0
0 0
0 0
0 0
FLUSH LOGS;
# Analyse slave slow_query_log # Analyse slave slow_query_log
0 0
0 0
...@@ -99,5 +85,5 @@ set global use_global_long_query_time=0; ...@@ -99,5 +85,5 @@ set global use_global_long_query_time=0;
1 1
set global log_slow_slave_statements=OFF; set global log_slow_slave_statements=OFF;
DROP TABLE t; DROP TABLE t;
# Read information about master binlog STOP SLAVE;
# Sync slave(6) thread include/wait_for_slave_to_stop.inc
-- source include/not_windows.inc -- source include/have_binlog_format_mixed_or_statement.inc
-- echo # Activate master-slave replication
-- source include/master-slave.inc -- source include/master-slave.inc
connection master; connection master;
-- echo # Make table t for test
-- disable_warnings -- disable_warnings
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
-- enable_warnings -- enable_warnings
CREATE TABLE t(id INT); CREATE TABLE t(id INT);
-- echo # Start slave replication
-- disable_warnings -- disable_warnings
connection slave; connection slave;
START SLAVE; START SLAVE;
-- source include/wait_for_slave_to_start.inc -- source include/wait_for_slave_to_start.inc
-- enable_warnings -- enable_warnings
#-- echo # Make insert(1) on master
connection master; connection master;
INSERT INTO t VALUES (1); INSERT INTO t VALUES (1);
-- echo # Read information about master binlog sync_slave_with_master;
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync(1) slave thread
connection slave; connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements'; show variables like 'log_slow_slave_statements';
set global log_slow_slave_statements=ON; set global log_slow_slave_statements=ON;
show variables like 'log_slow_slave_statements'; show variables like 'log_slow_slave_statements';
#-- echo # Make insert(2) on master
connection master; connection master;
INSERT INTO t VALUES (2); INSERT INTO t VALUES (2);
-- echo # Read information about master binlog sync_slave_with_master;
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(2) thread
connection slave; connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Restart slave
STOP SLAVE; STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc -- source include/wait_for_slave_to_stop.inc
START SLAVE; START SLAVE;
-- source include/wait_for_slave_to_start.inc -- source include/wait_for_slave_to_start.inc
#-- echo # Make insert(3) on master
connection master; connection master;
INSERT INTO t VALUES (3); INSERT INTO t VALUES (3);
-- echo # Read information about master binlog sync_slave_with_master;
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync(3) slave thread
connection slave; connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
show variables like 'long_query_time'; show variables like 'long_query_time';
show global variables like 'long_query_time'; show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time'; show global variables like 'slow_query_log_use_global_control';
set global long_query_time=0; set global long_query_time=0;
show variables like 'long_query_time'; show variables like 'long_query_time';
show global variables like 'long_query_time'; show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time'; show global variables like 'slow_query_log_use_global_control';
#-- echo # Make insert(4) on master
connection master; connection master;
INSERT INTO t VALUES (4); INSERT INTO t VALUES (4);
-- echo # Read information about master binlog sync_slave_with_master;
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(4) thread
connection slave; connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
show variables like 'long_query_time'; show variables like 'long_query_time';
show global variables like 'long_query_time'; show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time'; show global variables like 'slow_query_log_use_global_control';
set global use_global_long_query_time=1; set global slow_query_log_use_global_control='long_query_time';
show variables like 'long_query_time'; show variables like 'long_query_time';
show global variables like 'long_query_time'; show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time'; show global variables like 'slow_query_log_use_global_control';
#-- echo # Make insert(5) on master #-- echo # Make insert(5) on master
connection master; connection master;
let $MASTER_DATADIR= `select @@datadir`;
INSERT INTO t VALUES (5); INSERT INTO t VALUES (5);
-- echo # Read information about master binlog sync_slave_with_master;
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(5) thread
connection slave; connection slave;
let $SLAVE_DATADIR= `select @@datadir`;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
show variables like 'long_query_time'; show variables like 'long_query_time';
show global variables like 'long_query_time'; show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time'; show global variables like 'slow_query_log_use_global_control';
set global long_query_time=1; set global long_query_time=1;
set global use_global_long_query_time=0; set global slow_query_log_use_global_control='';
connection master;
FLUSH LOGS;
-- echo # Analyse master slow_query_log -- echo # Analyse master slow_query_log
let $i=5; let $i=5;
let $k=1; let $k=1;
let $cmd=cat ./$MASTER_DATADIR/percona_log_slow_slave_statements-master.log | grep;
while($i) while($i)
{ {
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l; --let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_log_slow_slave_statements-master.log
exec $current_cmd; --let grep_pattern = INSERT INTO t VALUES \($k\)
--source grep.inc
dec $i; dec $i;
inc $k; inc $k;
} }
connection slave;
FLUSH LOGS;
-- echo # Analyse slave slow_query_log -- echo # Analyse slave slow_query_log
let $i=5; let $i=5;
let $k=1; let $k=1;
let $cmd=cat $SLAVE_DATADIR/percona_log_slow_slave_statements-slave.log | grep;
while($i) while($i)
{ {
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l; --let grep_file = $MYSQLTEST_VARDIR/mysqld.2/data/percona_log_slow_slave_statements-slave.log
exec $current_cmd; --let grep_pattern = INSERT INTO t VALUES \($k\)
--source grep.inc
dec $i; dec $i;
inc $k; inc $k;
} }
...@@ -131,11 +102,6 @@ set global log_slow_slave_statements=OFF; ...@@ -131,11 +102,6 @@ set global log_slow_slave_statements=OFF;
connection master; connection master;
DROP TABLE t; DROP TABLE t;
sync_slave_with_master;
-- echo # Read information about master binlog STOP SLAVE;
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1); -- source include/wait_for_slave_to_stop.inc
let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(6) thread
connection slave;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment