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

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 2.2.1
    • 3.0.0
    • JDBC 4.2 compatibility
    • None
    • 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

            diego dupin Diego Dupin
            mvsagar Vidyasagar Mundroy
            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.