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

coalesce function should return value for $value.field #8671

Closed
grzegorz-aniol opened this issue Nov 20, 2018 · 2 comments
Closed

coalesce function should return value for $value.field #8671

grzegorz-aniol opened this issue Nov 20, 2018 · 2 comments
Assignees
Labels
Milestone

Comments

@grzegorz-aniol
Copy link

OrientDB Version: 3.0.9

Java Version: 1.8

OS: Windows 10

Expected behavior

coalesce function should properly identify not null value referenced as $profile.Name

Actual behavior

The function returns last argument(i.e. 'Unknown') even when first argument is not null

image

Steps to reproduce

Run following query on demo database:

select @rid, @class, Phone, OrderedId,
  $profile.Name,
  coalesce($profile.Name, 'Unknown')
from Customers
let $profile = out('HasProfile')[0]
@pedroteixeira
Copy link

I noticed that it gives expected result if using this syntax:

select @rid, @class, Phone, OrderedId, coalesce(out('HasProfile')[0].Name, 'Unknown') from Customers

@luigidellaquila luigidellaquila self-assigned this Nov 22, 2018
luigidellaquila added a commit that referenced this issue Nov 22, 2018
@luigidellaquila
Copy link
Member

Hi @grzegorz-aniol

I just pushed a fix for this problem, it will be released with v 3.0.12

Thanks

Luigi

@luigidellaquila luigidellaquila added this to the 3.0.12 milestone Nov 22, 2018
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

3 participants