summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2003-03-10 20:54:18 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2003-03-10 20:54:18 +0200
commitbbc8f836c0400f361458bffd42d71ea2177a9e18 (patch)
tree2d9fa4d526063ce45cfbf193b270d14ddedf4fea
parent462a72b80246c09304f140675f6dd80cb3a20826 (diff)
downloadmariadb-git-bbc8f836c0400f361458bffd42d71ea2177a9e18.tar.gz
Fix for a bug with ROW(..) <=> ROW(...)
-rw-r--r--mysql-test/r/row.result6
-rw-r--r--mysql-test/t/row.test2
-rw-r--r--sql/item_cmpfunc.cc5
3 files changed, 10 insertions, 3 deletions
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index 40beeb4d3a5..79eb6cc7e59 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -159,3 +159,9 @@ a MAX(b) (1, MAX(b)) = (1, 4)
1 4 1
10 43 0
drop table t1;
+SELECT ROW(2,10) <=> ROW(3,4);
+ROW(2,10) <=> ROW(3,4)
+0
+SELECT ROW(NULL,10) <=> ROW(3,NULL);
+ROW(NULL,10) <=> ROW(3,NULL)
+0
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test
index 9d69e56f9ee..fb5fff86b11 100644
--- a/mysql-test/t/row.test
+++ b/mysql-test/t/row.test
@@ -79,3 +79,5 @@ insert into t1 values (10, 43);
insert into t1 values (1, 4);
select a, MAX(b), (1, MAX(b)) = (1, 4) from t1 group by a;
drop table t1;
+SELECT ROW(2,10) <=> ROW(3,4);
+SELECT ROW(NULL,10) <=> ROW(3,NULL);
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index ec3c7f22556..40640ccee9c 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -266,8 +266,8 @@ int Arg_comparator::compare_e_row()
uint n= (*a)->cols();
for (uint i= 0; i<n; i++)
{
- if ((res= comparators[i].compare()))
- return 1;
+ if ((res= !comparators[i].compare()))
+ return 0;
}
return 1;
}
@@ -352,7 +352,6 @@ void Item_func_equal::fix_length_and_dec()
{
Item_bool_func2::fix_length_and_dec();
maybe_null=null_value=0;
- set_cmp_func();
}
longlong Item_func_equal::val_int()