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
bfdf9d3c
Commit
bfdf9d3c
authored
Jan 21, 2004
by
pem@mysql.comhem.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed BUG#2227: Server crash with stored procedure call.
(Meaning "... with SELECT v", where v is a local variable.)
parent
ee411648
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
2 deletions
+39
-2
mysql-test/r/sp.result
mysql-test/r/sp.result
+10
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+14
-1
sql/item.h
sql/item.h
+9
-1
sql/sp_head.cc
sql/sp_head.cc
+6
-0
No files found.
mysql-test/r/sp.result
View file @
bfdf9d3c
...
@@ -968,6 +968,16 @@ drop procedure bug2267_1|
...
@@ -968,6 +968,16 @@ drop procedure bug2267_1|
drop procedure bug2267_2|
drop procedure bug2267_2|
drop procedure bug2267_3|
drop procedure bug2267_3|
drop procedure bug2267_4|
drop procedure bug2267_4|
create procedure bug2227(x int)
begin
declare y float default 2.6;
declare z char(16) default "zzz";
select 1.3, x, y, 42, z;
end|
call bug2227(9)|
1.3 x y 42 z
1.3 9 2.6 42 zzz
drop procedure bug2227|
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 @
bfdf9d3c
...
@@ -502,7 +502,6 @@ drop procedure sel2|
...
@@ -502,7 +502,6 @@ drop procedure sel2|
delete
from
t1
|
delete
from
t1
|
delete
from
t2
|
delete
from
t2
|
# SELECT INTO local variables
# SELECT INTO local variables
create
procedure
into_test
(
x
char
(
16
),
y
int
)
create
procedure
into_test
(
x
char
(
16
),
y
int
)
begin
begin
...
@@ -1107,6 +1106,20 @@ drop procedure bug2267_2|
...
@@ -1107,6 +1106,20 @@ drop procedure bug2267_2|
drop
procedure
bug2267_3
|
drop
procedure
bug2267_3
|
drop
procedure
bug2267_4
|
drop
procedure
bug2267_4
|
#
# BUG#2227
#
create
procedure
bug2227
(
x
int
)
begin
declare
y
float
default
2.6
;
declare
z
char
(
16
)
default
"zzz"
;
select
1.3
,
x
,
y
,
42
,
z
;
end
|
call
bug2227
(
9
)
|
drop
procedure
bug2227
|
#
#
# Some "real" examples
# Some "real" examples
...
...
sql/item.h
View file @
bfdf9d3c
...
@@ -296,7 +296,10 @@ public:
...
@@ -296,7 +296,10 @@ public:
inline
void
make_field
(
Send_field
*
field
)
inline
void
make_field
(
Send_field
*
field
)
{
{
this_item
()
->
make_field
(
field
);
Item
*
it
=
this_item
();
it
->
set_name
(
m_name
.
str
,
m_name
.
length
,
system_charset_info
);
it
->
make_field
(
field
);
}
}
inline
Item_result
result_type
()
const
inline
Item_result
result_type
()
const
...
@@ -318,6 +321,11 @@ public:
...
@@ -318,6 +321,11 @@ public:
{
{
str
->
append
(
m_name
.
str
,
m_name
.
length
);
str
->
append
(
m_name
.
str
,
m_name
.
length
);
}
}
inline
bool
send
(
Protocol
*
protocol
,
String
*
str
)
{
return
this_item
()
->
send
(
protocol
,
str
);
}
};
};
...
...
sql/sp_head.cc
View file @
bfdf9d3c
...
@@ -94,8 +94,14 @@ sp_eval_func_item(THD *thd, Item *it, enum enum_field_types type)
...
@@ -94,8 +94,14 @@ sp_eval_func_item(THD *thd, Item *it, enum enum_field_types type)
}
}
else
else
{
{
/* There's some difference between Item::new_item() and the
* constructor; the former crashes, the latter works... weird. */
uint8
decimals
=
it
->
decimals
;
uint32
max_length
=
it
->
max_length
;
DBUG_PRINT
(
"info"
,
(
"REAL_RESULT: %g"
,
d
));
DBUG_PRINT
(
"info"
,
(
"REAL_RESULT: %g"
,
d
));
it
=
new
Item_real
(
it
->
val
());
it
=
new
Item_real
(
it
->
val
());
it
->
decimals
=
decimals
;
it
->
max_length
=
max_length
;
}
}
break
;
break
;
}
}
...
...
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