Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console Error on Attempt to Create an Index that Exists even with IF NOT EXISTS Clause #1819

Open
ironluca opened this issue Nov 6, 2024 · 1 comment

Comments

@ironluca
Copy link

ironluca commented Nov 6, 2024

ArcadeDB Version:

24.10.1`

OS and JDK Version:

Ubuntu 22.04 JDK 17

Expected behavior

In console.sh if an attempt is made to create an index on a type with IF NOT EXISTS clause, it should not throw exception

Actual behavior

From console.sh when an index is created on a type for the first time, it works If an attempt is made to create the index a second time it throws exception even with 'IF NOT EXISTS' clause

Steps to reproduce

The below can be executed on any database from console to reproduce the issue.

`
{hellscreamms_com_GDB}> CREATE VERTEX TYPE Z IF NOT EXISTS;

+---------+------------------+
|NAME |VALUE |
+---------+------------------+
|operation|create vertex type|
|typeName |Z |
+---------+------------------+
Command executed in 584ms
{hellscreamms_com_GDB}> CREATE PROPERTY Z.prop IF NOT EXISTS STRING;

+------------+---------------+
|NAME |VALUE |
+------------+---------------+
|operation |create property|
|typeName |Z |
|propertyName|prop |
+------------+---------------+
Command executed in 31ms
{hellscreamms_com_GDB}> CREATE INDEX IF NOT EXISTS ON Z (prop) UNIQUE;

+------------+------------+
|NAME |VALUE |
+------------+------------+
|operation |create index|
|name |Z[prop] |
|type |LSM_TREE |
|totalIndexed|0 |
+------------+------------+
Command executed in 3826ms
{hellscreamms_com_GDB}> CREATE INDEX IF NOT EXISTS ON Z (prop) UNIQUE;

ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation command (cause: JSONObject[result] not found)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:214)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:466)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:413)
at com.arcadedb.console.Console.executeSQL(Console.java:602)
at com.arcadedb.console.Console.execute(Console.java:273)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.interactiveMode(Console.java:131)
at com.arcadedb.console.Console.execute(Console.java:185)
at com.arcadedb.console.Console.main(Console.java:148)
Caused by: com.arcadedb.serializer.json.JSONException: JSONObject[result] not found
at com.arcadedb.serializer.json.JSONObject.getElement(JSONObject.java:367)
at com.arcadedb.serializer.json.JSONObject.getJSONArray(JSONObject.java:188)
at com.arcadedb.remote.RemoteDatabase.createResultSet(RemoteDatabase.java:493)
at com.arcadedb.remote.RemoteDatabase.lambda$command$3(RemoteDatabase.java:414)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:182)
... 8 more

`
{hellscreamms_com_GDB}>

@gramian
Copy link
Collaborator

gramian commented Nov 6, 2024

Trying from studio (24.11.2-SNAPSHOT), I get no response form the server sending the second CREATE INDEX ... IF NOT EXISTS. From console (24.11.2-SNAPSHOT) I get an empty response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants