Console Error on Attempt to Create an Index that Exists even with IF NOT EXISTS Clause
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}>
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.
More info: the error above happens for remote connections from the console. For local connections an empty response is given.
This seems NOT to be fixed by the latest changes.