summaryrefslogtreecommitdiff
path: root/mysql-test/suite/perfschema/include
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2013-07-08 15:19:50 +0300
committerunknown <timour@askmonty.org>2013-07-08 15:19:50 +0300
commit54999b2863ed7f6b1fc64f8347ae24a7a325b427 (patch)
treed16f41be280d192ae960904ed146b84540ad11a4 /mysql-test/suite/perfschema/include
parent30e34252f48599d605466c718ceb81a1a0e23b70 (diff)
downloadmariadb-git-54999b2863ed7f6b1fc64f8347ae24a7a325b427.tar.gz
Merge performance schema test cases from MySQL 5.6.10
Merged the majority of the PFS test cases. There are still 19 failing test cases that need more attention.
Diffstat (limited to 'mysql-test/suite/perfschema/include')
-rw-r--r--mysql-test/suite/perfschema/include/digest_cleanup.inc3
-rw-r--r--mysql-test/suite/perfschema/include/digest_execution.inc54
-rw-r--r--mysql-test/suite/perfschema/include/digest_setup.inc3
-rw-r--r--mysql-test/suite/perfschema/include/hostcache_set_state.inc23
-rw-r--r--mysql-test/suite/perfschema/include/schema.inc2
-rw-r--r--mysql-test/suite/perfschema/include/start_server_common.inc10
6 files changed, 85 insertions, 10 deletions
diff --git a/mysql-test/suite/perfschema/include/digest_cleanup.inc b/mysql-test/suite/perfschema/include/digest_cleanup.inc
index 99dc41e660f..47dd7618b43 100644
--- a/mysql-test/suite/perfschema/include/digest_cleanup.inc
+++ b/mysql-test/suite/perfschema/include/digest_cleanup.inc
@@ -7,5 +7,8 @@ DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
DROP TABLE IF EXISTS t4;
DROP TABLE IF EXISTS t5;
+DROP TABLE IF EXISTS t6;
+DROP TABLE IF EXISTS t11;
+DROP TABLE IF EXISTS t12;
DROP DATABASE IF EXISTS statements_digest;
--enable_warnings
diff --git a/mysql-test/suite/perfschema/include/digest_execution.inc b/mysql-test/suite/perfschema/include/digest_execution.inc
index 34c49590217..5483cca61d7 100644
--- a/mysql-test/suite/perfschema/include/digest_execution.inc
+++ b/mysql-test/suite/perfschema/include/digest_execution.inc
@@ -34,6 +34,19 @@ INSERT INTO t3 VALUES (1, 2), (3, 4), (5, 6);
INSERT INTO t5 VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);
# -----------------------------------------------------------------------
+# Test case to handle NULL. If alone, not normalized otherwise normalized.
+# -----------------------------------------------------------------------
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t3 VALUES (NULL,NULL);
+INSERT INTO t3 VALUES (1,NULL);
+INSERT INTO t3 VALUES (NULL,1);
+INSERT INTO t6 VALUES (NULL, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (1, NULL, NULL, NULL);
+INSERT INTO t6 VALUES (NULL, 2, NULL, NULL);
+INSERT INTO t6 VALUES (1, 2, 3, NULL);
+INSERT INTO t6 VALUES (1, 2, NULL, 4);
+
+# -----------------------------------------------------------------------
# Test case for handling spaces in statement.
# -----------------------------------------------------------------------
@@ -59,7 +72,6 @@ SELECT 1 /* This is an inline comment */ + 1;
*/
1;
-
# -----------------------------------------------------------------------
# Tests to show how the digest behaves with tokens that can have multiple
# names (such as DATABASE = "DATABASE" or "SCHEMA", SUBSTRING, STD_SYM,
@@ -79,8 +91,40 @@ DROP DATABASE statements_digest_temp;
# captured.
# -----------------------------------------------------------------------
--ERROR ER_NO_SUCH_TABLE
-SELECT 1 from t11;
-create table t11 (c char(4));
+SELECT 1 FROM no_such_table;
+CREATE TABLE dup_table (c char(4));
--ERROR ER_TABLE_EXISTS_ERROR
-create table t11 (c char(4));
-insert into t11 values("MySQL");
+CREATE TABLE dup_table (c char(4));
+DROP TABLE dup_table;
+INSERT INTO t11 VALUES("MySQL");
+
+# -----------------------------------------------------------------------
+# Tests to show sub-statements for following statements are not
+# instrumented.
+# - Prepared Statements
+# - Stored Procedures/Functions.
+# - Table Triggers
+# -----------------------------------------------------------------------
+PREPARE stmt FROM "SELECT * FROM t12";
+EXECUTE stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+DELIMITER //;
+CREATE PROCEDURE p1() BEGIN SELECT * FROM t12; END//
+DELIMITER ;//
+CALL p1();
+CALL p1();
+DROP PROCEDURE p1;
+
+DELIMITER //;
+CREATE FUNCTION `func`(a INT, b INT) RETURNS int(11) RETURN a+b //
+DELIMITER ;//
+select func(3,4);
+select func(13,42);
+DROP FUNCTION func;
+
+CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @a:=1;
+INSERT INTO t12 VALUES ("abc");
+INSERT INTO t12 VALUES ("def");
+DROP TRIGGER trg;
diff --git a/mysql-test/suite/perfschema/include/digest_setup.inc b/mysql-test/suite/perfschema/include/digest_setup.inc
index 7145bcfa870..ed463f58d04 100644
--- a/mysql-test/suite/perfschema/include/digest_setup.inc
+++ b/mysql-test/suite/perfschema/include/digest_setup.inc
@@ -17,5 +17,8 @@ CREATE TABLE t2(a int);
CREATE TABLE t3(a int, b int);
CREATE TABLE t4(a int, b int);
CREATE TABLE t5(a int, b int, c int);
+CREATE TABLE t6(a int, b int, c int, d int);
+CREATE TABLE t11 (c CHAR(4));
+CREATE TABLE t12 (c CHAR(4));
--enable_warnings
diff --git a/mysql-test/suite/perfschema/include/hostcache_set_state.inc b/mysql-test/suite/perfschema/include/hostcache_set_state.inc
new file mode 100644
index 00000000000..25dd56a4e0d
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/hostcache_set_state.inc
@@ -0,0 +1,23 @@
+# Helper for hostcache_*.test
+
+# Set a known initial state for the test
+
+flush status;
+flush hosts;
+flush user_resources;
+flush privileges;
+
+# Print critical setup
+
+select @@global.debug;
+select @@global.max_connect_errors;
+select @@global.max_user_connections;
+select @@global.max_connections;
+
+# Make sure there are no remaining records that can change the test outcome
+
+select `User`, `Host` from mysql.`user` where `host` like '%\\%%';
+select `User`, `Host` from mysql.`user` where `user` like '192.%';
+select `User`, `Host` from mysql.`user` where `user` like '2001:%';
+select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
+
diff --git a/mysql-test/suite/perfschema/include/schema.inc b/mysql-test/suite/perfschema/include/schema.inc
index 6c3c391c171..f5f23893d37 100644
--- a/mysql-test/suite/perfschema/include/schema.inc
+++ b/mysql-test/suite/perfschema/include/schema.inc
@@ -21,6 +21,7 @@ show create table events_stages_summary_global_by_event_name;
show create table events_statements_current;
show create table events_statements_history;
show create table events_statements_history_long;
+show create table events_statements_summary_by_digest;
show create table events_statements_summary_by_host_by_event_name;
show create table events_statements_summary_by_thread_by_event_name;
show create table events_statements_summary_by_user_by_event_name;
@@ -38,7 +39,6 @@ show create table events_waits_summary_global_by_event_name;
show create table file_instances;
show create table file_summary_by_event_name;
show create table file_summary_by_instance;
---error 1146
show create table host_cache;
show create table hosts;
show create table mutex_instances;
diff --git a/mysql-test/suite/perfschema/include/start_server_common.inc b/mysql-test/suite/perfschema/include/start_server_common.inc
index 6a7c7698999..d15c3d48ded 100644
--- a/mysql-test/suite/perfschema/include/start_server_common.inc
+++ b/mysql-test/suite/perfschema/include/start_server_common.inc
@@ -27,6 +27,7 @@ select * from performance_schema.events_statements_current;
select * from performance_schema.events_statements_history;
select * from performance_schema.events_statements_history_long;
select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_digest;
select * from performance_schema.events_statements_summary_by_host_by_event_name;
select * from performance_schema.events_statements_summary_by_thread_by_event_name;
select * from performance_schema.events_statements_summary_by_user_by_event_name;
@@ -43,21 +44,22 @@ select * from performance_schema.events_waits_summary_global_by_event_name;
select * from performance_schema.file_instances;
select * from performance_schema.file_summary_by_event_name;
select * from performance_schema.file_summary_by_instance;
---error 1146
select * from performance_schema.host_cache;
-select * from performance_schema.socket_instances;
-select * from performance_schema.socket_summary_by_instance;
-select * from performance_schema.socket_summary_by_event_name;
select * from performance_schema.hosts;
select * from performance_schema.mutex_instances;
select * from performance_schema.objects_summary_global_by_type;
select * from performance_schema.performance_timers;
select * from performance_schema.rwlock_instances;
+select * from performance_schema.session_account_connect_attrs;
+select * from performance_schema.session_connect_attrs;
select * from performance_schema.setup_actors;
select * from performance_schema.setup_consumers;
select * from performance_schema.setup_instruments;
select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
select * from performance_schema.table_io_waits_summary_by_index_usage;
select * from performance_schema.table_io_waits_summary_by_table;
select * from performance_schema.table_lock_waits_summary_by_table;