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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a8da66f8
Commit
a8da66f8
authored
Jan 22, 2019
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #28499924: INCORRECT BEHAVIOR WITH UNION IN SUBQUERY
test case
parent
b20d94da
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
mysql-test/r/subselect2.result
mysql-test/r/subselect2.result
+22
-0
mysql-test/t/subselect2.test
mysql-test/t/subselect2.test
+20
-0
No files found.
mysql-test/r/subselect2.result
View file @
a8da66f8
...
...
@@ -394,3 +394,25 @@ select null in (select a from t1 where a < out3.a union select a from t2 where
(select a from t3) +1 < out3.a+1) from t3 out3;
ERROR 21000: Subquery returns more than 1 row
drop table t1, t2, t3;
CREATE TABLE t1(
q11 int, q12 int, q13 int, q14 int, q15 int, q16 int, q17 int, q18 int, q19 int,
q21 int, q22 int, q23 int, q24 int, q25 int, q26 int, q27 int, q28 int, q29 int,
f1 int
);
CREATE TABLE t2(f2 int, f21 int, f3 timestamp, f4 int, f5 int, f6 int);
INSERT INTO t1 (f1) VALUES (1),(1),(2),(2);
INSERT INTO t2 VALUES (1,1,"2004-02-29 11:11:11",0,0,0), (2,2,"2004-02-29 11:11:11",0,0,0);
SELECT f1,
(SELECT t.f21 from t2 t where max(
q11+q12+q13+q14+q15+q16+q17+q18+q19+
q21+q22+q23+q24+q25+q26+q27+q28+q29) = t.f2 UNION
SELECT t.f3 FROM t2 AS t WHERE t1.f1=t.f2 AND t.f3=MAX(t1.f1) UNION
SELECT 1 LIMIT 1) AS test
FROM t1 GROUP BY f1;
f1 test
1 1
2 1
Warnings:
Warning 1292 Incorrect datetime value: '1'
Warning 1292 Incorrect datetime value: '2'
DROP TABLE t1,t2;
mysql-test/t/subselect2.test
View file @
a8da66f8
...
...
@@ -411,3 +411,23 @@ insert into t3 select a from t1;
select
null
in
(
select
a
from
t1
where
a
<
out3
.
a
union
select
a
from
t2
where
(
select
a
from
t3
)
+
1
<
out3
.
a
+
1
)
from
t3
out3
;
drop
table
t1
,
t2
,
t3
;
#
# Bug #28499924: INCORRECT BEHAVIOR WITH UNION IN SUBQUERY
#
CREATE
TABLE
t1
(
q11
int
,
q12
int
,
q13
int
,
q14
int
,
q15
int
,
q16
int
,
q17
int
,
q18
int
,
q19
int
,
q21
int
,
q22
int
,
q23
int
,
q24
int
,
q25
int
,
q26
int
,
q27
int
,
q28
int
,
q29
int
,
f1
int
);
CREATE
TABLE
t2
(
f2
int
,
f21
int
,
f3
timestamp
,
f4
int
,
f5
int
,
f6
int
);
INSERT
INTO
t1
(
f1
)
VALUES
(
1
),(
1
),(
2
),(
2
);
INSERT
INTO
t2
VALUES
(
1
,
1
,
"2004-02-29 11:11:11"
,
0
,
0
,
0
),
(
2
,
2
,
"2004-02-29 11:11:11"
,
0
,
0
,
0
);
SELECT
f1
,
(
SELECT
t
.
f21
from
t2
t
where
max
(
q11
+
q12
+
q13
+
q14
+
q15
+
q16
+
q17
+
q18
+
q19
+
q21
+
q22
+
q23
+
q24
+
q25
+
q26
+
q27
+
q28
+
q29
)
=
t
.
f2
UNION
SELECT
t
.
f3
FROM
t2
AS
t
WHERE
t1
.
f1
=
t
.
f2
AND
t
.
f3
=
MAX
(
t1
.
f1
)
UNION
SELECT
1
LIMIT
1
)
AS
test
FROM
t1
GROUP
BY
f1
;
DROP
TABLE
t1
,
t2
;
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