Skip to content

Fixed is operator for undefined value - #8478

Closed
andrew-aladev wants to merge 1 commit into
sequelize:masterfrom
andrew-aladev:master
Closed

andrew-aladev wants to merge 1 commit into
sequelize:masterfrom
andrew-aladev:master

Conversation

@andrew-aladev

Copy link
Copy Markdown

Closes #8476. It is a small pr that fixes is operator for undefined value.

@codecov

codecov Bot commented Oct 13, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #8478 into master will not change coverage.
The diff coverage is 100%.

@sushantdhiman

Copy link
Copy Markdown
Contributor

Hmm I am not sure if undefined should be treated as null, I think it should not. If you want to compare against IS NULL do something like this yourField = yourField || null, rather than this implicit conversion you are suggesting.

@sequelize/orm

@janmeier

Copy link
Copy Markdown
Member

Agreed, I don't think undefined should be coerced to null.

However the current behavior is not exactly intuitive either. Not sure what should happen here. Throwing on unexpected input would require a major

@eseliger

Copy link
Copy Markdown
Member

Agree, too. This is dangerously

@Alexsey

Alexsey commented Apr 25, 2018

Copy link
Copy Markdown
Contributor

Maybe now, when v5 is in Beta is the right moment to fix it with some breaking change? Because the generation of a request with = NULL just makes no sense

@Alexsey

Alexsey commented Apr 25, 2018 •

Copy link
Copy Markdown
Contributor

BTW here #8583 people are complaining about the behavior that is proposed in this PR. But now I can see that for SQL Servier and for MySQL it creates = NULL. May it be that we have different behavior for different dialects?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid syntax for undefined value

5 participants