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

Batch sql scripts still do not work with console #8627

Closed
mbhulin opened this issue Oct 26, 2018 · 1 comment
Closed

Batch sql scripts still do not work with console #8627

mbhulin opened this issue Oct 26, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@mbhulin
Copy link

mbhulin commented Oct 26, 2018

OrientDB Version: 3.0.8

Java Version:

OS: Windows 10

Expected behavior (using version 2.2.27)

orientdb {db=demodb}> load script "C:/mh/tmp/demodbSqlScriptTest.txt"

Loading script C:/mh/tmp/demodbSqlScriptTest.txt...[Started multi-line command. Type just 'end' to finish and execute]

orientdb {db=demodb}> script sql begin; let v1 = create vertex V set Name = "Source", Id = 1; let v2 = create vertex V set Name = "Destination", Id = 2; create edge E from $v1 to $v2; commit;

+----+-----+------+----+-----+
|# |@Rid |@Class|out |in |
+----+-----+------+----+-----+
|0 |#13:0|E |#9:0|#10:0|
+----+-----+------+----+-----+
Server side script executed in 0,203000 sec(s). Returned 1 records
orientdb {db=demodb}>

Actual behavior with 3.0.8

<orientdb {db=demodb}> load script C:\mh\tmp\demodbSqlScriptTest.txt

Loading script C:\mh\tmp\demodbSqlScriptTest.txt...[Started multi-line command. Type just 'end' to finish and execute]

Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error parsing query:

^
Encountered " "begin "" at line 1, column 1.
Was expecting one of:
<WHILE> ...
<IF> ...
<FOREACH> ...
";" ...

DB name="demodb"
Error Code="1"

Loaded script C:\mh\tmp\demodbSqlScriptTest.txt
orientdb {db=demodb}>

Steps to reproduce

Content of sql script file:
script sql;
begin;
let v1 = create vertex V set Name = "Source", Id = 1;
let v2 = create vertex V set Name = "Destination", Id = 2;
create edge E from $v1 to $v2;
commit;
end;

@luigidellaquila
Copy link
Member

Hi @mbhulin

I just pushed a fix that solves this problem. It will be released with v 3.0.11

Thanks

Luigi

@luigidellaquila luigidellaquila added this to the 3.0.11 milestone Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants