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
81420d5e
Commit
81420d5e
authored
Nov 28, 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
2469ca21
294cb843
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
9 deletions
+71
-9
mysql-test/r/rpl_sp.result
mysql-test/r/rpl_sp.result
+26
-0
mysql-test/t/rpl_sp.test
mysql-test/t/rpl_sp.test
+21
-0
sql/sp.cc
sql/sp.cc
+0
-9
sql/sql_parse.cc
sql/sql_parse.cc
+24
-0
No files found.
mysql-test/r/rpl_sp.result
View file @
81420d5e
...
@@ -467,5 +467,31 @@ DROP FUNCTION f1;
...
@@ -467,5 +467,31 @@ DROP FUNCTION f1;
drop table t1;
drop table t1;
set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=0;
drop database if exists mysqltest;
drop database if exists mysqltest2;
create database mysqltest;
create database mysqltest2;
use mysqltest2;
create table t ( t integer );
create procedure mysqltest.test() begin end;
insert into t values ( 1 );
show binlog events in 'master-bin.000001' from 8186;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 8186 Query 1 8317 use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION f1() RETURNS INT RETURN 0
master-bin.000001 8317 Query 1 8397 use `test`; DROP PROCEDURE p1
master-bin.000001 8397 Query 1 8476 use `test`; DROP FUNCTION f1
master-bin.000001 8476 Query 1 8552 use `test`; drop table t1
master-bin.000001 8552 Query 1 8653 drop database if exists mysqltest
master-bin.000001 8653 Query 1 8756 drop database if exists mysqltest2
master-bin.000001 8756 Query 1 8849 create database mysqltest
master-bin.000001 8849 Query 1 8944 create database mysqltest2
master-bin.000001 8944 Query 1 9041 use `mysqltest2`; create table t ( t integer )
master-bin.000001 9041 Query 1 9180 use `mysqltest2`; CREATE DEFINER=`root`@`localhost` procedure mysqltest.test() begin end
master-bin.000001 9180 Query 1 9275 use `mysqltest2`; insert into t values ( 1 )
create procedure `\\`.test() begin end;
ERROR 42000: Incorrect database name '\\'
drop database mysqltest;
drop database mysqltest2;
End of 5.0 tests
End of 5.0 tests
End of 5.1 tests
End of 5.1 tests
mysql-test/t/rpl_sp.test
View file @
81420d5e
...
@@ -526,6 +526,27 @@ sync_slave_with_master;
...
@@ -526,6 +526,27 @@ sync_slave_with_master;
set
global
log_bin_trust_function_creators
=
0
;
set
global
log_bin_trust_function_creators
=
0
;
connection
master
;
connection
master
;
set
global
log_bin_trust_function_creators
=
0
;
set
global
log_bin_trust_function_creators
=
0
;
#
# Bug22043: MySQL don't add "USE <DATABASE>" before "DROP PROCEDURE IF EXISTS"
#
connection
master
;
--
disable_warnings
drop
database
if
exists
mysqltest
;
drop
database
if
exists
mysqltest2
;
--
enable_warnings
create
database
mysqltest
;
create
database
mysqltest2
;
use
mysqltest2
;
create
table
t
(
t
integer
);
create
procedure
mysqltest
.
test
()
begin
end
;
insert
into
t
values
(
1
);
show
binlog
events
in
'master-bin.000001'
from
8186
;
--
error
ER_WRONG_DB_NAME
create
procedure
`\\`
.
test
()
begin
end
;
# Clean up
drop
database
mysqltest
;
drop
database
mysqltest2
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
sql/sp.cc
View file @
81420d5e
...
@@ -497,17 +497,10 @@ db_create_routine(THD *thd, int type, sp_head *sp)
...
@@ -497,17 +497,10 @@ db_create_routine(THD *thd, int type, sp_head *sp)
char
definer
[
USER_HOST_BUFF_SIZE
];
char
definer
[
USER_HOST_BUFF_SIZE
];
char
old_db_buf
[
NAME_LEN
+
1
];
char
old_db_buf
[
NAME_LEN
+
1
];
LEX_STRING
old_db
=
{
old_db_buf
,
sizeof
(
old_db_buf
)
};
LEX_STRING
old_db
=
{
old_db_buf
,
sizeof
(
old_db_buf
)
};
bool
dbchanged
;
DBUG_ENTER
(
"db_create_routine"
);
DBUG_ENTER
(
"db_create_routine"
);
DBUG_PRINT
(
"enter"
,
(
"type: %d name: %.*s"
,
type
,
sp
->
m_name
.
length
,
DBUG_PRINT
(
"enter"
,
(
"type: %d name: %.*s"
,
type
,
sp
->
m_name
.
length
,
sp
->
m_name
.
str
));
sp
->
m_name
.
str
));
if
((
ret
=
sp_use_new_db
(
thd
,
sp
->
m_db
,
&
old_db
,
0
,
&
dbchanged
)))
{
ret
=
SP_NO_DB_ERROR
;
goto
done
;
}
if
(
!
(
table
=
open_proc_table_for_update
(
thd
)))
if
(
!
(
table
=
open_proc_table_for_update
(
thd
)))
ret
=
SP_OPEN_TABLE_FAILED
;
ret
=
SP_OPEN_TABLE_FAILED
;
else
else
...
@@ -631,8 +624,6 @@ db_create_routine(THD *thd, int type, sp_head *sp)
...
@@ -631,8 +624,6 @@ db_create_routine(THD *thd, int type, sp_head *sp)
done:
done:
close_thread_tables
(
thd
);
close_thread_tables
(
thd
);
if
(
dbchanged
)
(
void
)
mysql_change_db
(
thd
,
old_db
.
str
,
1
);
DBUG_RETURN
(
ret
);
DBUG_RETURN
(
ret
);
}
}
...
...
sql/sql_parse.cc
View file @
81420d5e
...
@@ -4388,6 +4388,30 @@ end_with_restore_list:
...
@@ -4388,6 +4388,30 @@ end_with_restore_list:
DBUG_ASSERT
(
lex
->
sphead
!=
0
);
DBUG_ASSERT
(
lex
->
sphead
!=
0
);
DBUG_ASSERT
(
lex
->
sphead
->
m_db
.
str
);
/* Must be initialized in the parser */
DBUG_ASSERT
(
lex
->
sphead
->
m_db
.
str
);
/* Must be initialized in the parser */
/*
Verify that the database name is allowed, optionally
lowercase it.
*/
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
;
}
/*
Check that a database with this name
exists.
*/
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
;
}
if
(
check_access
(
thd
,
CREATE_PROC_ACL
,
lex
->
sphead
->
m_db
.
str
,
0
,
0
,
0
,
if
(
check_access
(
thd
,
CREATE_PROC_ACL
,
lex
->
sphead
->
m_db
.
str
,
0
,
0
,
0
,
is_schema_db
(
lex
->
sphead
->
m_db
.
str
)))
is_schema_db
(
lex
->
sphead
->
m_db
.
str
)))
{
{
...
...
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