[CONJ-1024] Procedure execution failure through proxysql Created: 2022-11-18  Updated: 2023-11-16  Resolved: 2023-11-16

Status: Closed
Project: MariaDB Connector/J
Component/s: stored procedure
Affects Version/s: 2.7.7
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: RAKALA GOUTHAM GOUD Assignee: Diego Dupin
Resolution: Incomplete Votes: 0
Labels: Compatibility
Environment:

Proxysql version - 2.4.4
MySQL - 5.7
Mariadb driver versions - 2.7.2/2.7.6/2.7.7
Java version - 1.8



 Description   

Hi Team

We are unable to extract OUT/INOUT parameter value when calling stored procedure from JAVA. This happens only when connecting via proxysql and works properly when connecting directly to DB instead of proxysql.

Below is the sample java code and error found -----

private void executeStoredProcWith_INOUT_Paramas(Connection con) {
CallableStatement callableStatement = null;
try {
LOG.error("in executeStoredProcWith_INOUT_Paramas");
callableStatement = con.prepareCall("

Unknown macro: {call testProcINOUT(?,?) }

");
int input = (int) System.currentTimeMillis() % 100000000;
callableStatement.setInt(1, input);
callableStatement.setInt(2, 1000);
callableStatement.registerOutParameter(2, Types.INTEGER);

boolean hadResults = callableStatement.execute();
// Process all returned result sets
while (hadResults)

Unknown macro: { ResultSet rs = callableStatement.getResultSet(); hadResults = callableStatement.getMoreResults(); }

int returnValue = callableStatement.getInt(2);
LOG.error("--------- Completed executeStoredProcWith_INOUT_Paramas input =" + input + ", output="
+ returnValue);
} catch (Throwable th)

Unknown macro: { LOG.error("================================ Failed to execute executeStoredProcWith_INOUT_Paramas}

finally {
if (callableStatement != null) {
try

Unknown macro: { callableStatement.close(); }

catch (SQLException e) {
}
}
}
}

Below is the exception we are getting only when connecting through proxysql

Failed to execute executeStoredProcWith_IN_OUT_Paramas:java.sql.SQLException: No output result.
at org.mariadb.jdbc.MariaDbProcedureStatement.getOutputResult(MariaDbProcedureStatement.java:132)
at org.mariadb.jdbc.CallableProcedureStatement.getInt(CallableProcedureStatement.java:276)
at com.mchange.v2.c3p0.impl.NewProxyCallableStatement.getInt(NewProxyCallableStatement.java:406)
at com.hrc.prxysql.ProxysqlUseCasesTestUtil.executeStoredProcWith_IN_OUT_Paramas(ProxysqlUseCasesTestUtil.java:216)



 Comments   
Comment by Diego Dupin [ 2022-11-22 ]

If that's a proxySQL issue, we cannot do much about it.
To be sure, it would be nice to have wireshark exchanges during this test with proxysql / or if you use logging add "log=true" option and configure logging level to trace.

Comment by Diego Dupin [ 2023-07-26 ]

any news ?

Generated at Thu Feb 08 03:20:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.