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
27abb692
Commit
27abb692
authored
May 28, 2004
by
pem@mysql.comhem.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed BUG#2460: Crash wih Stored Procedure and UNION.
parent
a4729a90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
1 deletion
+94
-1
mysql-test/r/sp.result
mysql-test/r/sp.result
+45
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+46
-0
sql/sql_union.cc
sql/sql_union.cc
+3
-1
No files found.
mysql-test/r/sp.result
View file @
27abb692
...
@@ -1273,6 +1273,51 @@ select @a|
...
@@ -1273,6 +1273,51 @@ select @a|
@a
@a
5
5
drop procedure bug3863|
drop procedure bug3863|
drop table if exists t3|
create table t3 (
id int(10) unsigned not null default 0,
rid int(10) unsigned not null default 0,
msg text not null,
primary key (id),
unique key rid (rid, id)
)|
create procedure bug2460_1(in v int)
begin
( select n0.id from t3 as n0 where n0.id = v )
union
( select n0.id from t3 as n0, t3 as n1
where n0.id = n1.rid and n1.id = v )
union
( select n0.id from t3 as n0, t3 as n1, t3 as n2
where n0.id = n1.rid and n1.id = n2.rid and n2.id = v );
end|
call bug2460_1(2)|
id
call bug2460_1(2)|
id
insert into t3 values (1, 1, 'foo'), (2, 1, 'bar'), (3, 1, 'zip zap')|
call bug2460_1(2)|
id
2
1
call bug2460_1(2)|
id
2
1
create procedure bug2460_2()
begin
drop table if exists t3;
create table t3 (s1 int);
insert into t3 select 1 union select 1;
end|
call bug2460_2()|
call bug2460_2()|
select * from t3|
s1
1
drop procedure bug2460_1|
drop procedure bug2460_2|
drop table t3|
drop table if exists fac|
drop table if exists fac|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
create procedure ifac(n int unsigned)
create procedure ifac(n int unsigned)
...
...
mysql-test/t/sp.test
View file @
27abb692
...
@@ -1471,6 +1471,52 @@ select @a|
...
@@ -1471,6 +1471,52 @@ select @a|
drop
procedure
bug3863
|
drop
procedure
bug3863
|
#
# BUG#2460
#
--
disable_warnings
drop
table
if
exists
t3
|
--
enable_warnings
create
table
t3
(
id
int
(
10
)
unsigned
not
null
default
0
,
rid
int
(
10
)
unsigned
not
null
default
0
,
msg
text
not
null
,
primary
key
(
id
),
unique
key
rid
(
rid
,
id
)
)
|
create
procedure
bug2460_1
(
in
v
int
)
begin
(
select
n0
.
id
from
t3
as
n0
where
n0
.
id
=
v
)
union
(
select
n0
.
id
from
t3
as
n0
,
t3
as
n1
where
n0
.
id
=
n1
.
rid
and
n1
.
id
=
v
)
union
(
select
n0
.
id
from
t3
as
n0
,
t3
as
n1
,
t3
as
n2
where
n0
.
id
=
n1
.
rid
and
n1
.
id
=
n2
.
rid
and
n2
.
id
=
v
);
end
|
call
bug2460_1
(
2
)
|
call
bug2460_1
(
2
)
|
insert
into
t3
values
(
1
,
1
,
'foo'
),
(
2
,
1
,
'bar'
),
(
3
,
1
,
'zip zap'
)
|
call
bug2460_1
(
2
)
|
call
bug2460_1
(
2
)
|
create
procedure
bug2460_2
()
begin
drop
table
if
exists
t3
;
create
table
t3
(
s1
int
);
insert
into
t3
select
1
union
select
1
;
end
|
call
bug2460_2
()
|
call
bug2460_2
()
|
select
*
from
t3
|
drop
procedure
bug2460_1
|
drop
procedure
bug2460_2
|
drop
table
t3
|
#
#
# Some "real" examples
# Some "real" examples
...
...
sql/sql_union.cc
View file @
27abb692
...
@@ -457,7 +457,9 @@ int st_select_lex_unit::exec()
...
@@ -457,7 +457,9 @@ int st_select_lex_unit::exec()
else
else
{
{
JOIN_TAB
*
tab
,
*
end
;
JOIN_TAB
*
tab
,
*
end
;
for
(
tab
=
join
->
join_tab
,
end
=
tab
+
join
->
tables
;
tab
!=
end
;
tab
++
)
for
(
tab
=
join
->
join_tab
,
end
=
tab
+
join
->
tables
;
tab
&&
tab
!=
end
;
tab
++
)
{
{
delete
tab
->
select
;
delete
tab
->
select
;
delete
tab
->
quick
;
delete
tab
->
quick
;
...
...
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