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

UpdateCount for prepared statements retrieved after closing the statement

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.2.3, 1.7.3
    • N/A
    • batch
    • None

    Description

      Look at: org.mariadb.jdbc.MariaDbPreparedStatementClient#executeBatch():

      executeInternalBatch(size);
      results.commandEnd();
      return results.getCmdInformation().getUpdateCounts();
      

      Calling commandEnd() before getUpdateCounts() (for CmdInformationBatch) causes the latter returning a value like [-2, -2, -2, ...] so no actual count is returned. But when you change the order (getUpdateCounts() before commandEnd()) then the first element of returned array contains actual update count.

      I'm not sure whether that change would lead to other problems.

      A similar situation is in executeLargeBatch().

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            robelcik Robert Borys
            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.