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

JDBCUrl.parseConnectorJUrl ignores username and password in url parameters

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.7
    • 1.1.8
    • None
    • None

    Description

      Documentation at https://mariadb.com/kb/en/mariadb/client-libraries/mariadb-java-client/about-the-mariadb-java-client/ specifies that "user" and "password" are valid url parameters.

      JDBCUrl.parseConnectorJUrl instantiates both username and password of the resulting JDBCUrl as the empty string, no matter the input. This causes MySQLDataSource to treat the username and password as empty.

      private static JDBCUrl parseConnectorJUrl(String url) {
              if (!url.startsWith("jdbc:mysql://")) {
                  return null;
              }
              
              url = url.substring(13);
              String hostname;
              String database;
              String[] tokens = url.split("/");
              hostname=tokens[0];
              database=(tokens.length > 1)?tokens[1]:null;
              return new JDBCUrl("", "",  database, HostAddress.parse(hostname));
          }

      Attachments

        Activity

          People

            massimo.siani Massimo Siani (Inactive)
            franksocotra Frank Kline
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.