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

Translate to NULLIF #31682

Open
roji opened this issue Sep 11, 2023 · 2 comments · May be fixed by #35327
Open

Translate to NULLIF #31682

roji opened this issue Sep 11, 2023 · 2 comments · May be fixed by #35327
Assignees
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Milestone

Comments

@roji
Copy link
Member

roji commented Sep 11, 2023

All relational database support, NULLIF, which is the inverse of COALESCE: NULLIF(value, '(none)') returns null if value is (none), otherwise the value is returned

Database Functions
PostgreSQL NULLIF
MySQL NULLIF
MariaDB NULLIF
SQLite NULLIF
SQL Server NULLIF
Oracle NULLIF
@bricelam
Copy link
Contributor

Oh funny, I thought I already filed an issue for this. It turns out it was just a comment. #16092 (comment)

@ajcvickers ajcvickers added this to the Backlog milestone Sep 22, 2023
@roji roji self-assigned this Dec 13, 2024
@roji roji modified the milestones: Backlog, 10.0.0 Dec 13, 2024
roji added a commit to roji/efcore that referenced this issue Dec 13, 2024
@roji roji linked a pull request Dec 13, 2024 that will close this issue
@roji roji added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Dec 13, 2024
roji added a commit to roji/efcore that referenced this issue Dec 13, 2024
roji added a commit to roji/efcore that referenced this issue Dec 13, 2024
@roji
Copy link
Member Author

roji commented Dec 13, 2024

One nice effect of this lifting (a == b ? null : a -> NULLIF(a, b)) is that it eliminates duplicate expression evaluation (a), which, if the expression is complex/expensive (e.g. a subquery), could be quite impactful for perf.

roji added a commit to roji/efcore that referenced this issue Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants