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

I want to retrieve the original affected rows (server returned) instead of rewritten affected rows when rewriteBatchedStatements=true.

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.2, 1.5.3
    • Fix Version/s: 2.2.1, 1.7.1
    • Component/s: Other
    • Labels:
      None
    • Environment:
      AWS RDS Aurora 5.6.10a
      mariadb-java-client 1.5.3

      Description

      When rewriteBatchedStatement=true is set, INSERT SQL is rewritten the values in a single query and only single value of affected rows is returned. I am trying to get the ORIGINAL affected rows that server sent before the affected rows are rewritten by 1, SUCCESS_WITH_NO_INFO, or -3.

      It seems if the insert statement is re-written as multiple queries instead of re-written values in one query, I am able to get the accurate update counts (correct me if I am wrong) but it won't allow under the current implementation. If insert statement doesn't contain 'insert .... select' as sub query or followed by another statement (create, update, ...), it won't set the reWritablePrepare=false in ClientPrepareResult constructor. Please inform me if I can have other way to get the affected rows (before updating them) for the bulk insert.

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            seanderson Seonmi Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration