Skip to content

Studio doesn't show errors from duplicated key #786

Closed

Description

@gramian

ArcadeDB Version: v23.1.1 (build aa687e4/1673895089679/main)

JDK Version: openjdk 11.0.17 2022-10-18

OS: MacOS 12.6

Given a unique index on a property, there is no error posted for a single insert with a duplicate value.

Expected behavior

Error message

Actual behavior

RID is assigned

Steps to reproduce

CREATE DOCUMENT TYPE doc;
CREATE PROPERTY doc.uni LONG;
CREATE INDEX ON doc (uni) UNIQUE;
INSERT INTO doc SET uni = 0;
INSERT INTO doc SET uni = 1;

This does not produce an error:

INSERT INTO doc SET uni = 0;

This produces the expected error:

INSERT INTO doc SET uni = 2;
INSERT INTO doc SET uni = 2;

This does not:

INSERT INTO doc SET uni = 3;
INSERT INTO doc SET uni = 1;

Activity

  1. gramian commented on Jan 23, 2023

    @gramian
    CollaboratorAuthor

    @lvca This also does not work if I do

    REBUILD INDEX `doc[uni]`;
    

    between INSERTs.

  2. gramian commented on Jan 29, 2023

    @gramian
    CollaboratorAuthor

    This seems to be a studio / console issue(?). So, the unique index seems to work correctly but in case of a single insert no error is reported back. However, the server logs a duplicate entry error.

  3. reopened this on Jan 29, 2023
  4. changed the title [-]Unique Index does not error on single non-unique insert[/-] [+]Studio doesn't show errors from duplicated key[/+] on Jan 29, 2023
  5. self-assigned this
    on Jan 29, 2023
  6. added and removed
    invalidThis doesn't seem right
    on Jan 29, 2023
  7. added this to the 23.1.2 milestone on Jan 29, 2023
  8. lvca commented on Jan 29, 2023

    @lvca
    Member

    I reopened the issue and changed the name. You're right, the problem is with Studio, or better, with the HTTP layer. The duplicated key is thrown at commit time after the error code 200 is already sent back. What it's needed is a refactoring on that part to send the HTTP response code after the commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions