Bug #97496 SQL not record in ps when useCursorFetch or useServerPrepStmts is true
Submitted: 5 Nov 15:31 Modified: 14 Nov 11:46
Reporter: 镇熙 林 Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:5.1.48, 8.0.18 OS:Any
Assigned to: CPU Architecture:Any
Tags: events_statements_summary_by_digest, performance_schema, useCursorFetch, useServerPrepStmts

[5 Nov 15:31] 镇熙 林
Description:
In case of useCursorFetch=true or useServerPrepStmts=true, and SQL with binding variable (?), SQL would not record in performance_schema.events_statements_summary_by_digest.

useCursorFetch	useServerPrepStmts	setFetchSize	select+const	select+variable	insert+const	insert+variable
------------------------------------------------------------------------
0	0	0	Y	Y	Y	Y
0	0	1	Y	Y	Y	Y
0	1	0	Y	N	Y	N	
0	1	1	Y	N	Y	N
1	0	0	Y	N	Y	N
1	0	1	N	N	N	N
1	1	0	Y	N	Y	N
1	1	1	N	N	Y	N

How to repeat:
I ran demo by <useprep.sh> and <TestUsePrep.java> and got result <useprep.sh.log>.
[5 Nov 15:32] 镇熙 林
demo for java

Attachment: TestUsePrep.java (application/octet-stream, text), 2.18 KiB.

[5 Nov 15:33] 镇熙 林
demo for shell script

Attachment: useprep.sh (application/octet-stream, text), 3.85 KiB.

[5 Nov 15:33] 镇熙 林
demo result

Attachment: useprep.sh.log (text/plain), 27.89 KiB.

[14 Nov 11:46] Umesh Shastry
Hello!

Thank you for the report and test case.

regards,
Umesh