Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-2919

PreparedStatement Returns Incorrect Number of Deleted Records

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.7.0
    • Fix Version/s: 4.8.0
    • Labels:

      Description

      The java.sql.PreparedStatement.executeUpdate() return contract states the following:
      "Returns:
      either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing".

      Phoenix deletion statements that delete 1000 or more records return an incorrect value from executeUpdate().

      REPRO:
      Execute this table create statement:
      DROP TABLE IF EXISTS TEST_TABLE;
      CREATE TABLE IF NOT EXISTS TEST_TABLE (
      pk1 DECIMAL NOT NULL,
      v1 VARCHAR
      CONSTRAINT PK PRIMARY KEY
      (
      pk1
      )
      );

      Then see and execute the attached Java class to see repro.

        Attachments

        1. PhoenixDeletionError.java
          1.0 kB
          Brian Esserlieu
        2. PHOENIX-2919.patch
          3 kB
          Samarth Jain

          Activity

            People

            • Assignee:
              samarthjain Samarth Jain
              Reporter:
              rangent Brian Esserlieu
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: