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

ROW_TIMESTAMP on TIMESTAMP column type throws ArrayOutOfBound when upserting without providing a value.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.10.0
    • 4.15.0, 5.1.0, 4.14.2
    • None
    • None

    Description

      CREATE TABLE TEST (
        CREATED TIMESTAMP NOT NULL,
        ID CHAR(36) NOT NULL,
        DEFINITION VARCHAR,
        CONSTRAINT TEST_PK PRIMARY KEY (CREATED ROW_TIMESTAMP, ID)
      )
      
      -- WORKS
      UPSERT INTO TEST (CREATED, ID, DEFINITION) VALUES (NOW(), 'A', 'DEFINITION A');
      
      -- ArrayOutOfBoundException
      UPSERT INTO TEST (ID, DEFINITION) VALUES ('A', 'DEFINITION A');
      

      Stack Trace:

      java.lang.ArrayIndexOutOfBoundsException: 8
      
      	at org.apache.phoenix.execute.MutationState.getNewRowKeyWithRowTimestamp(MutationState.java:554)
      	at org.apache.phoenix.execute.MutationState.generateMutations(MutationState.java:640)
      	at org.apache.phoenix.execute.MutationState.addRowMutations(MutationState.java:572)
      	at org.apache.phoenix.execute.MutationState.send(MutationState.java:1003)
      	at org.apache.phoenix.execute.MutationState.send(MutationState.java:1469)
      	at org.apache.phoenix.execute.MutationState.commit(MutationState.java:1301)
      	at org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:539)
      	at org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:536)
      	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
      	at org.apache.phoenix.jdbc.PhoenixConnection.commit(PhoenixConnection.java:536)
      

      Attachments

        1. PHOENIX-3991-1.patch
          5 kB
          Sergey Soldatov

        Issue Links

          Activity

            People

              sergey.soldatov Sergey Soldatov
              SneakySmiley Eric Belanger
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: