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
46de7157
Commit
46de7157
authored
Dec 01, 2006
by
thek@kpdesk.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge kpdesk.mysql.com:/home/thek/dev/bug22043/my50-bug22043
into kpdesk.mysql.com:/home/thek/dev/bug22043/my51-bug22043
parents
ea6a9175
b201d4ef
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
75 deletions
+52
-75
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+1
-1
mysql-test/t/information_schema.test
mysql-test/t/information_schema.test
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+50
-73
No files found.
mysql-test/r/information_schema.result
View file @
46de7157
...
...
@@ -1080,7 +1080,7 @@ CREATE PROCEDURE p1 ()
BEGIN
SELECT 'foo' FROM DUAL;
END |
ERROR 42000:
Access denied for user 'root'@'localhost' to
database 'information_schema'
ERROR 42000:
Unknown
database 'information_schema'
select ROUTINE_NAME from routines;
ROUTINE_NAME
grant all on information_schema.* to 'user1'@'localhost';
...
...
mysql-test/t/information_schema.test
View file @
46de7157
...
...
@@ -721,7 +721,7 @@ create temporary table schemata(f1 char(10));
# Bug #10708 SP's can use INFORMATION_SCHEMA as ROUTINE_SCHEMA
#
delimiter
|
;
--
error
1044
--
error
ER_BAD_DB_ERROR
CREATE
PROCEDURE
p1
()
BEGIN
SELECT
'foo'
FROM
DUAL
;
...
...
sql/sql_parse.cc
View file @
46de7157
...
...
@@ -4383,11 +4383,10 @@ mysql_execute_command(THD *thd)
{
uint
namelen
;
char
*
name
;
int
result
;
int
result
=
SP_INTERNAL_ERROR
;
DBUG_ASSERT
(
lex
->
sphead
!=
0
);
DBUG_ASSERT
(
lex
->
sphead
->
m_db
.
str
);
/* Must be initialized in the parser */
/*
Verify that the database name is allowed, optionally
lowercase it.
...
...
@@ -4395,37 +4394,26 @@ mysql_execute_command(THD *thd)
if
(
check_db_name
(
lex
->
sphead
->
m_db
.
str
))
{
my_error
(
ER_WRONG_DB_NAME
,
MYF
(
0
),
lex
->
sphead
->
m_db
.
str
);
delete
lex
->
sphead
;
lex
->
sphead
=
0
;
goto
error
;
goto
create_sp_error
;
}
/*
Check that a database with this name
exists.
Check that a database directory with this name
exists. Design note: This won't work on virtual databases
like information_schema.
*/
if
(
check_db_dir_existence
(
lex
->
sphead
->
m_db
.
str
))
{
my_error
(
ER_BAD_DB_ERROR
,
MYF
(
0
),
lex
->
sphead
->
m_db
.
str
);
delete
lex
->
sphead
;
lex
->
sphead
=
0
;
goto
error
;
goto
create_sp_error
;
}
if
(
check_access
(
thd
,
CREATE_PROC_ACL
,
lex
->
sphead
->
m_db
.
str
,
0
,
0
,
0
,
is_schema_db
(
lex
->
sphead
->
m_db
.
str
)))
{
delete
lex
->
sphead
;
lex
->
sphead
=
0
;
goto
error
;
}
goto
create_sp_error
;
if
(
end_active_trans
(
thd
))
{
delete
lex
->
sphead
;
lex
->
sphead
=
0
;
goto
error
;
}
goto
create_sp_error
;
name
=
lex
->
sphead
->
name
(
&
namelen
);
#ifdef HAVE_DLOPEN
...
...
@@ -4436,9 +4424,7 @@ mysql_execute_command(THD *thd)
if
(
udf
)
{
my_error
(
ER_UDF_EXISTS
,
MYF
(
0
),
name
);
delete
lex
->
sphead
;
lex
->
sphead
=
0
;
goto
error
;
goto
create_sp_error
;
}
}
#endif
...
...
@@ -4480,13 +4466,9 @@ mysql_execute_command(THD *thd)
if
(
ps_arena
)
thd
->
restore_active_arena
(
ps_arena
,
&
original_arena
);
if
(
res
)
{
/* Error has been already reported. */
delete
lex
->
sphead
;
lex
->
sphead
=
0
;
goto
error
;
}
if
(
res
)
goto
create_sp_error
;
if
(
thd
->
slave_thread
)
lex
->
sphead
->
m_chistics
->
suid
=
SP_IS_NOT_SUID
;
...
...
@@ -4506,9 +4488,7 @@ mysql_execute_command(THD *thd)
if
(
check_global_access
(
thd
,
SUPER_ACL
))
{
my_error
(
ER_SPECIFIC_ACCESS_DENIED_ERROR
,
MYF
(
0
),
"SUPER"
);
delete
lex
->
sphead
;
lex
->
sphead
=
0
;
goto
error
;
goto
create_sp_error
;
}
}
...
...
@@ -4528,8 +4508,8 @@ mysql_execute_command(THD *thd)
#endif
/* NO_EMBEDDED_ACCESS_CHECKS */
res
=
(
result
=
lex
->
sphead
->
create
(
thd
));
if
(
result
==
SP_OK
)
{
switch
(
result
)
{
case
SP_OK
:
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/* only add privileges if really neccessary */
if
(
sp_automatic_privileges
&&
!
opt_noacl
&&
...
...
@@ -4545,20 +4525,10 @@ mysql_execute_command(THD *thd)
close_thread_tables
(
thd
);
}
#endif
lex
->
unit
.
cleanup
();
delete
lex
->
sphead
;
lex
->
sphead
=
0
;
send_ok
(
thd
);
}
else
{
switch
(
result
)
{
break
;
case
SP_WRITE_ROW_FAILED
:
my_error
(
ER_SP_ALREADY_EXISTS
,
MYF
(
0
),
SP_TYPE_STRING
(
lex
),
name
);
break
;
case
SP_NO_DB_ERROR
:
my_error
(
ER_BAD_DB_ERROR
,
MYF
(
0
),
lex
->
sphead
->
m_db
.
str
);
break
;
case
SP_BAD_IDENTIFIER
:
my_error
(
ER_TOO_LONG_IDENT
,
MYF
(
0
),
name
);
break
;
...
...
@@ -4568,14 +4538,21 @@ mysql_execute_command(THD *thd)
default:
my_error
(
ER_SP_STORE_FAILED
,
MYF
(
0
),
SP_TYPE_STRING
(
lex
),
name
);
break
;
}
}
/* end switch */
/*
Capture all errors within this CASE and
clean up the environment.
*/
create_sp_error:
lex
->
unit
.
cleanup
();
delete
lex
->
sphead
;
lex
->
sphead
=
0
;
if
(
result
!=
SP_OK
)
goto
error
;
}
break
;
}
send_ok
(
thd
);
break
;
/* break super switch */
}
/* end case group bracket */
case
SQLCOM_CALL
:
{
sp_head
*
sp
;
...
...
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