Commit 6f0a6260 authored by unknown's avatar unknown
Browse files

subselect.test, subselect.result:

  Added a test case for bug #12392.
item_cmpfunc.cc:
  Fixed bug #12392.
  Missing handling of rows containing NULL components
  when evaluating IN predicates caused a crash.


sql/item_cmpfunc.cc:
  Fixed bug #12392.
  Missing handling of rows containing NULL components
  when evaluating IN predicates caused a crash.
mysql-test/r/subselect.result:
  Added a test case for bug #12392.
mysql-test/t/subselect.test:
  Added a test case for bug #12392.
parent e6301003
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2742,3 +2742,9 @@ one two flag
5	6	N
7	8	N
DROP TABLE t1,t2;
CREATE TABLE t1 (a char(5), b char(5));
INSERT INTO t1 VALUES (NULL,'aaa'), ('aaa','aaa');
SELECT * FROM t1 WHERE (a,b) IN (('aaa','aaa'), ('aaa','bbb'));
a	b
aaa	aaa
DROP TABLE t1;
+11 −0
Original line number Diff line number Diff line
@@ -1770,4 +1770,15 @@ SELECT * FROM t1

DROP TABLE t1,t2;

#
# Bug #12392: where cond with IN predicate for rows and NULL values in table 
#

CREATE TABLE t1 (a char(5), b char(5));
INSERT INTO t1 VALUES (NULL,'aaa'), ('aaa','aaa');

SELECT * FROM t1 WHERE (a,b) IN (('aaa','aaa'), ('aaa','bbb'));

DROP TABLE t1;

# End of 4.1 tests
+2 −0
Original line number Diff line number Diff line
@@ -1551,6 +1551,8 @@ in_row::~in_row()
byte *in_row::get_value(Item *item)
{
  tmp.store_value(item);
  if (item->is_null())
    return 0;
  return (byte *)&tmp;
}