summaryrefslogtreecommitdiff
path: root/mysql-test/r/row.result
diff options
context:
space:
mode:
authorunknown <gshchepa/uchum@gshchepa.loc>2007-04-20 15:14:09 +0500
committerunknown <gshchepa/uchum@gshchepa.loc>2007-04-20 15:14:09 +0500
commita8f639fccc19ef80d67c52e698bf6366fdcf6f94 (patch)
tree6383a76b0ed8fd01a6c60da7807976b0f22d3f6f /mysql-test/r/row.result
parent78c734b0132fbd53ff033eada5a9664919370739 (diff)
downloadmariadb-git-a8f639fccc19ef80d67c52e698bf6366fdcf6f94.tar.gz
Bug#27704: incorrect comparison of rows with NULL components
Support for NULL components was incomplete for row comparison, fixed. Added support for abort_on_null at compare_row() like in 5.x sql/item_cmpfunc.h: Bug#27704: incorrect comparison of rows with NULL components Added support for abort_on_null at Item_bool_func2 like in 5.x sql/item_cmpfunc.cc: Bug#27704: incorrect comparison of rows with NULL components Support for NULL components was incomplete for row comparison, fixed. Added support for abort_on_null at compare_row() like in 5.x mysql-test/t/row.test: Test case updated for Bug#27704 (incorrect comparison of rows with NULL components) mysql-test/r/row.result: Test case updated for Bug#27704 (incorrect comparison of rows with NULL components) mysql-test/r/subselect.result: Test case updated for Bug#27704 (incorrect comparison of rows with NULL components)
Diffstat (limited to 'mysql-test/r/row.result')
-rw-r--r--mysql-test/r/row.result99
1 files changed, 98 insertions, 1 deletions
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index 1c1c4809f36..6169619712b 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -53,7 +53,7 @@ SELECT (1,2,3)=(1,NULL,3);
NULL
SELECT (1,2,3)=(1,NULL,0);
(1,2,3)=(1,NULL,0)
-NULL
+0
SELECT ROW(1,2,3)=ROW(1,2,3);
ROW(1,2,3)=ROW(1,2,3)
1
@@ -188,3 +188,100 @@ 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)
+CREATE TABLE t1(a int, b int, c int);
+INSERT INTO t1 VALUES (1, 2, 3),
+(NULL, 2, 3 ), (1, NULL, 3 ), (1, 2, NULL),
+(NULL, 2, 3+1), (1, NULL, 3+1), (1, 2+1, NULL),
+(NULL, 2, 3-1), (1, NULL, 3-1), (1, 2-1, NULL);
+SELECT (1,2,3) = (1, NULL, 3);
+(1,2,3) = (1, NULL, 3)
+NULL
+SELECT (1,2,3) = (1+1, NULL, 3);
+(1,2,3) = (1+1, NULL, 3)
+0
+SELECT (1,2,3) = (1, NULL, 3+1);
+(1,2,3) = (1, NULL, 3+1)
+0
+SELECT * FROM t1 WHERE (a,b,c) = (1,2,3);
+a b c
+1 2 3
+SELECT (1,2,3) <> (1, NULL, 3);
+(1,2,3) <> (1, NULL, 3)
+NULL
+SELECT (1,2,3) <> (1+1, NULL, 3);
+(1,2,3) <> (1+1, NULL, 3)
+1
+SELECT (1,2,3) <> (1, NULL, 3+1);
+(1,2,3) <> (1, NULL, 3+1)
+1
+SELECT * FROM t1 WHERE (a,b,c) <> (1,2,3);
+a b c
+NULL 2 4
+1 NULL 4
+1 3 NULL
+NULL 2 2
+1 NULL 2
+1 1 NULL
+SELECT (1,2,3) < (NULL, 2, 3);
+(1,2,3) < (NULL, 2, 3)
+NULL
+SELECT (1,2,3) < (1, NULL, 3);
+(1,2,3) < (1, NULL, 3)
+NULL
+SELECT (1,2,3) < (1-1, NULL, 3);
+(1,2,3) < (1-1, NULL, 3)
+0
+SELECT (1,2,3) < (1+1, NULL, 3);
+(1,2,3) < (1+1, NULL, 3)
+1
+SELECT * FROM t1 WHERE (a,b,c) < (1,2,3);
+a b c
+1 1 NULL
+SELECT (1,2,3) <= (NULL, 2, 3);
+(1,2,3) <= (NULL, 2, 3)
+NULL
+SELECT (1,2,3) <= (1, NULL, 3);
+(1,2,3) <= (1, NULL, 3)
+NULL
+SELECT (1,2,3) <= (1-1, NULL, 3);
+(1,2,3) <= (1-1, NULL, 3)
+0
+SELECT (1,2,3) <= (1+1, NULL, 3);
+(1,2,3) <= (1+1, NULL, 3)
+1
+SELECT * FROM t1 WHERE (a,b,c) <= (1,2,3);
+a b c
+1 2 3
+1 1 NULL
+SELECT (1,2,3) > (NULL, 2, 3);
+(1,2,3) > (NULL, 2, 3)
+NULL
+SELECT (1,2,3) > (1, NULL, 3);
+(1,2,3) > (1, NULL, 3)
+NULL
+SELECT (1,2,3) > (1-1, NULL, 3);
+(1,2,3) > (1-1, NULL, 3)
+1
+SELECT (1,2,3) > (1+1, NULL, 3);
+(1,2,3) > (1+1, NULL, 3)
+0
+SELECT * FROM t1 WHERE (a,b,c) > (1,2,3);
+a b c
+1 3 NULL
+SELECT (1,2,3) >= (NULL, 2, 3);
+(1,2,3) >= (NULL, 2, 3)
+NULL
+SELECT (1,2,3) >= (1, NULL, 3);
+(1,2,3) >= (1, NULL, 3)
+NULL
+SELECT (1,2,3) >= (1-1, NULL, 3);
+(1,2,3) >= (1-1, NULL, 3)
+1
+SELECT (1,2,3) >= (1+1, NULL, 3);
+(1,2,3) >= (1+1, NULL, 3)
+0
+SELECT * FROM t1 WHERE (a,b,c) >= (1,2,3);
+a b c
+1 2 3
+1 3 NULL
+DROP TABLE t1;