Skip to content

Commit 7e4f32b

Browse files
author
Christopher Powers
committed
WL#13439 Sys Schema, Replace Stored Functions With Native Functions
WL#7803 "Performance Schema, Native Functions" defines four native functions: format_pico_time(), format_bytes(), PS_current_thread_id(), PS_thread_id() Now that WL#12673 "Move the Sys Schema sources into the mysql server tree" is complete, these native functions can replace the corresponding stored procedures in the SYS schema. Reviewed-by: Marc Alff <marc.alff@oracle.com>
1 parent 3a60b4c commit 7e4f32b

File tree

115 files changed

+351
-813
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+351
-813
lines changed

mysql-test/r/initialize.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ COUNT(*)
3232
# If this value differs, also update SYS_FUNCTION_COUNT within ./client/upgrade/program.cc
3333
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA = 'sys' AND ROUTINE_TYPE = 'FUNCTION';
3434
COUNT(*)
35-
22
35+
19
3636
# If this value differs, also update SYS_TABLE_COUNT within ./client/upgrade/program.cc
3737
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'sys' AND TABLE_TYPE = 'BASE TABLE';
3838
COUNT(*)

mysql-test/r/join_nested.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2493,6 +2493,6 @@ INNER JOIN t AS b ON a.c >= b.d;
24932493
c
24942494
SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name
24952495
WHERE event_name = 'memory/sql/thd::main_mem_root'
2496-
AND thread_id = sys.ps_thread_id(connection_id())
2496+
AND thread_id = ps_thread_id(connection_id())
24972497
AND sum_number_of_bytes_alloc > 1000000
24982498
DROP TABLE t;

mysql-test/r/join_nested_bka.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2494,7 +2494,7 @@ INNER JOIN t AS b ON a.c >= b.d;
24942494
c
24952495
SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name
24962496
WHERE event_name = 'memory/sql/thd::main_mem_root'
2497-
AND thread_id = sys.ps_thread_id(connection_id())
2497+
AND thread_id = ps_thread_id(connection_id())
24982498
AND sum_number_of_bytes_alloc > 1000000
24992499
DROP TABLE t;
25002500
CREATE TABLE t5 (a int, b int, c int, PRIMARY KEY(a), KEY b_i (b));

mysql-test/r/join_nested_bka_nobnl.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2494,7 +2494,7 @@ INNER JOIN t AS b ON a.c >= b.d;
24942494
c
24952495
SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name
24962496
WHERE event_name = 'memory/sql/thd::main_mem_root'
2497-
AND thread_id = sys.ps_thread_id(connection_id())
2497+
AND thread_id = ps_thread_id(connection_id())
24982498
AND sum_number_of_bytes_alloc > 1000000
24992499
DROP TABLE t;
25002500
CREATE TABLE t5 (a int, b int, c int, PRIMARY KEY(a), KEY b_i (b));

mysql-test/r/mysqldump.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5162,7 +5162,7 @@ DROP DATABASE dump_generated;
51625162
#
51635163
SELECT COUNT(*) FROM INFORMATION_SCHEMA.routines WHERE routine_schema = 'sys';
51645164
COUNT(*)
5165-
48
5165+
45
51665166
DROP DATABASE sys;
51675167
SELECT COUNT(*) FROM INFORMATION_SCHEMA.routines WHERE routine_schema = 'sys';
51685168
COUNT(*)
@@ -5172,7 +5172,7 @@ COUNT(*)
51725172
0
51735173
SELECT COUNT(*) FROM INFORMATION_SCHEMA.routines WHERE routine_schema = 'sys';
51745174
COUNT(*)
5175-
48
5175+
45
51765176
#
51775177
# WL#8697: Invisible Indexes
51785178
# Test of mysqldump.

mysql-test/r/ps_sys_upgrade.result

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,13 @@ ps_trace_thread
4848
ps_truncate_all_tables
4949
statement_performance_analyzer
5050
table_exists
51-
# Now drop functions and make sure re-install is done
52-
DROP FUNCTION sys.format_bytes;
53-
DROP FUNCTION sys.format_time;
5451
# restart:--upgrade=FORCE
5552
SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA = 'sys' AND ROUTINE_TYPE = 'FUNCTION';
5653
ROUTINE_NAME
5754
extract_schema_from_file_name
5855
extract_table_from_file_name
59-
format_bytes
6056
format_path
6157
format_statement
62-
format_time
6358
list_add
6459
list_drop
6560
ps_is_account_enabled
@@ -68,7 +63,6 @@ ps_is_instrument_default_enabled
6863
ps_is_instrument_default_timed
6964
ps_is_thread_instrumented
7065
ps_thread_account
71-
ps_thread_id
7266
ps_thread_stack
7367
ps_thread_trx_info
7468
quote_identifier

