Bug #95825 Function does not exist but it does
Submitted: 15 Jun 2019 12:50 Modified: 22 Jul 2019 12:09
Reporter: Dave Pullin (Basic Quality Contributor) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.7.26 OS:CentOS (.10.0-514.6.2.el7.x86_64)
Assigned to: CPU Architecture:x86

[15 Jun 2019 12:50] Dave Pullin
Description:
I apologize that I can't give you a reproducible test case.

I am running multiple servers in production and this is killing production.

Our implementation is functions and procedures calling functions and procedures, nested deeply.

A procedure will calls a function (that exists). At a rate between approximate one per thousand and one per million,  it fails with "function does not exists".

All test to confirm that the function actually exists are positive immediately after a failure with "function does not exist".

We have programmed tight loops  to retry the same JDBC base call and it found succeed immediately after it failed. 

The problem occurs in batches across many functions and callers and then stops happening after an hour or so, and then might not happen for another day.

The problem occurs on in many different places with different procedures calling different functions.  If we recode the target from being a function to being a semantically equivalent procedure then the problem does not occur.

There are no logs entries, no dumps.
It occurs on multiple instances of the database server (running essentially the same logic).

I appreciate you cant do much with this bug report. BUt if you can tell me what to do to provide you with help I will.

My guess is that this is a memory or pointer management problem deep in MySQL 

How to repeat:

Sorry you can't. 

I have run a tight test case loop that produced the failure, and then did not produce the failure again in more than 25 million retries. (with no code changes)

Suggested fix:
You can't, at least no yet. Give me guidance on what you need to find the bug.
[21 Jun 2019 13:28] MySQL Verification Team
Hi,

Thank you for your bug report.

You are already aware that we need a repeatable test case.

However, I will try to provide you a way to try to make it reproducible ... It is possible that you have a problem in your Java application, or that there is a bug in the JDBC API that you are using.

Hence, please try to make SQL scripts with all (or most) of the stored routines that are on the top on the calling stack. That might solve your problem or provide a test case.
[22 Jul 2019 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".
[22 Jul 2019 12:09] Dave Pullin
Bearing in mind how difficult it is to reproduce this bug, we have not been able to reproduce the bug, even once, when MySQL is invoked directly (without JDBC). 

That suggests the bug is caused by the JDBC layer: ie. 

1. Java calls "call A()" using JDBC
2. procedure A uses function B. eg select .. B() ...
3. MySQL throws "Function B does not exist".

Yet
1. console invocation of "call A()" works 
2. console invocation of "select .. B() ..." works 

If that is true, how can we debug it?
[22 Jul 2019 12:23] MySQL Verification Team
This could be a problem of the privileges or of the JDBC .......

Try both .....