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
52124c33
Commit
52124c33
authored
Jan 30, 2004
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Plain Diff
Merge sinisa@bk-internal.mysql.com:/home/bk/mysql-5.0
into sinisa.nasamreza.org:/mnt/work/petica
parents
aeb013b6
bf661081
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
18 deletions
+63
-18
Docs/sp-implemented.txt
Docs/sp-implemented.txt
+18
-16
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
+12
-0
No files found.
Docs/sp-implemented.txt
View file @
52124c33
Stored Procedures implemented 2003-12-10:
Summary of Not Yet Implemented:
- SQL statements using table (like SELECT, INSERT, UPDATE etc)
in FUNCTIONs
- External languages
- Access control
- Routine characteristics (mostly used for external languages)
- SQL-99 COMMIT (related to BEGIN/END)
- FOR-loops
- CASCADE/RESTRICT for ALTER and DROP
- ALTER/DROP METHOD (as it implies User Defined Types)
- SIGNAL and RESIGNAL, and UNDO handlers
Stored Procedures implemented 2004-01-29:
Summary of what's implemented:
...
...
@@ -29,6 +15,18 @@ Summary of what's implemented:
- SHOW DECLARE PROCEDURE/FUNCTION and SHOW PROCEDURE/FUNCTION STATUS
Summary of Not Yet Implemented:
- SQL statements using tables (like SELECT, INSERT, UPDATE etc) in FUNCTIONs
- External languages
- Access control
- SQL-99 COMMIT (related to BEGIN/END)
- FOR-loops
- CASCADE/RESTRICT for ALTER and DROP
- ALTER/DROP METHOD (as it implies User Defined Types)
- SIGNAL and RESIGNAL, and UNDO handlers
List of what's implemented:
- CREATE PROCEDURE|FUNCTION name ( args ) characteristics body
...
...
@@ -91,7 +89,7 @@ List of what's implemented:
context which makes sharing prepared SPs impossible. And, even when
this is resolved, it's not necessarily the case that it will be faster
than a cache per thread. A global cache requires locks, which might
become a b
u
ttleneck. (It would save memory though.)
become a b
o
ttleneck. (It would save memory though.)
- CONDITIONs and HANDLERs are implemented, but not the SIGNAL and
RESIGNAL statements. (It's unclear if these can be implemented.)
The semantics of CONDITIONs is expanded to allow catching MySQL error
...
...
@@ -102,6 +100,10 @@ List of what's implemented:
(NEXT, PRIOR, etc). Cursors are ASENSITIVE, READ-ONLY, non-SCROLLing.
(The additional syntax will be added for completeness, but for the
most part unsupported with the current underlying cursor mechanism.)
N.B. The current implementation is temporary and only works within a
stored procedure, and may not perform well for very large result sets.
A "real" cursor implementation is under development; this will replace
the current one when it's finished.
- SHOW procedures and functions
SHOW DECLARE PROCEDURE|FUNCTION <name>
...
...
mysql-test/r/sp.result
View file @
52124c33
...
...
@@ -968,6 +968,16 @@ drop procedure bug2267_1|
drop procedure bug2267_2|
drop procedure bug2267_3|
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|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
create procedure ifac(n int unsigned)
...
...
mysql-test/t/sp.test
View file @
52124c33
...
...
@@ -502,7 +502,6 @@ drop procedure sel2|
delete
from
t1
|
delete
from
t2
|
# SELECT INTO local variables
create
procedure
into_test
(
x
char
(
16
),
y
int
)
begin
...
...
@@ -1107,6 +1106,20 @@ drop procedure bug2267_2|
drop
procedure
bug2267_3
|
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
...
...
sql/item.h
View file @
52124c33
...
...
@@ -296,7 +296,10 @@ public:
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
...
...
@@ -318,6 +321,11 @@ public:
{
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 @
52124c33
...
...
@@ -94,8 +94,14 @@ sp_eval_func_item(THD *thd, Item *it, enum enum_field_types type)
}
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
));
it
=
new
Item_real
(
it
->
val
());
it
->
decimals
=
decimals
;
it
->
max_length
=
max_length
;
}
break
;
}
...
...
@@ -271,6 +277,12 @@ sp_head::execute(THD *thd)
int
ret
=
0
;
uint
ip
=
0
;
#ifndef EMBEDDED_LIBRARY
if
(
check_stack_overrun
(
thd
,
olddbptr
))
{
DBUG_RETURN
(
-
1
);
}
#endif
if
(
olddbptr
)
{
uint
i
=
0
;
...
...
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