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
ffc506e9
Commit
ffc506e9
authored
Nov 23, 2005
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge
parent
aa06123f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
sql/sp.cc
sql/sp.cc
+21
-13
No files found.
sql/sp.cc
View file @
ffc506e9
...
...
@@ -400,6 +400,7 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
const
char
*
definer
,
longlong
created
,
longlong
modified
)
{
LEX
*
oldlex
=
thd
->
lex
,
newlex
;
sp_rcontext
*
save_spcont
=
;
thd
->
spcont
;
String
defstr
;
char
olddb
[
128
];
bool
dbchanged
;
...
...
@@ -430,6 +431,9 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
lex_start
(
thd
,
(
uchar
*
)
defstr
.
c_ptr
(),
defstr
.
length
());
(
*
sphp
)
->
set_definer
((
char
*
)
definer
,
(
uint
)
strlen
(
definer
));
(
*
sphp
)
->
set_info
(
created
,
modified
,
&
chistics
,
sql_mode
);
thd
->
spcont
=
0
;
if
(
yyparse
(
thd
)
||
thd
->
is_fatal_error
||
newlex
.
sphead
==
NULL
)
{
sp_head
*
sp
=
newlex
.
sphead
;
...
...
@@ -442,12 +446,15 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
else
{
if
(
dbchanged
&&
(
ret
=
mysql_change_db
(
thd
,
olddb
,
1
)))
goto
end
;
goto
db_
end
;
*
sphp
=
newlex
.
sphead
;
(
*
sphp
)
->
set_definer
((
char
*
)
definer
,
(
uint
)
strlen
(
definer
));
(
*
sphp
)
->
set_info
((
char
*
)
definer
,
(
uint
)
strlen
(
definer
),
created
,
modified
,
&
chistics
,
sql_mode
);
(
*
sphp
)
->
optimize
();
}
db_end:
thd
->
spcont
=
save_spcont
;
thd
->
variables
.
sql_mode
=
old_sql_mode
;
thd
->
variables
.
select_limit
=
select_limit
;
end:
...
...
@@ -550,12 +557,13 @@ db_create_routine(THD *thd, int type, sp_head *sp)
store
(
sp
->
m_chistics
->
comment
.
str
,
sp
->
m_chistics
->
comment
.
length
,
system_charset_info
);
if
(
!
trust_routine_creators
&&
mysql_bin_log
.
is_open
())
if
((
sp
->
m_type
==
TYPE_ENUM_FUNCTION
)
&&
!
trust_function_creators
&&
mysql_bin_log
.
is_open
())
{
if
(
!
sp
->
m_chistics
->
detistic
)
{
/*
Note that
for a _function_ this test is not enough
; one could use
Note that
this test is not perfect
; one could use
a non-deterministic read-only function in an update statement.
*/
enum
enum_sp_data_access
access
=
...
...
@@ -1606,30 +1614,30 @@ create_string(THD *thd, String *buf,
chistics
->
comment
.
length
))
return
FALSE
;
buf
->
append
(
"CREATE "
,
7
);
buf
->
append
(
STRING_WITH_LEN
(
"CREATE "
)
);
if
(
type
==
TYPE_ENUM_FUNCTION
)
buf
->
append
(
"FUNCTION "
,
9
);
buf
->
append
(
STRING_WITH_LEN
(
"FUNCTION "
)
);
else
buf
->
append
(
"PROCEDURE "
,
10
);
buf
->
append
(
STRING_WITH_LEN
(
"PROCEDURE "
)
);
append_identifier
(
thd
,
buf
,
name
->
m_name
.
str
,
name
->
m_name
.
length
);
buf
->
append
(
'('
);
buf
->
append
(
params
,
paramslen
);
buf
->
append
(
')'
);
if
(
type
==
TYPE_ENUM_FUNCTION
)
{
buf
->
append
(
" RETURNS "
,
9
);
buf
->
append
(
STRING_WITH_LEN
(
" RETURNS "
)
);
buf
->
append
(
returns
,
returnslen
);
}
buf
->
append
(
'\n'
);
switch
(
chistics
->
daccess
)
{
case
SP_NO_SQL
:
buf
->
append
(
" NO SQL
\n
"
);
buf
->
append
(
STRING_WITH_LEN
(
" NO SQL
\n
"
)
);
break
;
case
SP_READS_SQL_DATA
:
buf
->
append
(
" READS SQL DATA
\n
"
);
buf
->
append
(
STRING_WITH_LEN
(
" READS SQL DATA
\n
"
)
);
break
;
case
SP_MODIFIES_SQL_DATA
:
buf
->
append
(
" MODIFIES SQL DATA
\n
"
);
buf
->
append
(
STRING_WITH_LEN
(
" MODIFIES SQL DATA
\n
"
)
);
break
;
case
SP_DEFAULT_ACCESS
:
case
SP_CONTAINS_SQL
:
...
...
@@ -1637,12 +1645,12 @@ create_string(THD *thd, String *buf,
break
;
}
if
(
chistics
->
detistic
)
buf
->
append
(
" DETERMINISTIC
\n
"
,
18
);
buf
->
append
(
STRING_WITH_LEN
(
" DETERMINISTIC
\n
"
)
);
if
(
chistics
->
suid
==
SP_IS_NOT_SUID
)
buf
->
append
(
" SQL SECURITY INVOKER
\n
"
,
25
);
buf
->
append
(
STRING_WITH_LEN
(
" SQL SECURITY INVOKER
\n
"
)
);
if
(
chistics
->
comment
.
length
)
{
buf
->
append
(
" COMMENT "
);
buf
->
append
(
STRING_WITH_LEN
(
" COMMENT "
)
);
append_unescaped
(
buf
,
chistics
->
comment
.
str
,
chistics
->
comment
.
length
);
buf
->
append
(
'\n'
);
}
...
...
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