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

Return from result set not checked creating connection

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.2.0
    • 1.2.2
    • Other
    • None
    • JDBC

    Description

      MySQLProtocol at line 417

      SelectQueryResult qr = null;
      try

      { qr = (SelectQueryResult) executeQuery(new MySQLQuery("show variables like 'max_allowed_packet'")); qr.next(); setMaxAllowedPacket(qr.getValueObject(1).getInt()); }

      finally

      { if (qr != null)qr.close(); }

      doesn't check the return from qr.next which can be zero. Code should be:

      SelectQueryResult qr = null;
      try {
      qr = (SelectQueryResult) executeQuery(new MySQLQuery("show variables like 'max_allowed_packet'"));
      if (qr.next())
      { setMaxAllowedPacket(qr.getValueObject(1).getInt()); }
      } finally { if (qr != null)qr.close(); }

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            GeoffreyR Geoffrey Rutherford
            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.