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

invalid or undocumented error code and state returned when MariaDB server is down

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2.1
    • Fix Version/s: None
    • Component/s: JDBC 4.2 compatibility
    • Labels:
      None
    • Environment:
      JDBC driver 2.2.1, MariaDB 10.1.30, Ubuntu 16.04 LTS

      Description

      If a database connection is tried when MariaDB server is down, the JDBC driver returns following error information:

      Error code:-1
      SQL State:08
      Message:Could not connect to address=(host=localhost)(port=3306)(type=master) : Connection refused (Connection refused)

      I believe error code -1 is not a valid error code and not documented at https://mariadb.com/kb/en/library/mariadb-error-codes/. Further, SQL State is expected to be 5 characters but not sure if it is right to return 2 character major class of errors.

      Above mentioned error information can be reproduced by running attached program as following:

      java MariaDbInvErrorCodeBug org.mariadb.jdbc.Driver jdbc:mariadb://localhost:3306/bladb blauser blapasswd

      Output displayed by the program is as following:
      Error code:-1
      SQL State:08
      Message:Could not connect to address=(host=localhost)(port=3306)(type=master) : Connection refused (Connection refused)

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            mvsagar Vidyasagar Mundroy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: