From 8d40fa58edab227caa66c3977a7efe3f0fc5876f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 12:45:27 -0700 Subject: [PATCH] Post-merge fix. --- mysql-test/r/row.result | 6 ++++++ sql/item_cmpfunc.cc | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 3a8ab6b8346..bb9e2109f0f 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -193,6 +193,12 @@ SELECT ROW(2,1) IN (ROW(21,2),ROW(ROW(1,1,3),0)); ERROR 21000: Operand should contain 1 column(s) SELECT ROW(2,1) IN (ROW(ROW(1,1,3),0),ROW(21,2)); ERROR 21000: Operand should contain 1 column(s) +SELECT ROW(1,1,1) = ROW(1,1,1) as `1`, ROW(1,1,1) = ROW(1,2,1) as `0`, ROW(1,NULL,1) = ROW(2,2,1) as `0`, ROW(1,NULL,1) = ROW(1,2,2) as `0`, ROW(1,NULL,1) = ROW(1,2,1) as `null` ; +1 0 0 0 null +1 0 0 0 NULL +select row(NULL,1)=(2,0); +row(NULL,1)=(2,0) +0 CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b)); INSERT INTO t1 VALUES (1,1), (2,1), (3,1), (1,2), (3,2), (3,3); EXPLAIN SELECT * FROM t1 WHERE a=3 AND b=2; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 071762419fc..f9844f6d36e 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -95,9 +95,9 @@ static int cmp_row_type(Item* item1, Item* item2) return 1; for (uint i=0; iel(i)->check_cols(item1->el(i)->cols()) || - (item1->el(i)->result_type() == ROW_RESULT && - cmp_row_type(item1->el(i), item2->el(i)))) + if (item2->element_index(i)->check_cols(item1->element_index(i)->cols()) || + (item1->element_index(i)->result_type() == ROW_RESULT && + cmp_row_type(item1->element_index(i), item2->element_index(i)))) return 1; } return 0;