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

SQL subquery is not support in 3.0.x ? #8528

Closed
lightjiao opened this issue Sep 12, 2018 · 3 comments
Closed

SQL subquery is not support in 3.0.x ? #8528

lightjiao opened this issue Sep 12, 2018 · 3 comments
Assignees
Labels
Milestone

Comments

@lightjiao
Copy link

lightjiao commented Sep 12, 2018

OrientDB Version: 3.0.5

Java Version: 1.8

OS: Centos 6.8

SQL

select * 
from v_test_1
where  id in ( select in('e_test').id from v_test_2 where name = 'jack' )

Expected behavior

return v_test_1 which related v_test_2's name = 'jack'

Actual behavior

return 0 records
BUT, the sql below work fine, and must use $refs[0].refs_id, and $refs.refs_id don't work

select * 
from v_test_1
let $refs = ( select in('e_test').id as refs_id from v_test_2 where name = 'jack' ) 
where where  id in  $refs[0].`refs_id`

this sql syntax is very important for us, and if we change to let, it would be a very big change
is a bug ? or is a deprecated feature ?

thanks reading

@luigidellaquila luigidellaquila self-assigned this Sep 12, 2018
@luigidellaquila
Copy link
Member

Hi @lightjiao

It's supposed to work, probably it just needs a little addition in a comparator.
I'll work on it asap and let you know

Thanks

Luigi

luigidellaquila added a commit that referenced this issue Sep 12, 2018
@luigidellaquila
Copy link
Member

Hi @lightjiao

I tested it with v 3.0.7, the problem was already fixed for basic cases.
There was still an issue when the parent query used an index, I fixed it and pushed to 3.0.x. It will be released with v 3.0.8

Thanks

Luigi

@luigidellaquila luigidellaquila added this to the 3.0.8 milestone Sep 12, 2018
luigidellaquila added a commit that referenced this issue Sep 12, 2018
@lightjiao
Copy link
Author

I check this on the develop snapshot, it work fine.
Looking forward to the release of 3.0.8

Thanks very much. 👍

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