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
ec89abfe
Commit
ec89abfe
authored
Oct 17, 2014
by
Igor Babaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.1' of ../10.1-mdev334 into 10.1
parents
aa0fd5ca
a4d1783a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
2 deletions
+30
-2
mysql-test/r/union.result
mysql-test/r/union.result
+10
-0
mysql-test/t/union.test
mysql-test/t/union.test
+12
-0
sql/item_subselect.cc
sql/item_subselect.cc
+3
-1
sql/sql_class.h
sql/sql_class.h
+4
-1
sql/sql_union.cc
sql/sql_union.cc
+1
-0
No files found.
mysql-test/r/union.result
View file @
ec89abfe
...
...
@@ -2005,3 +2005,13 @@ FOUND_ROWS()
1
DROP TABLE t1, t2;
# End of WL1763 tests
#
# Bug mdev-6874: crash with UNION ALL in a subquery
#
CREATE TABLE t1 (a int, b int);
INSERT INTO t1 VALUES (1,1), (2,8);
SELECT * FROM t1 t1_1 LEFT JOIN t1 t1_2 ON ( t1_2.b = t1_1.a )
WHERE t1_2.b NOT IN ( SELECT 4 UNION ALL SELECT 5 );
a b a b
1 1 1 1
DROP TABLE t1;
mysql-test/t/union.test
View file @
ec89abfe
...
...
@@ -1417,3 +1417,15 @@ DROP TABLE t1, t2;
--
echo
# End of WL1763 tests
--
echo
#
--
echo
# Bug mdev-6874: crash with UNION ALL in a subquery
--
echo
#
CREATE
TABLE
t1
(
a
int
,
b
int
);
INSERT
INTO
t1
VALUES
(
1
,
1
),
(
2
,
8
);
SELECT
*
FROM
t1
t1_1
LEFT
JOIN
t1
t1_2
ON
(
t1_2
.
b
=
t1_1
.
a
)
WHERE
t1_2
.
b
NOT
IN
(
SELECT
4
UNION
ALL
SELECT
5
);
DROP
TABLE
t1
;
sql/item_subselect.cc
View file @
ec89abfe
...
...
@@ -3395,7 +3395,9 @@ bool subselect_union_engine::is_executed() const
bool
subselect_union_engine
::
no_rows
()
{
/* Check if we got any rows when reading UNION result from temp. table: */
return
MY_TEST
(
!
unit
->
fake_select_lex
->
join
->
send_records
);
return
MY_TEST
(
!
(
unit
->
fake_select_lex
?
unit
->
fake_select_lex
->
join
->
send_records
:
((
select_union_direct
*
)
result
)
->
send_records
));
}
...
...
sql/sql_class.h
View file @
ec89abfe
...
...
@@ -4431,11 +4431,13 @@ private:
ha_rows
limit
;
public:
/* Number of rows in the union */
ha_rows
send_records
;
select_union_direct
(
select_result
*
result
,
SELECT_LEX
*
last_select_lex
)
:
result
(
result
),
last_select_lex
(
last_select_lex
),
done_send_result_set_metadata
(
false
),
done_initialize_tables
(
false
),
limit_found_rows
(
0
)
{
}
{
send_records
=
0
;
}
bool
change_result
(
select_result
*
new_result
);
uint
field_count
(
List
<
Item
>
&
fields
)
const
{
...
...
@@ -4466,6 +4468,7 @@ public:
and for the results of subquery engines
(select_<something>_subselect).
*/
send_records
=
0
;
DBUG_ASSERT
(
false
);
/* purecov: inspected */
}
void
set_thd
(
THD
*
thd_arg
)
...
...
sql/sql_union.cc
View file @
ec89abfe
...
...
@@ -247,6 +247,7 @@ int select_union_direct::send_data(List<Item> &items)
return
false
;
}
send_records
++
;
fill_record
(
thd
,
table
,
table
->
field
,
items
,
true
,
false
);
if
(
thd
->
is_error
())
return
true
;
/* purecov: inspected */
...
...
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