summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorSergey Petrunia <sergefp@mysql.com>2009-01-28 22:18:27 +0300
committerSergey Petrunia <sergefp@mysql.com>2009-01-28 22:18:27 +0300
commita9608b196d2675f790079009d7b2ca4d80a93dbc (patch)
tree6369b89ac1c82125274f18afb9eba6c01d40a6dc /sql/item_cmpfunc.cc
parentda8df39c14581f32f9004430336999011c96b33c (diff)
downloadmariadb-git-a9608b196d2675f790079009d7b2ca4d80a93dbc.tar.gz
BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result
Item_in_optimizer::is_null() evaluated "NULL IN (SELECT ...)" to NULL regardless of whether subquery produced any records, this was a documented limitation. The limitation has been removed (see bugs 8804, 24085, 24127) now Item_in_optimizer::val_int() correctly handles all cases with NULLs. Make Item_in_optimizer::is_null() invoke val_int() to return correct values for "NULL IN (SELECT ...)". mysql-test/r/subselect.result: BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result - Testcase mysql-test/t/subselect.test: BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result - Testcase
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 813e50e0693..bd90dd81365 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1623,8 +1623,8 @@ void Item_in_optimizer::cleanup()
bool Item_in_optimizer::is_null()
{
- cache->store(args[0]);
- return (null_value= (cache->null_value || args[1]->is_null()));
+ val_int();
+ return null_value;
}