Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
3ce925bf
Commit
3ce925bf
authored
Sep 09, 2010
by
Alexey Kopytov
Browse files
Options
Browse Files
Download
Plain Diff
Automerge.
parents
4f4d03a4
453107bc
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
3 deletions
+55
-3
mysql-test/r/row.result
mysql-test/r/row.result
+23
-0
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+2
-2
mysql-test/t/row.test
mysql-test/t/row.test
+19
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+7
-0
sql/item_subselect.cc
sql/item_subselect.cc
+4
-1
No files found.
mysql-test/r/row.result
View file @
3ce925bf
...
...
@@ -466,3 +466,26 @@ SELECT 1 FROM t1 WHERE ROW(a, b) >=
ROW('1', (SELECT 1 FROM t1 WHERE a > 1234));
1
DROP TABLE t1;
#
# Bug #54190: Comparison to row subquery produces incorrect result
#
SELECT ROW(1,2) = (SELECT 1,2 FROM DUAL WHERE 1 = 0);
ROW(1,2) = (SELECT 1,2 FROM DUAL WHERE 1 = 0)
NULL
SELECT ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0);
ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0)
NULL
CREATE TABLE t1 (i INT);
INSERT INTO t1 () VALUES (1), (2), (3);
SELECT ROW(1,2) = (SELECT 1,2 FROM t1 WHERE 1 = 0);
ROW(1,2) = (SELECT 1,2 FROM t1 WHERE 1 = 0)
NULL
SELECT ROW(1,2) = (SELECT 1,3 FROM t1 WHERE 1 = 0);
ROW(1,2) = (SELECT 1,3 FROM t1 WHERE 1 = 0)
NULL
SELECT i FROM t1 WHERE ROW(1,2) = (SELECT 1,2 FROM DUAL WHERE 1 = 0);
i
SELECT i FROM t1 WHERE ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0);
i
DROP TABLE t1;
End of 5.1 tests
mysql-test/r/subselect.result
View file @
3ce925bf
...
...
@@ -922,7 +922,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a') (select c from t1 where a=t2.a)
1 1 a
2 0 b
NULL
0
NULL
NULL
NULL
NULL
select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2;
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b') (select c from t1 where a=t2.a)
1 0 a
...
...
@@ -932,7 +932,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where a=t2.a)
1 0 a
2 0 b
NULL
0
NULL
NULL
NULL
NULL
drop table t1,t2;
create table t1 (a int, b real, c varchar(10));
insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
...
...
mysql-test/t/row.test
View file @
3ce925bf
...
...
@@ -266,3 +266,22 @@ SELECT 1 FROM t1 WHERE ROW(a, b) >=
ROW
(
'1'
,
(
SELECT
1
FROM
t1
WHERE
a
>
1234
));
--
enable_warnings
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #54190: Comparison to row subquery produces incorrect result
--
echo
#
SELECT
ROW
(
1
,
2
)
=
(
SELECT
1
,
2
FROM
DUAL
WHERE
1
=
0
);
SELECT
ROW
(
1
,
2
)
=
(
SELECT
1
,
3
FROM
DUAL
WHERE
1
=
0
);
CREATE
TABLE
t1
(
i
INT
);
INSERT
INTO
t1
()
VALUES
(
1
),
(
2
),
(
3
);
SELECT
ROW
(
1
,
2
)
=
(
SELECT
1
,
2
FROM
t1
WHERE
1
=
0
);
SELECT
ROW
(
1
,
2
)
=
(
SELECT
1
,
3
FROM
t1
WHERE
1
=
0
);
SELECT
i
FROM
t1
WHERE
ROW
(
1
,
2
)
=
(
SELECT
1
,
2
FROM
DUAL
WHERE
1
=
0
);
SELECT
i
FROM
t1
WHERE
ROW
(
1
,
2
)
=
(
SELECT
1
,
3
FROM
DUAL
WHERE
1
=
0
);
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
sql/item_cmpfunc.cc
View file @
3ce925bf
...
...
@@ -1583,6 +1583,13 @@ int Arg_comparator::compare_row()
bool
was_null
=
0
;
(
*
a
)
->
bring_value
();
(
*
b
)
->
bring_value
();
if
((
*
a
)
->
null_value
||
(
*
b
)
->
null_value
)
{
owner
->
null_value
=
1
;
return
-
1
;
}
uint
n
=
(
*
a
)
->
cols
();
for
(
uint
i
=
0
;
i
<
n
;
i
++
)
{
...
...
sql/item_subselect.cc
View file @
3ce925bf
...
...
@@ -566,7 +566,10 @@ bool Item_singlerow_subselect::null_inside()
void
Item_singlerow_subselect
::
bring_value
()
{
exec
();
if
(
!
exec
()
&&
assigned
())
null_value
=
0
;
else
reset
();
}
double
Item_singlerow_subselect
::
val_real
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment