Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit 6f433de

Browse files
committed
Add the start of a mysql-test suite (called sysschema), starting with tests for all stored functions.
1 parent abfb2db commit 6f433de

32 files changed

+779
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Reset the performance_schema.setup_actors table
2+
3+
TRUNCATE TABLE performance_schema.setup_actors;
4+
5+
INSERT INTO performance_schema.setup_actors VALUES ('%', '%', '%');
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Reset the performance_schema.setup_consumers table
2+
3+
UPDATE performance_schema.setup_consumers SET enabled = 'YES';
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Reset all Performance Schema configuration
2+
3+
--source ./ps_setup_instruments_cleanup.inc
4+
5+
--source ./ps_setup_actors_cleanup.inc
6+
7+
--source ./ps_setup_consumers_cleanup.inc
8+
9+
--source ./ps_threads_cleanup.inc
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Reset the performance_schema.setup_consumers table
2+
3+
UPDATE performance_schema.threads SET instrumented = 'YES';
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
USE sys;
2+
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'sys' ORDER BY TABLE_NAME;
3+
TABLE_NAME
4+
host_summary
5+
host_summary_by_file_io
6+
host_summary_by_file_io_type
7+
host_summary_by_stages
8+
host_summary_by_statement_latency
9+
host_summary_by_statement_type
10+
innodb_buffer_stats_by_schema
11+
innodb_buffer_stats_by_table
12+
innodb_lock_waits
13+
io_by_thread_by_latency
14+
io_global_by_file_by_bytes
15+
io_global_by_file_by_latency
16+
io_global_by_wait_by_bytes
17+
io_global_by_wait_by_latency
18+
latest_file_io
19+
memory_by_host_by_current_bytes
20+
memory_by_thread_by_current_bytes
21+
memory_by_user_by_current_bytes
22+
memory_global_by_current_bytes
23+
memory_global_total
24+
processlist
25+
ps_check_lost_instrumentation
26+
schema_index_statistics
27+
schema_object_overview
28+
schema_tables_with_full_table_scans
29+
schema_table_statistics
30+
schema_table_statistics_with_buffer
31+
schema_unused_indexes
32+
statements_with_errors_or_warnings
33+
statements_with_full_table_scans
34+
statements_with_runtimes_in_95th_percentile
35+
statements_with_sorting
36+
statements_with_temp_tables
37+
statement_analysis
38+
sys_config
39+
user_summary
40+
user_summary_by_file_io
41+
user_summary_by_file_io_type
42+
user_summary_by_stages
43+
user_summary_by_statement_latency
44+
user_summary_by_statement_type
45+
version
46+
waits_by_host_by_latency
47+
waits_by_user_by_latency
48+
waits_global_by_latency
49+
wait_classes_global_by_avg_latency
50+
wait_classes_global_by_latency
51+
x$host_summary
52+
x$host_summary_by_file_io
53+
x$host_summary_by_file_io_type
54+
x$host_summary_by_stages
55+
x$host_summary_by_statement_latency
56+
x$host_summary_by_statement_type
57+
x$innodb_buffer_stats_by_schema
58+
x$innodb_buffer_stats_by_table
59+
x$innodb_lock_waits
60+
x$io_by_thread_by_latency
61+
x$io_global_by_file_by_bytes
62+
x$io_global_by_file_by_latency
63+
x$io_global_by_wait_by_bytes
64+
x$io_global_by_wait_by_latency
65+
x$latest_file_io
66+
x$memory_by_host_by_current_bytes
67+
x$memory_by_thread_by_current_bytes
68+
x$memory_by_user_by_current_bytes
69+
x$memory_global_by_current_bytes
70+
x$memory_global_total
71+
x$processlist
72+
x$ps_digest_95th_percentile_by_avg_us
73+
x$ps_digest_avg_latency_distribution
74+
x$ps_schema_table_statistics_io
75+
x$schema_index_statistics
76+
x$schema_tables_with_full_table_scans
77+
x$schema_table_statistics
78+
x$schema_table_statistics_with_buffer
79+
x$statements_with_errors_or_warnings
80+
x$statements_with_full_table_scans
81+
x$statements_with_runtimes_in_95th_percentile
82+
x$statements_with_sorting
83+
x$statements_with_temp_tables
84+
x$statement_analysis
85+
x$user_summary
86+
x$user_summary_by_file_io
87+
x$user_summary_by_file_io_type
88+
x$user_summary_by_stages
89+
x$user_summary_by_statement_latency
90+
x$user_summary_by_statement_type
91+
x$waits_by_host_by_latency
92+
x$waits_by_user_by_latency
93+
x$waits_global_by_latency
94+
x$wait_classes_global_by_avg_latency
95+
x$wait_classes_global_by_latency
96+
SELECT ROUTINE_NAME, ROUTINE_TYPE FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA = 'sys' ORDER BY ROUTINE_TYPE, ROUTINE_NAME;
97+
ROUTINE_NAME ROUTINE_TYPE
98+
extract_schema_from_file_name FUNCTION
99+
extract_table_from_file_name FUNCTION
100+
format_bytes FUNCTION
101+
format_path FUNCTION
102+
format_statement FUNCTION
103+
format_time FUNCTION
104+
ps_is_account_enabled FUNCTION
105+
ps_is_instrument_default_enabled FUNCTION
106+
ps_is_instrument_default_timed FUNCTION
107+
ps_thread_id FUNCTION
108+
ps_thread_stack FUNCTION
109+
sys_get_config FUNCTION
110+
create_synonym_db PROCEDURE
111+
ps_setup_disable_background_threads PROCEDURE
112+
ps_setup_disable_consumer PROCEDURE
113+
ps_setup_disable_instrument PROCEDURE
114+
ps_setup_disable_thread PROCEDURE
115+
ps_setup_enable_background_threads PROCEDURE
116+
ps_setup_enable_consumer PROCEDURE
117+
ps_setup_enable_instrument PROCEDURE
118+
ps_setup_enable_thread PROCEDURE
119+
ps_setup_reload_saved PROCEDURE
120+
ps_setup_reset_to_default PROCEDURE
121+
ps_setup_save PROCEDURE
122+
ps_setup_show_disabled PROCEDURE
123+
ps_setup_show_disabled_consumers PROCEDURE
124+
ps_setup_show_disabled_instruments PROCEDURE
125+
ps_setup_show_enabled PROCEDURE
126+
ps_setup_show_enabled_consumers PROCEDURE
127+
ps_setup_show_enabled_instruments PROCEDURE
128+
ps_statement_avg_latency_histogram PROCEDURE
129+
ps_trace_statement_digest PROCEDURE
130+
ps_trace_thread PROCEDURE
131+
ps_truncate_all_tables PROCEDURE
132+
SELECT TRIGGER_NAME FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_SCHEMA = 'sys' ORDER BY TRIGGER_NAME;
133+
TRIGGER_NAME
134+
sys_config_insert_set_user
135+
sys_config_update_set_user
136+
SELECT sys_version FROM sys.version;
137+
sys_version
138+
1.4.0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SELECT sys.extract_schema_from_file_name(NULL);
2+
sys.extract_schema_from_file_name(NULL)
3+
NULL
4+
SELECT sys.extract_schema_from_file_name('/var/lib/mysql/employees/employee.ibd');
5+
sys.extract_schema_from_file_name('/var/lib/mysql/employees/employee.ibd')
6+
employees
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SELECT sys.extract_table_from_file_name(NULL);
2+
sys.extract_table_from_file_name(NULL)
3+
NULL
4+
SELECT sys.extract_table_from_file_name('/var/lib/mysql/employees/employee.ibd');
5+
sys.extract_table_from_file_name('/var/lib/mysql/employees/employee.ibd')
6+
employee
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
SELECT sys.format_bytes(NULL);
2+
sys.format_bytes(NULL)
3+
NULL
4+
SELECT sys.format_bytes(1);
5+
sys.format_bytes(1)
6+
1 bytes
7+
SELECT sys.format_bytes(1023);
8+
sys.format_bytes(1023)
9+
1023 bytes
10+
SELECT sys.format_bytes(1024);
11+
sys.format_bytes(1024)
12+
1.00 KiB
13+
SELECT sys.format_bytes(1048575);
14+
sys.format_bytes(1048575)
15+
1024.00 KiB
16+
SELECT sys.format_bytes(1048576);
17+
sys.format_bytes(1048576)
18+
1.00 MiB
19+
SELECT sys.format_bytes(1073741823);
20+
sys.format_bytes(1073741823)
21+
1024.00 MiB
22+
SELECT sys.format_bytes(1073741824);
23+
sys.format_bytes(1073741824)
24+
1.00 GiB
25+
SELECT sys.format_bytes(1099511627775);
26+
sys.format_bytes(1099511627775)
27+
1024.00 GiB
28+
SELECT sys.format_bytes(1099511627776);
29+
sys.format_bytes(1099511627776)
30+
1.00 TiB
31+
SELECT sys.format_bytes(1125899906842623);
32+
sys.format_bytes(1125899906842623)
33+
1024.00 TiB
34+
SELECT sys.format_bytes(1125899906842624);
35+
sys.format_bytes(1125899906842624)
36+
1.00 PiB
37+
SELECT sys.format_bytes(1125899906842624238947293);
38+
sys.format_bytes(1125899906842624238947293)
39+
1000000000.00 PiB
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
SELECT sys.format_path(NULL);
2+
sys.format_path(NULL)
3+
NULL
4+
SET @mypath := CONCAT(@@global.datadir, 'foo/bar.foo');
5+
SELECT sys.format_path(@mypath);
6+
sys.format_path(@mypath)
7+
@@datadir/foo/bar.foo
8+
SET @mypath := CONCAT(@@global.tmpdir, 'foo/bar.foo');
9+
SELECT sys.format_path(@mypath);
10+
sys.format_path(@mypath)
11+
@@tmpdir/foo/bar.foo
12+
SET @mypath := CONCAT(@@global.slave_load_tmpdir, 'foo/bar.foo');
13+
SELECT sys.format_path(@mypath);
14+
sys.format_path(@mypath)
15+
@@tmpdir/foo/bar.foo
16+
SET @mypath := CONCAT(@@global.innodb_log_group_home_dir, 'foo/bar.foo');
17+
SELECT sys.format_path(@mypath);
18+
sys.format_path(@mypath)
19+
@@innodb_log_group_home_dir/foo/bar.foo
20+
SET @mypath := CONCAT('/private', @@global.tmpdir, 'foo/bar.foo');
21+
SELECT sys.format_path(@mypath);
22+
sys.format_path(@mypath)
23+
@@tmpdir/foo/bar.foo
24+
SELECT sys.format_path('/foo/bar/baz.foo');
25+
sys.format_path('/foo/bar/baz.foo')
26+
/foo/bar/baz.foo
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SELECT sys.format_statement(NULL);
2+
sys.format_statement(NULL)
3+
NULL
4+
SELECT sys.format_statement('SELECT foo, bar, baz, foobar, foobaz FROM foo JOIN bar USING (foobar) JOIN baz USING (foobar) WHERE foo = \'foo\' AND bar = \'bar\'') AS statement;
5+
statement
6+
SELECT foo, bar, baz, foobar, ... RE foo = 'foo' AND bar = 'bar'
7+
SET @sys.statement_truncate_len = 80;
8+
SELECT sys.format_statement('SELECT foo, bar, baz, foobar, foobaz FROM foo JOIN bar USING (foobar) JOIN baz USING (foobar) WHERE foo = \'foo\' AND bar = \'bar\'') AS statement;
9+
statement
10+
SELECT foo, bar, baz, foobar, foobaz F ... bar) WHERE foo = 'foo' AND bar = 'bar'

0 commit comments

Comments
 (0)