Bug #11142 | NULLIF() didn't work in where clause | ||
---|---|---|---|
Submitted: | 7 Jun 2005 16:12 | Modified: | 24 Jun 2005 17:29 |
Reporter: | Miguel Solorzano | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 4.1.XX BK Source | OS: | Linux (Linux) |
Assigned to: | Igor Babaev | CPU Architecture: | Any |
[7 Jun 2005 16:12]
Miguel Solorzano
[13 Jun 2005 18:20]
Igor Babaev
This bug was analyzed by Alexander Ivanov. Here's his report: The cause of the bug is incorrect behavior of the Item_func_nullif::is_null() function (file: sql\item_cmpfunc.cpp) -- if args[0] and args[1] are different the function simply returns 0 though in this case it must check the null_value of args[0]. Alexander also prepared a patch to fix this bug.
[13 Jun 2005 18:24]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/25944
[13 Jun 2005 18:38]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/25945
[15 Jun 2005 10:38]
Igor Babaev
ChangeSet 1.2292 05/06/13 11:24:26 igor@igor-inspiron.creware.com +3 -0 func_if.result, func_if.test: Added a test case for bug #11142. item_cmpfunc.cc: Fixed bug #11142. Implementation of Item_func_nullif::is_null was corrected. (see also the correction in 1.2293) The fix will appear in 4.1.13 and 5.0.8.
[24 Jun 2005 17:29]
Mike Hillyer
Documented in 5.0.8 and 4.1.13 changelogs: <listitem><para> <literal>NULLIF()</literal> function could produce incorrect results if first argument is <literal>NULL</literal>. (Bug #11142) </para></listitem>