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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
0f348bcd
Commit
0f348bcd
authored
Jul 12, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-13302 Avoid using LEX::spname during CREATE PROCEDURE and CREATE FUNCTION
parent
7c3df72d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
14 deletions
+11
-14
sql/sp.cc
sql/sp.cc
+6
-5
sql/sp_cache.cc
sql/sp_cache.cc
+1
-1
sql/sp_cache.h
sql/sp_cache.h
+2
-2
sql/sql_parse.cc
sql/sql_parse.cc
+2
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+0
-2
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+0
-2
No files found.
sql/sp.cc
View file @
0f348bcd
...
...
@@ -470,7 +470,8 @@ static TABLE *open_proc_table_for_update(THD *thd)
*/
static
int
db_find_routine_aux
(
THD
*
thd
,
stored_procedure_type
type
,
const
sp_name
*
name
,
db_find_routine_aux
(
THD
*
thd
,
stored_procedure_type
type
,
const
Database_qualified_name
*
name
,
TABLE
*
table
)
{
uchar
key
[
MAX_KEY_LENGTH
];
// db, name, optional key length type
...
...
@@ -969,7 +970,7 @@ sp_returns_type(THD *thd, String &result, sp_head *sp)
*/
static
int
sp_drop_routine_internal
(
THD
*
thd
,
stored_procedure_type
type
,
const
sp
_name
*
name
,
TABLE
*
table
)
const
Database_qualified
_name
*
name
,
TABLE
*
table
)
{
DBUG_ENTER
(
"sp_drop_routine_internal"
);
...
...
@@ -1079,11 +1080,11 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
else
{
/* Checking if the routine already exists */
if
(
db_find_routine_aux
(
thd
,
type
,
lex
->
spname
,
table
)
==
SP_OK
)
if
(
db_find_routine_aux
(
thd
,
type
,
sp
,
table
)
==
SP_OK
)
{
if
(
lex
->
create_info
.
or_replace
())
{
if
((
ret
=
sp_drop_routine_internal
(
thd
,
type
,
lex
->
spname
,
table
)))
if
((
ret
=
sp_drop_routine_internal
(
thd
,
type
,
sp
,
table
)))
goto
done
;
}
else
if
(
lex
->
create_info
.
if_not_exists
())
...
...
@@ -1092,7 +1093,7 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
ER_SP_ALREADY_EXISTS
,
ER_THD
(
thd
,
ER_SP_ALREADY_EXISTS
),
SP_TYPE_STRING
(
type
),
lex
->
spname
->
m_name
.
str
);
sp
->
m_name
.
str
);
ret
=
FALSE
;
...
...
sql/sp_cache.cc
View file @
0f348bcd
...
...
@@ -189,7 +189,7 @@ void sp_cache_insert(sp_cache **cp, sp_head *sp)
NULL if the routine not found.
*/
sp_head
*
sp_cache_lookup
(
sp_cache
**
cp
,
const
sp
_name
*
name
)
sp_head
*
sp_cache_lookup
(
sp_cache
**
cp
,
const
Database_qualified
_name
*
name
)
{
char
buf
[
NAME_LEN
*
2
+
2
];
sp_cache
*
c
=
*
cp
;
...
...
sql/sp_cache.h
View file @
0f348bcd
...
...
@@ -32,7 +32,7 @@
class
sp_head
;
class
sp_cache
;
class
sp
_name
;
class
Database_qualified
_name
;
/*
Cache usage scenarios:
...
...
@@ -59,7 +59,7 @@ void sp_cache_init();
void
sp_cache_end
();
void
sp_cache_clear
(
sp_cache
**
cp
);
void
sp_cache_insert
(
sp_cache
**
cp
,
sp_head
*
sp
);
sp_head
*
sp_cache_lookup
(
sp_cache
**
cp
,
const
sp
_name
*
name
);
sp_head
*
sp_cache_lookup
(
sp_cache
**
cp
,
const
Database_qualified
_name
*
name
);
void
sp_cache_invalidate
();
void
sp_cache_flush_obsolete
(
sp_cache
**
cp
,
sp_head
**
sp
);
ulong
sp_cache_version
();
...
...
sql/sql_parse.cc
View file @
0f348bcd
...
...
@@ -2935,8 +2935,8 @@ static int mysql_create_routine(THD *thd, LEX *lex)
/* Checking the drop permissions if CREATE OR REPLACE is used */
if
(
lex
->
create_info
.
or_replace
())
{
if
(
check_routine_access
(
thd
,
ALTER_PROC_ACL
,
lex
->
sp
name
->
m_db
.
str
,
lex
->
sp
name
->
m_name
.
str
,
if
(
check_routine_access
(
thd
,
ALTER_PROC_ACL
,
lex
->
sp
head
->
m_db
.
str
,
lex
->
sp
head
->
m_name
.
str
,
lex
->
sql_command
==
SQLCOM_DROP_PROCEDURE
,
0
))
return
true
;
}
...
...
sql/sql_yacc.yy
View file @
0f348bcd
...
...
@@ -16664,7 +16664,6 @@ sf_tail:
if (!Lex->make_sp_head_no_recursive(thd, $1, $2,
TYPE_ENUM_FUNCTION))
MYSQL_YYABORT;
Lex->spname= $2;
}
sp_parenthesized_fdparam_list
sf_return_type
...
...
@@ -16700,7 +16699,6 @@ sp_tail:
if (!Lex->make_sp_head_no_recursive(thd, $1, $2,
TYPE_ENUM_PROCEDURE))
MYSQL_YYABORT;
Lex->spname= $2;
}
sp_parenthesized_pdparam_list
sp_c_chistics
...
...
sql/sql_yacc_ora.yy
View file @
0f348bcd
...
...
@@ -16903,7 +16903,6 @@ sf_tail:
if (!Lex->make_sp_head_no_recursive(thd, $1, $2,
TYPE_ENUM_FUNCTION))
MYSQL_YYABORT;
Lex->spname= $2;
}
opt_sp_parenthesized_fdparam_list
sf_return_type
...
...
@@ -16942,7 +16941,6 @@ sp_tail:
if (!Lex->make_sp_head_no_recursive(thd, $1, $2,
TYPE_ENUM_PROCEDURE))
MYSQL_YYABORT;
Lex->spname= $2;
}
opt_sp_parenthesized_pdparam_list
sp_c_chistics
...
...
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