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

CallableStatements with Boolean OUT parameter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.2.5, 2.4.2
    • Fix Version/s: N/A
    • Component/s: MySQL compatibility
    • Labels:
      None
    • Environment:
      MySQL 5.6 database

      Description

      We observed an inconsistent behaviour from MySQL Connector/J to MariaDB Connector/J.

      Steps to reproduce:

      1) Create a SP that always returns 0 (false)

      create procedure FalseFunc (OUT o_duplicate BIT(1)) begin set o_duplicate = 0; end
      

      2) Create a Test case that calls the stored procedure

      @Test
      public void test_sp() throws SQLException {
      Connection con = DriverManager.getConnection("jdbc:mysql://localhost/mydb", "root", null);
      CallableStatement cs = con.prepareCall("{call FalseFunc(?) }");
      cs.registerOutParameter(1, Types.BOOLEAN);
      cs.executeQuery();
       
      boolean value = cs.getBoolean(1);
       
      assertFalse(value);
       
      con.close();
      }
      

      3) Calls the test case with the mariadb-java-client-2.2.5 and mysql-connector-java-5.1.47

      4) The test case works with the MySQL JDBC Driver but fails with MariaDB JDBC Driver. It always returns true, even though it should return false.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              diego dupin Diego Dupin
              Reporter:
              raupach Björn Raupach
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.