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

Possible ColumnAlreadyExistsException is thrown from delete when autocommit off

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.0.0-alpha, 4.14.0
    • None
    • None

    Description

      Here are the simple steps to reproduce it.

      0: jdbc:phoenix:localhost> CREATE TABLE IF NOT EXISTS A (a INTEGER PRIMARY KEY,b UNSIGNED_INT,c BIGINT);
      No rows affected (2.3 seconds)
      0: jdbc:phoenix:localhost> CREATE INDEX idx_global ON A (c);
      No rows affected (7.282 seconds)
      0: jdbc:phoenix:localhost> CREATE LOCAL INDEX idx_local ON A (c);
      No rows affected (11.322 seconds)
      0: jdbc:phoenix:localhost> !autocommit off
      *Autocommit status: false*
      0: jdbc:phoenix:localhost> delete from A where a > 5;
      *Error: ERROR 514 (42892): A duplicate column name was detected in the object definition or ALTER TABLE/VIEW statement. columnName=A.C (state=42892,code=514)*
      org.apache.phoenix.schema.ColumnAlreadyExistsException: ERROR 514 (42892): A duplicate column name was detected in the object definition or ALTER TABLE/VIEW statement. columnName=A.C
       at org.apache.phoenix.schema.PTableImpl.init(PTableImpl.java:529)
       at org.apache.phoenix.schema.PTableImpl.<init>(PTableImpl.java:421)
       at org.apache.phoenix.schema.PTableImpl.makePTable(PTableImpl.java:305)
       at org.apache.phoenix.compile.DeleteCompiler.compile(DeleteCompiler.java:730)
       at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableDeleteStatement.compilePlan(PhoenixStatement.java:771)
       at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableDeleteStatement.compilePlan(PhoenixStatement.java:759)
       at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:387)
       at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:377)
       at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
       at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:376)
       at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:364)
       at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1738)
       at sqlline.Commands.execute(Commands.java:822)
       at sqlline.Commands.sql(Commands.java:732)
       at sqlline.SqlLine.dispatch(SqlLine.java:813)
       at sqlline.SqlLine.begin(SqlLine.java:686)
       at sqlline.SqlLine.start(SqlLine.java:398)
       at sqlline.SqlLine.main(SqlLine.java:291)
      0: jdbc:phoenix:localhost> 
      

      Attachments

        1. PHOENIX-4551_v2.patch
          3 kB
          Rajeshbabu Chintaguntla
        2. PHOENIX-4551_v3.patch
          5 kB
          Rajeshbabu Chintaguntla
        3. PHOENIX-4551.patch
          5 kB
          Rajeshbabu Chintaguntla

        Activity

          People

            rajeshbabu Rajeshbabu Chintaguntla
            romil.choksi Romil Choksi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: