Skip to content

Console LOAD command does not parse comments in OSQL script files correctly #1422

Description

@ironluca

client-platform-base-db-schema.txt
Parsing of comments from script files loaded with "load" command from 'console.sh' is not correct, it takes the comments as OSQL statements and generates exception (as highlighted below). The script part executes perfectly and creates the necessary vertex and edge types.

The above is not a show stopper as the script part executes fine.

`{test_db}> /*The vertex class that represents a generalized root or conceptual staring point of a graph
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation /*The vertex class that represents a generalized root or conceptual staring point of a graph (cause:com.arcadedb.query.sql.parser.TokenMgrError detail:Lexical error at line 1, column 93. Encountered: after : "")
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
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.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
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)

{test_db}> (graphs don't have a starting point, this is just a conceptual start vertex for complete graph traversal).
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation (graphs don't have a starting point, this is just a conceptual start vertex for complete graph traversal). (cause:com.arcadedb.query.sql.parser.ParseException detail:Encountered "(" "(" at line 1, column 1. Was expecting one of: ... ... )
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
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.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
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)

{test_db}>
{test_db}> Usually two objects of this class will be created, one sits at the top of the hierarchy of the
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation Usually two objects of this class will be created, one sits at the top of the hierarchy of the (cause:com.arcadedb.query.sql.parser.ParseException detail:Encountered "Usually" at line 1, column 1. Was expecting one of: ... ... )
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
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.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
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)

{test_db}> ontology def model and another at the top of the hierarchy of the ontology data model.
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation ontology def model and another at the top of the hierarchy of the ontology data model. (cause:com.arcadedb.query.sql.parser.ParseException detail:Encountered "ontology" at line 1, column 1. Was expecting one of: ... ... )
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
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.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
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)

{test_db}>
{test_db}> In addition, this class can be used by applications to declare conceptual application root vertices
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation In addition, this class can be used by applications to declare conceptual application root vertices (cause:com.arcadedb.query.sql.parser.ParseException detail:Encountered "In" at line 1, column 1. Was expecting one of: ... ... )
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
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.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
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)

{test_db}> in the data model. The name property of this class are unique and cannot be repeated.
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation in the data model. The name property of this class are unique and cannot be repeated. (cause:com.arcadedb.query.sql.parser.ParseException detail:Encountered "in" at line 1, column 1. Was expecting one of: ... ... )
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
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.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
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)

{test_db}> /
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation / (cause:com.arcadedb.query.sql.parser.ParseException detail:Encountered "" "
" at line 1, column 1. Was expecting one of: ... ... )
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
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.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
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)

{test_db}> CREATE VERTEX TYPE GeneralizedInformationRoot IF NOT EXISTS
+---------+--------------------------+
|NAME |VALUE |
+---------+--------------------------+
|operation|create vertex type |
|typeName |GeneralizedInformationRoot|
+---------+--------------------------+
Command executed in 84ms
{test_db}>
{test_db}> CREATE PROPERTY GeneralizedInformationRoot.uniqueId IF NOT EXISTS STRING (MANDATORY TRUE, DEFAULT "uuid()", READONLY TRUE, NOTNULL TRUE)
+------------+--------------------------+
|NAME |VALUE |
+------------+--------------------------+
|operation |create property |
|typeName |GeneralizedInformationRoot|
|propertyName|uniqueId |
|MANDATORY |true |
|DEFAULT |uuid() |
|READONLY |true |
|NOTNULL |true |
+------------+--------------------------+
Command executed in 45ms
`

Actual behavior

<add here>

Steps to reproduce

<add here>

<An SQL script to reproduce the problem or a JUnit test case will increase **A LOT** the chance to have a quick fix>

Activity

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

Metadata

Metadata

Assignees

Labels

wontfixThis will not be worked on

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions