-
Notifications
You must be signed in to change notification settings - Fork 871
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
query "select @rid as @rid, name from ouser" returns error #4752
Comments
Hi @Ivanov-Yuriy @ field names are not valid aliases in 2.1, but it's actually quite easy to support. |
What is rather interesting - it works in "old style" with 2.1 too, but only if your database was created in 2.0.X version. |
Hi @a-unite it was made for backward compatibility. Old databases maintain the old behavior (no strict SQL), while newly created dbs have strict validation enabled by default |
@luigidellaquila thank you! This issue with |
not important, only the service field would have the same name always |
@Ivanov-Yuriy Sorry, my suggestion was kind of sarcastic, yours makes sense, while could raise compatibility issues (might be solved with another config parameter introduced, though). @luigidellaquila, @lvca just curious - were there reasons, to strip |
I have similar question about this. I cannot get 'partial' document with But I can get partial document like this: So technically, there's no problem to make partial document as a result. +edited: |
As I understand presence of system field in server answer should tell us, that we have original object (with Anyway, we are going off track here. |
Dear @luigidellaquila, @lvca haven't you come with any decision on the original issue? |
for me very important understand, this behaviour will stay the same and I must change my code or will you change this behaviour? |
@lvca I need your comment on this, there is no technical reason to allow or deny this behavior. |
Look guys, it was strange to have different results for projection and "natural" query before 2.1 Why don't we return field names as is for new (strict) requests mode? I hope we could use that chance to add good sense to the syntax, not vice versa. |
Could you please tell if you are going to come or not with your verdict for this issue anytime soon? |
The right solution is to do whatever it takes to be consistent. Scott |
Scott, |
Hehe...unfortunately, I am not experienced enough with ODB to give specific suggestions. But, I know from my experience with quality management, being consistent is a core part of being professional. From my less experienced ODB perspective, the "@" is the problem. Scott |
Thanks. My thoughts:
Best regards, |
As a workaround, did you try to unset the strictSql property? ALTER DATABASE custom strictSQL=false |
@giastfader, thanks! |
Hi guys, I just pushed a fix on branch 2.1.x, could you please verify that it completely fixes your use case? Thanks Luigi ps. please comment but keep this issue open, I have to port the issue to develop |
Hey Luigi. Thanks for the quick fix. I call that great support. What should we expect to see? Scott |
Hi @smolinari just the fix for the original issue, so the same behavior you had in 2.0. Thanks Luigi |
Hi, @luigidellaquila Looks like it works as previous ( You could close this issue, though, I'm still wander if we need aliasing WBR, Ata |
I use an override of field because i want receive the same result for different queries.
when i use query "select from ouser", I receive RIDs in field "@Rid"
orientdb {db=test}> select from ouser
----+----+------+------+-------------------------------------------------------------------------+------+-----
| @Rid| @ CLASS|name |password |status|roles
----+----+------+------+-------------------------------------------------------------------------+------+-----
0 |#5:0|OUser |admin |{SHA-256}8C6976E5B5410.....415BDE90|ACTIVE|[1]
1 |#5:1|OUser |reader|{SHA-256}3D0941964AA3EBDCB00CCE....D5AEC7F31090A0FB30|ACTIVE|[1]
2 |#5:2|OUser |writer|{SHA-256}B93006774CBDD4B299389A03...11A909FBA5|ACTIVE|[1]
----+----+------+------+-------------------------------------------------------------------------+------+-----
3 item(s) found. Query executed in 0.008 sec(s).
but if I use query with projections, I receive RIDs in field "RID"
orientdb {db=test}> select @Rid, name from ouser
----+------+----+------
| @ CLASS| rid |name
----+------+----+------
0 |null |#5:0|admin
1 |null |#5:1|reader
2 |null |#5:2|writer
----+------+----+------
3 item(s) found. Query executed in 0.006 sec(s).
so I use override of the field to get a similar result
orientdb {db=test}> select @Rid as @Rid, name from ouser
----+----+------+------
| @Rid| @ CLASS|name
----+----+------+------
0 |#5:0|OUser |admin
1 |#5:1|OUser |reader
2 |#5:2|OUser |writer
----+----+------+------
3 item(s) found. Query executed in 0.005 sec(s).
the top code worked in version 2.0.13 but in version 2.1.0 the query "select @Rid as @Rid, name from ouser" returns error
orientdb {db=test}> select @Rid as @Rid, name from ouser
Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #0: Encountered " <RECORD_ATTRIBUTE> "@
rid "" at line 1, column 16.
Was expecting one of:
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
"
" ... "
" ..."`" ...
The text was updated successfully, but these errors were encountered: