Bug #102055 Performance Schema does not report procedure call
Submitted: 22 Dec 2020 22:56 Modified: 25 Jan 2021 13:04
Reporter: Nirav Shah Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:5.7.19-log OS:Windows
Assigned to: CPU Architecture:Any

[22 Dec 2020 22:56] Nirav Shah
Description:
One of my client using MySQL 5.7 in their production workload.
We have enabled performance schema to get all the query visible on the dashboard & tune it.
However the version mysql installed does not show CALL procedure in performance schema when we have SELECT in single line.

How to repeat:
Step 1: Create procedure with SELECT in individual line:

CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_reports_SalesRegister`(IN `supp_gstin` VARCHAR(500),IN from_dt VARCHAR(20),IN to_dt VARCHAR(20),IN ndoc_type VARCHAR(100),IN nsub_location  VARCHAR(1000),IN nbuyerGstin VARCHAR(500),IN nsuppType VARCHAR(1000))
BEGIN

DECLARE fromdt Date;
DECLARE todt Date;

SET @fromdt=STR_TO_DATE(from_dt, '%d-%m-%Y');
SET @todt=STR_TO_DATE(to_dt, '%d-%m-%Y');

select 
		i.irn_no 'IRN No',
		h.supplier_gstin 'Supplier GSTIN',
		h.doc_type 'Doc Type',
		h.supply_type 'Supply Type.',
		h.ecom_gstin 'Ecom GSTIN',

Step 2: Call procedure: 
CALL sp_reports_SalesRegister('1','1','1','1','1','1','1');

Step 3: Check performance schema output blank:
select * from performance_schema.events_statements_history where timer_start > now() - interval 1 hour and sql_text like 'call%'
Empty set (0.07 sec)
Note: We are getting other queries logged correctly:
select * from performance_schema.events_statements_history where timer_start > now() - interval 1 hour limit 5;																																								
THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	DIGEST	DIGEST_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE	NESTING_EVENT_LEVEL
50301449	1	1	statement/sql/select	socket_connection.cc:101	2.8276086705927E+018	2.8276086708059E+018	213200000	0	/* mysql-connector-java-8.0.15 (Revision: 79a4336f140499bd22dd07f02b708e163844e3d5) */SELECT  @@session.auto_increment_increment AS auto_increment_increment, @@character_set_client AS character_set_client, @@character_set_connection AS character_set_connection, @@character_set_results AS character_set_results, @@character_set_server AS character_set_server, @@collation_server AS collation_server, @@collation_connection AS collation_connection, @@init_connect AS init_connect, @@interactive_timeout AS interactive_timeout, @@license AS license, @@lower_case_table_names AS lower_case_table_names, @@max_allowed_packet AS max_allowed_packet, @@net_write_timeout AS net_write_timeout, @@query_cache_size AS query_cache_size, @@query_cache_type AS query_cache_type, @@sql_mode AS sql_mode, @@system_time_zone AS system_time_zone, @@time_zone AS time_zone, @@tx_isolation AS transaction_isolation, @@wait_timeout AS wait_timeout	f14c5c3ec863b3f92d8aa0f16a0cc0ef	SELECT @@SESSION . `auto_increment_increment` AS `auto_increment_increment` , @@`character_set_client` AS `character_set_client` , @@`character_set_connection` AS `character_set_connection` , @@`character_set_results` AS `character_set_results` , @@`character_set_server` AS `character_set_server` , @@`collation_server` AS `collation_server` , @@`collation_connection` AS `collation_connection` , @@`init_connect` AS `init_connect` , @@`interactive_timeout` AS `interactive_timeout` , @@`license` AS `license` , @@`lower_case_table_names` AS `lower_case_table_names` , @@`max_allowed_packet` AS `max_allowed_packet` , @@`net_write_timeout` AS `net_write_timeout` , @@`query_cache_size` AS `query_cache_size` , @@`query_cache_type` AS `query_cache_type` , @@`sql_mode` AS `sql_mode` , @@`system_time_zone` AS `system_time_zone` , @@`time_zone` AS `time_zone` , @@`tx_isolation` AS `transaction_isolation` , @@`wait_timeout` AS `wait_timeout` 	einvoice_prod	\N	\N	\N	\N	0	\N	\N	0	0	0	1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	\N	\N	0

-------------------------------------------------------------
More details on performance schema configuration:

select * from setup_instruments where name like '%call%'  ;		
NAME	ENABLED	TIMED
statement/sql/call_procedure	YES	YES
memory/sql/sp_head::call_mem_root	NO	NO

select * from performance_schema.setup_actors				
HOST	USER	ROLE	ENABLED	HISTORY
%	%	%	YES	YES

select * from setup_consumers;	
NAME	ENABLED
events_stages_current	NO
events_stages_history	NO
events_stages_history_long	NO
events_statements_current	YES
events_statements_history	YES
events_statements_history_long	NO
events_transactions_current	NO
events_transactions_history	NO
events_transactions_history_long	NO
events_waits_current	NO
events_waits_history	NO
events_waits_history_long	NO
global_instrumentation	YES
thread_instrumentation	YES
statements_digest	YES
[23 Dec 2020 13:34] MySQL Verification Team
Hi Mr. Shah,

Thank you for your bug report.

However, you are using a very old release of MySQL version 5.7.

You should send us a full test case then is 100 % reproducible on the latest bug fix release of the version 5.7. Hence, in order to verify this report, we need to know the behaviour of the latest release, which is 5.7.32. There are hundreds of bugs fixed in Performance Schema between the two releases, so you are probably reporting a bug that is fixed interim.

Thank you in advance.
[24 Jan 2021 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".