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

Problem with SQl Where IN clause and subselect #8745

Closed
EricSchreiner opened this issue Jan 29, 2019 · 11 comments
Closed

Problem with SQl Where IN clause and subselect #8745

EricSchreiner opened this issue Jan 29, 2019 · 11 comments
Assignees
Labels
Milestone

Comments

@EricSchreiner
Copy link

EricSchreiner commented Jan 29, 2019

OrientDB Version: 3.0.14

Java Version: 1.8.x

OS: Windows

Expected behavior

See attached Screenshot from Orientdb studio

Actual behavior

See attached Screenshot from Orientdb studio

Steps to reproduce

See attached Screenshot from Orientdb studio

select

@luigidellaquila luigidellaquila self-assigned this Jan 31, 2019
@luigidellaquila
Copy link
Member

Hi @EricSchreiner

The first query doesn't work because you are matching a key with a pair key, rid.
If you change it as follows it will work fine

SELECT key, rid from index... where key in (select key from index...)

Thanks

Luigi

@EricSchreiner
Copy link
Author

Hi @luigidellaquila
(I would reopen but it seems I'm not allowed to.) I've tried a lot of different solutions but it seems to be a bug. See Screenshot below with your suggestion....
select-2

@luigidellaquila
Copy link
Member

Hi @EricSchreiner

I tried it with DemoDB on v 3.0.14 and it seems to work fine, maybe it's already fixed. Could you please try your dataset on latest stable?

Thanks

Luigi

@EricSchreiner
Copy link
Author

Hi @luigidellaquila my example was already running on 3.0.14

@EricSchreiner
Copy link
Author

Hi @luigidellaquila
for you information: It works fine when i use a static list of keys in the IN clause instead of a select....

@EricSchreiner EricSchreiner changed the title Problem with SQl Where IN clause and subselectz Problem with SQl Where IN clause and subselect Feb 1, 2019
@luigidellaquila
Copy link
Member

Hi @EricSchreiner

Can you please give me more details on how to reproduce?
I tried the following on DemoDB and the result is as expected

select from index:Countries.Id where key in (select key from index:Countries.Id where key = 1)

What is different in your case?

Thanks

Luigi

@EricSchreiner
Copy link
Author

Hi @luigidellaquila ,
my key is OType.STRING and duplicates are allowed (INDEX_TYPE.NOTUNIQUE)

@luigidellaquila
Copy link
Member

Hi @EricSchreiner

Thank you very much, I managed to reproduce the problem. I'll try to fix it ASAP

I'll keep you updated

Thanks

Luigi

@EricSchreiner
Copy link
Author

HI @luigidellaquila
thanks....

luigidellaquila added a commit that referenced this issue Feb 4, 2019
@luigidellaquila
Copy link
Member

Hi @EricSchreiner

I just pushed a fix, it will be in the snapshot in a few minutes and will be released with v 3.0.15

Thanks

Luigi

@luigidellaquila luigidellaquila added this to the 3.0.15 milestone Feb 4, 2019
@EricSchreiner
Copy link
Author

Hi @luigidellaquila
thanks....

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