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

Return from result set not checked creating connection

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

          GeoffreyR Geoffrey Rutherford created issue -
          diego dupin Diego Dupin made changes -
          Field Original Value New Value
          Assignee Georg Richter [ georg ] diego dupin [ diego dupin ]
          diego dupin Diego Dupin made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          diego dupin Diego Dupin added a comment - thanks for this point. done with the commit : https://github.com/MariaDB/mariadb-connector-j/commit/297b234656e084843e0070bbde2a70b5f541f040
          diego dupin Diego Dupin made changes -
          Fix Version/s 1.2.1 [ 19602 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          diego dupin Diego Dupin made changes -
          Fix Version/s 1.2.2 [ 19900 ]
          Fix Version/s 1.3.0 [ 19602 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 70801 ] MariaDB v4 [ 134786 ]

          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.