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
21d0d8c5
Commit
21d0d8c5
authored
Dec 05, 2013
by
Igor Babaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
b78f7214
ccf5871d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
mysql-test/r/union.result
mysql-test/r/union.result
+15
-0
mysql-test/t/union.test
mysql-test/t/union.test
+16
-0
sql/sql_base.cc
sql/sql_base.cc
+2
-2
No files found.
mysql-test/r/union.result
View file @
21d0d8c5
...
@@ -1738,4 +1738,19 @@ i
...
@@ -1738,4 +1738,19 @@ i
6
6
DROP VIEW v1;
DROP VIEW v1;
DROP TABLE t1;
DROP TABLE t1;
#
# mdev-5382: UNION with ORDER BY in subselect
#
CREATE TABLE t1 (a int DEFAULT NULL);
INSERT INTO t1 VALUES (2), (4);
CREATE TABLE t2 (b int DEFAULT NULL);
INSERT INTO t2 VALUES (1), (3);
SELECT c1 FROM (SELECT (SELECT a FROM t1 WHERE t1.a <= t2.b
UNION ALL
SELECT a FROM t1 WHERE t1.a+3<= t2.b
ORDER BY a DESC) AS c1 FROM t2) t3;
c1
NULL
2
DROP TABLE t1,t2;
End of 5.3 tests
End of 5.3 tests
mysql-test/t/union.test
View file @
21d0d8c5
...
@@ -1227,5 +1227,21 @@ deallocate prepare stmt1;
...
@@ -1227,5 +1227,21 @@ deallocate prepare stmt1;
DROP
VIEW
v1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# mdev-5382: UNION with ORDER BY in subselect
--
echo
#
CREATE
TABLE
t1
(
a
int
DEFAULT
NULL
);
INSERT
INTO
t1
VALUES
(
2
),
(
4
);
CREATE
TABLE
t2
(
b
int
DEFAULT
NULL
);
INSERT
INTO
t2
VALUES
(
1
),
(
3
);
SELECT
c1
FROM
(
SELECT
(
SELECT
a
FROM
t1
WHERE
t1
.
a
<=
t2
.
b
UNION
ALL
SELECT
a
FROM
t1
WHERE
t1
.
a
+
3
<=
t2
.
b
ORDER
BY
a
DESC
)
AS
c1
FROM
t2
)
t3
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.3
tests
--
echo
End
of
5.3
tests
sql/sql_base.cc
View file @
21d0d8c5
...
@@ -6429,9 +6429,9 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
...
@@ -6429,9 +6429,9 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
else
else
{
{
if
(
thd
->
mark_used_columns
==
MARK_COLUMNS_READ
)
if
(
thd
->
mark_used_columns
==
MARK_COLUMNS_READ
)
it
->
walk
(
&
Item
::
register_field_in_read_map
,
1
,
(
uchar
*
)
0
);
it
->
walk
(
&
Item
::
register_field_in_read_map
,
0
,
(
uchar
*
)
0
);
else
else
it
->
walk
(
&
Item
::
register_field_in_write_map
,
1
,
(
uchar
*
)
0
);
it
->
walk
(
&
Item
::
register_field_in_write_map
,
0
,
(
uchar
*
)
0
);
}
}
}
}
else
else
...
...
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