summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/commit.inc4
-rw-r--r--mysql-test/include/diff_tables.inc18
-rw-r--r--mysql-test/include/have_archive.inc9
-rw-r--r--mysql-test/include/have_archive.opt2
-rw-r--r--mysql-test/include/have_blackhole.opt2
-rw-r--r--mysql-test/include/have_innodb.opt1
-rw-r--r--mysql-test/include/have_pbxt.inc9
-rw-r--r--mysql-test/include/percona_query_response_time_flush.inc1
-rw-r--r--mysql-test/include/percona_query_response_time_show.inc7
-rw-r--r--mysql-test/include/percona_query_response_time_sleep.inc19
-rw-r--r--mysql-test/include/rpl_diff_tables.inc35
11 files changed, 86 insertions, 21 deletions
diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc
index d91ba8291fd..d412eae8364 100644
--- a/mysql-test/include/commit.inc
+++ b/mysql-test/include/commit.inc
@@ -725,9 +725,9 @@ call p_verify_status_increment(4, 4, 4, 4);
alter table t3 add column (b int);
call p_verify_status_increment(2, 0, 2, 0);
alter table t3 rename t4;
-call p_verify_status_increment(2, 2, 2, 2);
+call p_verify_status_increment(1, 0, 1, 0);
rename table t4 to t3;
-call p_verify_status_increment(2, 2, 2, 2);
+call p_verify_status_increment(1, 0, 1, 0);
truncate table t3;
call p_verify_status_increment(4, 4, 4, 4);
create view v1 as select * from t2;
diff --git a/mysql-test/include/diff_tables.inc b/mysql-test/include/diff_tables.inc
index d15dd56b35d..81362e8643b 100644
--- a/mysql-test/include/diff_tables.inc
+++ b/mysql-test/include/diff_tables.inc
@@ -64,17 +64,13 @@ let $_diff_table=$diff_table_2;
let $_diff_i=2;
while ($_diff_i) {
- # Parse out any leading "master:" or "slave:" from the table
- # specification and connect the appropriate server.
- let $_diff_conn_master=`SELECT SUBSTR('$_diff_table', 1, 7) = 'master:'`;
- if ($_diff_conn_master) {
- let $_diff_table=`SELECT SUBSTR('$_diff_table', 8)`;
- connection master;
- }
- let $_diff_conn_slave=`SELECT SUBSTR('$_diff_table', 1, 6) = 'slave:'`;
- if ($_diff_conn_slave) {
- let $_diff_table=`SELECT SUBSTR('$_diff_table', 7)`;
- connection slave;
+ # Parse out any leading "master:" or "slave:" from the table specification
+# and connect the appropriate server.
+ let $_pos= `SELECT LOCATE(':', '$_diff_table')`;
+ let $_diff_conn=`SELECT SUBSTR('$_diff_table', 1, $_pos-1)`;
+ if (`SELECT 'XX$_diff_conn' <> 'XX'`) {
+ let $_diff_table=`SELECT SUBSTR('$_diff_table', $_pos+1)`;
+ connection $_diff_conn;
}
# Sanity-check the input.
diff --git a/mysql-test/include/have_archive.inc b/mysql-test/include/have_archive.inc
index 82399ca4c6c..0fd85fa576f 100644
--- a/mysql-test/include/have_archive.inc
+++ b/mysql-test/include/have_archive.inc
@@ -1,4 +1,5 @@
---disable_query_log
---require r/true.require
-select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'archive';
---enable_query_log
+if (!`SELECT count(*) FROM information_schema.engines WHERE
+ (support = 'YES' OR support = 'DEFAULT') AND
+ engine = 'archive'`){
+ skip Need archive engine;
+}
diff --git a/mysql-test/include/have_archive.opt b/mysql-test/include/have_archive.opt
new file mode 100644
index 00000000000..cf9309d9fb0
--- /dev/null
+++ b/mysql-test/include/have_archive.opt
@@ -0,0 +1,2 @@
+--loose-archive
+--plugin-load=$HA_ARCHIVE_SO
diff --git a/mysql-test/include/have_blackhole.opt b/mysql-test/include/have_blackhole.opt
new file mode 100644
index 00000000000..b600b468390
--- /dev/null
+++ b/mysql-test/include/have_blackhole.opt
@@ -0,0 +1,2 @@
+--loose-blackhole
+--plugin-load=$HA_BLACKHOLE_SO
diff --git a/mysql-test/include/have_innodb.opt b/mysql-test/include/have_innodb.opt
index 48457b17309..4fb96229a7b 100644
--- a/mysql-test/include/have_innodb.opt
+++ b/mysql-test/include/have_innodb.opt
@@ -1 +1,2 @@
--loose-innodb
+--plugin-load=$HA_XTRADB_SO
diff --git a/mysql-test/include/have_pbxt.inc b/mysql-test/include/have_pbxt.inc
index a8afc2c8324..b11aee2617f 100644
--- a/mysql-test/include/have_pbxt.inc
+++ b/mysql-test/include/have_pbxt.inc
@@ -1,4 +1,5 @@
-disable_query_log;
---require r/true.require
-select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'pbxt';
-enable_query_log;
+if (!`SELECT count(*) FROM information_schema.engines WHERE
+ (support = 'YES' OR support = 'DEFAULT') AND
+ engine = 'pbxt'`){
+ skip Need PBXT engine;
+}
diff --git a/mysql-test/include/percona_query_response_time_flush.inc b/mysql-test/include/percona_query_response_time_flush.inc
new file mode 100644
index 00000000000..44bb320fe13
--- /dev/null
+++ b/mysql-test/include/percona_query_response_time_flush.inc
@@ -0,0 +1 @@
+FLUSH QUERY_RESPONSE_TIME;
diff --git a/mysql-test/include/percona_query_response_time_show.inc b/mysql-test/include/percona_query_response_time_show.inc
new file mode 100644
index 00000000000..761b2c6f0df
--- /dev/null
+++ b/mysql-test/include/percona_query_response_time_show.inc
@@ -0,0 +1,7 @@
+SELECT c.count,
+(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as not_zero_region_count,
+(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
+FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count > 0;
+SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
+SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
diff --git a/mysql-test/include/percona_query_response_time_sleep.inc b/mysql-test/include/percona_query_response_time_sleep.inc
new file mode 100644
index 00000000000..40688b173b0
--- /dev/null
+++ b/mysql-test/include/percona_query_response_time_sleep.inc
@@ -0,0 +1,19 @@
+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);
diff --git a/mysql-test/include/rpl_diff_tables.inc b/mysql-test/include/rpl_diff_tables.inc
new file mode 100644
index 00000000000..c3a45578a79
--- /dev/null
+++ b/mysql-test/include/rpl_diff_tables.inc
@@ -0,0 +1,35 @@
+# #############################################################################
+# Check whether the given table is consistent between different master and
+# slaves
+#
+# Usage:
+# --let $diff_table= test.t1
+# --let $diff_server_list= master, slave, slave2
+# --source include/rpl_diff_tables.inc
+# #############################################################################
+
+if (`SELECT "XX$diff_table" = "XX"`)
+{
+ --die diff_table is null.
+}
+
+--let $_servers= master, slave
+if (`SELECT "XX$diff_server_list" <> "XX"`)
+{
+ --let $_servers= $diff_server_list
+}
+
+--let $_master= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)`
+--let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_master') + 2))`
+connection $_master;
+while (`SELECT "XX$_servers" <> "XX"`)
+{
+ --let $_slave= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)`
+ --let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_slave') + 2))`
+
+ --sync_slave_with_master $_slave
+ --let $diff_table_1= $_master:$diff_table
+ --let $diff_table_2= $_slave:$diff_table
+ --source include/diff_tables.inc
+ connection $_slave;
+}