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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.3, 1.7.3
    • Fix Version/s: N/A
    • Component/s: batch
    • Labels:
      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

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            robelcik Robert Borys
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration