Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1024

Procedure execution failure through proxysql

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Incomplete
    • 2.7.7
    • N/A
    • stored procedure
    • 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)

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            goutham RAKALA GOUTHAM GOUD
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.