You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@mccabemj I think @rodic is using Op.eq for his system. He is right about the bug where Op.is translates to IS NOT in SQL statement, which is incorrect.
@rodic I am actually able to recreate the issue and I think its a bug. Line 2392 of /sequelize/lib/dialects/abstract/query-generator.js
I believe that should be } else if (value === null && comparator === this.OperatorMap[Op.ne]) {
At the moment its evaluating that Op.ne is in the OperatorMap (which it obviously is) so using this.OperatorMap[Op.not]. It then never gets to line 2396 to use the IS.
I'm new to GitHub, but I am actively trying to get involved, so would like to do a pull request if people confirm the bug.
@iamjoyce@mccabemj hey guys, sorry for the confusion. Op.is is buggy, I just pointed out that I'm using Op.eq as an alternative (as @iamjoyce proposed).
@mccabemj having && this.OperatorMap[Op.ne]) looks buggy indeed. thanks for looking into this.
Activity
iamjoyce commentedon Dec 26, 2017
FYI, You can use
completedAt: { [Op.eq]: null }to get"completedAt" IS NULLrodic commentedon Dec 26, 2017
hi @iamjoyce thanks. yes, i'm using that.
mccabemj commentedon Jan 3, 2018
@rodic no you are not. You are using
Op.is. UseOp.eqfor equal.iamjoyce commentedon Jan 3, 2018
@mccabemj I think @rodic is using
Op.eqfor his system. He is right about the bug whereOp.istranslates toIS NOTin SQL statement, which is incorrect.mccabemj commentedon Jan 3, 2018
@iamjoyce sorry, I misunderstood the issue.
@rodic I am actually able to recreate the issue and I think its a bug. Line 2392 of /sequelize/lib/dialects/abstract/query-generator.js
I believe that should be
} else if (value === null && comparator === this.OperatorMap[Op.ne]) {At the moment its evaluating that
Op.neis in theOperatorMap(which it obviously is) so usingthis.OperatorMap[Op.not]. It then never gets to line 2396 to use theIS.I'm new to GitHub, but I am actively trying to get involved, so would like to do a pull request if people confirm the bug.
rodic commentedon Jan 3, 2018
@iamjoyce @mccabemj hey guys, sorry for the confusion.
Op.isis buggy, I just pointed out that I'm usingOp.eqas an alternative (as @iamjoyce proposed).@mccabemj having
&& this.OperatorMap[Op.ne])looks buggy indeed. thanks for looking into this.fix(query-generator): Op.ne check with null value is not comparing wi…
mccabemj commentedon Jan 4, 2018
Added pull request to fix this - #8835
fix(query-generator): Op.ne check with null value is not comparing wi…
sushantdhiman commentedon Jan 4, 2018
Fixed by 3397b23