mysql-test/suite/clone/r/monitor_progress.result

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,10 @@ stage/innodb/clone (redo copy) 1 1 1 1
135135
SELECT EVENT_NAME, TIMER_START > 0, TIMER_END > 0, TIMER_WAIT > 0,
136136
SQL_TEXT, CURRENT_SCHEMA
137137
FROM performance_schema.events_statements_history_long
138-
WHERE thread_id = sys.ps_thread_id(CONNECTION_ID())
138+
WHERE thread_id = ps_thread_id(CONNECTION_ID())
139139
AND event_name LIKE "statement/clone/%";
140140
EVENT_NAME TIMER_START > 0 TIMER_END > 0 TIMER_WAIT > 0 SQL_TEXT CURRENT_SCHEMA
141141
statement/clone/local 1 1 1 CLONE LOCAL DATA DIRECTORY = '$CLONE_DATADIR' test
142-
Warnings:
143-
Note 1585 This function 'ps_thread_id' has the same name as a native function
144142
SET DEBUG_SYNC='RESET';
145143
TRUNCATE TABLE performance_schema.events_stages_history;
146144
TRUNCATE TABLE performance_schema.events_stages_history_long;

mysql-test/suite/clone/r/remote_monitor_progress.result

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,10 @@ stage/innodb/clone (redo copy) 1 1 1 1
145145
SELECT EVENT_NAME, TIMER_START > 0, TIMER_END > 0, TIMER_WAIT > 0,
146146
SQL_TEXT, CURRENT_SCHEMA
147147
FROM performance_schema.events_statements_history_long
148-
WHERE thread_id = sys.ps_thread_id(CONNECTION_ID())
148+
WHERE thread_id = ps_thread_id(CONNECTION_ID())
149149
AND event_name LIKE "statement/clone/%";
150150
EVENT_NAME TIMER_START > 0 TIMER_END > 0 TIMER_WAIT > 0 SQL_TEXT CURRENT_SCHEMA
151151
statement/clone/client 1 1 1 CLONE INSTANCE FROM USER@HOST:PORT IDENTIFIED BY <secret> DATA DIRECTORY = '$CLONE_DATADIR' test
152-
Warnings:
153-
Note 1585 This function 'ps_thread_id' has the same name as a native function
154152
SET DEBUG_SYNC='RESET';
155153
TRUNCATE TABLE performance_schema.events_stages_history;
156154
TRUNCATE TABLE performance_schema.events_stages_history_long;

mysql-test/suite/clone/t/monitor_progress.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ ORDER BY EVENT_NAME;
146146
SELECT EVENT_NAME, TIMER_START > 0, TIMER_END > 0, TIMER_WAIT > 0,
147147
SQL_TEXT, CURRENT_SCHEMA
148148
FROM performance_schema.events_statements_history_long
149-
WHERE thread_id = sys.ps_thread_id(CONNECTION_ID())
149+
WHERE thread_id = ps_thread_id(CONNECTION_ID())
150150
AND event_name LIKE "statement/clone/%";
151151

152152
SET DEBUG_SYNC='RESET';

mysql-test/suite/sysschema/r/all_sys_objects_exist.result

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,8 @@ SELECT ROUTINE_NAME, ROUTINE_TYPE FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE
106106
ROUTINE_NAME ROUTINE_TYPE
107107
extract_schema_from_file_name FUNCTION
108108
extract_table_from_file_name FUNCTION
109-
format_bytes FUNCTION
110109
format_path FUNCTION
111110
format_statement FUNCTION
112-
format_time FUNCTION
113111
list_add FUNCTION
114112
list_drop FUNCTION
115113
ps_is_account_enabled FUNCTION
@@ -118,7 +116,6 @@ ps_is_instrument_default_enabled FUNCTION
118116
ps_is_instrument_default_timed FUNCTION
119117
ps_is_thread_instrumented FUNCTION
120118
ps_thread_account FUNCTION
121-
ps_thread_id FUNCTION
122119
ps_thread_stack FUNCTION
123120
ps_thread_trx_info FUNCTION
124121
quote_identifier FUNCTION

0 commit comments

Comments
 (0)