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

OrientDB 3 sql script error #8305

Closed
mdre opened this issue Jun 4, 2018 · 3 comments
Closed

OrientDB 3 sql script error #8305

mdre opened this issue Jun 4, 2018 · 3 comments
Assignees
Milestone

Comments

@mdre
Copy link

mdre commented Jun 4, 2018

OrientDB Version: 3.0.1

Java Version: 1.8.151

OS: Kubuntu 18.04

I'am migrating from ODB 2.2.29 to 3.0.1 and I find an error that I have not been able to understand. I have a class called 'EdgeAttrib'. The class does not exist yet in the DB. Now consider this code:
let exist = select from (select expand(classes) from metadata:schema) where name = 'EdgeAttrib'; if ($exist.size()>0) { delete vertex EdgeAttrib; drop class EdgeAttrib; }

Expected behavior

If the class exist, it should delete all vertex and drop it.
If not exist, do nothing.

Actual behavior

` com.orientechnologies.orient.core.exception.OCommandExecutionException: Class not found: EdgeAttrib DB name="Test"

That happend when try to execute the "delete vertex" line, but the class does not exist so it should never run that line. I run this code in the ODB Studio.
`

work well in 2.2.29 and fail in 3.0.1.

@luigidellaquila luigidellaquila self-assigned this Jun 8, 2018
@luigidellaquila
Copy link
Member

Hi @mdre

I got the problem, in v 3.0 there is a check for class existence during the execution planning (so before the IF condition is executed).

I'll try to see if we can postpone this check

Thanks

Luigi

@luigidellaquila
Copy link
Member

Hi @mdre

I just pushed a fix, now it should work fine. This fix will be released with v 3.0.3, the snapshot will be available on Sonatype repos in a few minutes

Thanks

Luigi

@luigidellaquila luigidellaquila added this to the 3.0.3 milestone Jun 11, 2018
@mdre
Copy link
Author

mdre commented Jun 11, 2018

Thanks Luigi.

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

No branches or pull requests

2 participants