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

Cannot create an Edge from and to the same Vertex #1311

Closed
morkai opened this issue Jan 26, 2013 · 7 comments
Closed

Cannot create an Edge from and to the same Vertex #1311

morkai opened this issue Jan 26, 2013 · 7 comments
Assignees
Milestone

Comments

@morkai
Copy link

morkai commented Jan 26, 2013

Tested on 1.3.0 and 1.4.0-SNAPSHOT from 2013-01-24.

The following SQL:

CREATE VERTEX OGraphVertex
CREATE EDGE OGraphEdge FROM #8:0 TO #8:0

fails with the following error:

Error: com.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot UPDATE the record #8:0 because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v1 your=v0)

The edge is created but without the in/out properties. SELECT FROM #9:0 returns:

{
  "result": [{
      "@type": "d", "@rid": "#9:0", "@version": 0
    }
  ]
}

(selecting/deleting all edges won't include/delete this one) and the RID of #9:0 is added to the out property of the vertex.

Creating an edge from and to the same vertex using INSERT and UPDATE works:

INSERT INTO OGraphVertex
INSERT INTO OGraphEdge SET out=#8:0, in=#8:0
UPDATE #8:0 ADD out = #9:0
UPDATE #8:0 ADD in = #9:0

btw. update #8:0 add out=#9:0 doesn't work:

Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #19: Found unexpected keyword '=#9:0' while it was expected '[=]'. Use UPDATE <class>|cluster:<cluster>> [SET|ADD|PUT|REMOVE|INCREMENT] [[,] <field-name> = <expression>|<sub-command>]* [WHERE <conditions>]
Command: update #8:0 add out=#9:0
---------------------------^

Add a space before and after the = and it works (while spaces or no spaces in INSERT is OK).

@lvca
Copy link
Member

lvca commented May 16, 2013

Use the create vertex and create edge commands to work with graph elements.

@ghost ghost assigned lvca May 16, 2013
@morkai
Copy link
Author

morkai commented May 16, 2013

create vertex and create edge commands do not work in this case (insert and update do). That's the issue.

@lvca
Copy link
Member

lvca commented May 16, 2013

What does man "do not work"? Exceptions? Crash? Edge/Vertex not created?

@morkai
Copy link
Author

morkai commented May 16, 2013

As I wrote before:

Error: com.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot UPDATE the record #8:0 because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v1 your=v0)

@lvca
Copy link
Member

lvca commented May 16, 2013

OK, let me create a test case

@lvca
Copy link
Member

lvca commented Jul 25, 2013

Postponed.

@lvca lvca removed invalid labels Aug 28, 2014
@lvca lvca modified the milestones: 2.0rc1, 2.0rc2 Aug 28, 2014
@lvca lvca added the bug label Aug 28, 2014
@lvca
Copy link
Member

lvca commented Sep 22, 2014

Already fixed in 1.7.9

@lvca lvca closed this as completed Sep 22, 2014
@lvca lvca modified the milestones: 1.7.9, 2.0-M2 Sep 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants