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
5bba20bb
Commit
5bba20bb
authored
Oct 30, 2009
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
1e7fb592
9d96cd6d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
3 deletions
+45
-3
mysql-test/r/select.result
mysql-test/r/select.result
+12
-0
mysql-test/t/select.test
mysql-test/t/select.test
+17
-0
sql/sql_class.cc
sql/sql_class.cc
+4
-2
sql/sql_select.cc
sql/sql_select.cc
+12
-1
No files found.
mysql-test/r/select.result
View file @
5bba20bb
...
...
@@ -4415,6 +4415,18 @@ SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a);
1
1
DROP TABLE t1;
#
# Bug #48291 : crash with row() operator,select into @var, and
# subquery returning multiple rows
#
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (2),(3);
# Should not crash
SELECT 1 FROM t1 WHERE a <> 1 AND NOT
ROW(a,a) <=> ROW((SELECT 1 FROM t1 WHERE 1=2),(SELECT 1 FROM t1))
INTO @var0;
ERROR 21000: Subquery returns more than 1 row
DROP TABLE t1;
End of 5.0 tests
create table t1(a INT, KEY (a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
...
...
mysql-test/t/select.test
View file @
5bba20bb
...
...
@@ -3755,7 +3755,24 @@ EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a);
SELECT
1
FROM
t1
NATURAL
LEFT
JOIN
t1
AS
t2
FORCE
INDEX
(
a
);
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #48291 : crash with row() operator,select into @var, and
--
echo
# subquery returning multiple rows
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
2
),(
3
);
--
echo
# Should not crash
--
error
ER_SUBQUERY_NO_1_ROW
SELECT
1
FROM
t1
WHERE
a
<>
1
AND
NOT
ROW
(
a
,
a
)
<=>
ROW
((
SELECT
1
FROM
t1
WHERE
1
=
2
),(
SELECT
1
FROM
t1
))
INTO
@
var0
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
#
...
...
sql/sql_class.cc
View file @
5bba20bb
...
...
@@ -2723,9 +2723,11 @@ bool select_dumpvar::send_data(List<Item> &items)
else
{
Item_func_set_user_var
*
suv
=
new
Item_func_set_user_var
(
mv
->
s
,
item
);
suv
->
fix_fields
(
thd
,
0
);
if
(
suv
->
fix_fields
(
thd
,
0
))
DBUG_RETURN
(
1
);
suv
->
save_item_result
(
item
);
suv
->
update
();
if
(
suv
->
update
())
DBUG_RETURN
(
1
);
}
}
DBUG_RETURN
(
thd
->
is_error
());
...
...
sql/sql_select.cc
View file @
5bba20bb
...
...
@@ -11204,6 +11204,7 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
bool
not_used_in_distinct
=
join_tab
->
not_used_in_distinct
;
ha_rows
found_records
=
join
->
found_records
;
COND
*
select_cond
=
join_tab
->
select_cond
;
bool
select_cond_result
=
TRUE
;
if
(
error
>
0
||
(
join
->
thd
->
is_error
()))
// Fatal error
return
NESTED_LOOP_ERROR
;
...
...
@@ -11215,7 +11216,17 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
return
NESTED_LOOP_KILLED
;
/* purecov: inspected */
}
DBUG_PRINT
(
"info"
,
(
"select cond 0x%lx"
,
(
ulong
)
select_cond
));
if
(
!
select_cond
||
select_cond
->
val_int
())
if
(
select_cond
)
{
select_cond_result
=
test
(
select_cond
->
val_int
());
/* check for errors evaluating the condition */
if
(
join
->
thd
->
is_error
())
return
NESTED_LOOP_ERROR
;
}
if
(
!
select_cond
||
select_cond_result
)
{
/*
There is no select condition or the attached pushed down
...
...
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