orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

[2.0-M2] regression in fetchplan when depth-level is set to 1

Open giastfader opened this issue 12 years ago • 6 comments

Hi, I don't know if this is a bug or a feature: I have a record that has some links to other records belonging to a class that extends ORestricted. When I executed a statement like:

select @this.tojson("fetchPlan:visibleByFriends:1,indent:0") from _bb_user

I have different results between OrientDB 1.7.x and OrientDB 2.0-M2 If the user that is actually executing the statement does not have the right to read the visibleByFriends property, the 1.7.x version returns a JSON similar to:

{"visibleByTheUser":null}

the 2.0-M2 returns the RID of the linked record:

{"visibleByTheUser":"#14:31"}

giastfader avatar Oct 09 '14 21:10 giastfader

I digged a little more. It seems that the problem is not strictly related to records of ORestricted class, but it affects any serialization made using fetchPlan:*:1 As the matter of fact, according with the documentation ( http://www.orientechnologies.com/docs/last/orientdb.wiki/Fetching-Strategies.html ), a depth-level set to 1 should expand the first connected record:

depth-level, is the deep level requested:
0 = Load only current record,
1-N = load only the first-Nth connected record,
-1 = unlimited,
-2 = exclude it

but fields are not properly expanded if depth-level is set to 1. Into the returned string there is only the RID

giastfader avatar Oct 10 '14 07:10 giastfader

Hi guys, I verified that this problem occurs even with 1.7.10 when the 1st level cache is active.

I suppose that the issue is strictly bound to somewhat related with the internal cache system.

giastfader avatar Dec 30 '14 14:12 giastfader

still present in 2.0.7

giastfader avatar Apr 20 '15 06:04 giastfader

@giastfader Please could you provide a test case that reproduce this problem?

lvca avatar Apr 20 '15 11:04 lvca

The issue has been closed because no response has been received after a while. In case the issue is still valid, please reopen it or write a comment that explains why it's still valid and a way to reproduce it. Thank you.

lvca avatar Sep 22 '15 16:09 lvca

Hi guys, sorry, I missed the reply.

The issue is still valid, for me, against 2.1.2 GA Community Edition. Here are the steps to reproduce the problem:

connect plocal:/databases/test_issue_2906 admin admin
create class _bb_user
create class _BB_UserAttributes extends ORestricted
create property _BB_User.visibleByAnonymousUsers link _BB_UserAttributes
insert into _BB_UserAttributes set email = "[email protected]"
insert into _bb_user set _author="me", visibleByAnonymousUsers = #13:0 --<-- according to the output of the previous statement

connect plocal:/databases/test_issue_2906 reader reader  --<--- reconnect with a low-privilege user
select @this.tojson("fetchPlan:visibleByAnonymousUsers:1,indent:0") from _bb_user

OrientDB 1.7.9:

{"_author":"me","visibleByAnonymousUsers":null}

OrientDB 2.1.2:

{"visibleByAnonymousUsers":"#13:0","_author":"me"}

giastfader avatar Sep 22 '15 20:09 giastfader