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
8c5ae25f
Commit
8c5ae25f
authored
Apr 21, 2006
by
pem@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/extern/mysql/bk/mysql-5.0-runtime
into mysql.com:/extern/mysql/5.0/bug18344/mysql-5.0-runtime
parents
2dc3026c
9eb230f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
12 deletions
+69
-12
mysql-test/r/sp.result
mysql-test/r/sp.result
+29
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+32
-0
sql/sp.cc
sql/sp.cc
+8
-12
No files found.
mysql-test/r/sp.result
View file @
8c5ae25f
...
...
@@ -4858,4 +4858,33 @@ call bug18787()|
no_such_function()
NULL
drop procedure bug18787|
create database bug18344_012345678901|
use bug18344_012345678901|
create procedure bug18344() begin end|
create procedure bug18344_2() begin end|
create database bug18344_0123456789012|
use bug18344_0123456789012|
create procedure bug18344() begin end|
create procedure bug18344_2() begin end|
use test|
select schema_name from information_schema.schemata where
schema_name like 'bug18344%'|
schema_name
bug18344_012345678901
bug18344_0123456789012
select routine_name,routine_schema from information_schema.routines where
routine_schema like 'bug18344%'|
routine_name routine_schema
bug18344 bug18344_012345678901
bug18344_2 bug18344_012345678901
bug18344 bug18344_0123456789012
bug18344_2 bug18344_0123456789012
drop database bug18344_012345678901|
drop database bug18344_0123456789012|
select schema_name from information_schema.schemata where
schema_name like 'bug18344%'|
schema_name
select routine_name,routine_schema from information_schema.routines where
routine_schema like 'bug18344%'|
routine_name routine_schema
drop table t1,t2;
mysql-test/t/sp.test
View file @
8c5ae25f
...
...
@@ -5716,6 +5716,38 @@ call bug18787()|
drop
procedure
bug18787
|
#
# BUG#18344: DROP DATABASE does not drop associated routines
# (... if the database name is longer than 21 characters)
#
# 1234567890123456789012
create
database
bug18344_012345678901
|
use
bug18344_012345678901
|
create procedure bug18344() begin end|
create procedure bug18344_2() begin end|
create database bug18344_0123456789012|
use bug18344_0123456789012|
create procedure bug18344() begin end|
create procedure bug18344_2() begin end|
use test|
select schema_name from information_schema.schemata where
schema_name like 'bug18344%'|
select routine_name,routine_schema from information_schema.routines where
routine_schema like 'bug18344%'|
drop database bug18344_012345678901|
drop database bug18344_0123456789012|
# Should be nothing left.
select schema_name from information_schema.schemata where
schema_name like 'bug18344%'|
select routine_name,routine_schema from information_schema.routines where
routine_schema like 'bug18344%'|
#
# BUG#NNNN: New bug synopsis
#
...
...
sql/sp.cc
View file @
8c5ae25f
...
...
@@ -886,28 +886,23 @@ int
sp_drop_db_routines
(
THD
*
thd
,
char
*
db
)
{
TABLE
*
table
;
byte
key
[
64
];
// db
uint
keylen
;
int
ret
;
uint
key_len
;
DBUG_ENTER
(
"sp_drop_db_routines"
);
DBUG_PRINT
(
"enter"
,
(
"db: %s"
,
db
));
// Put the key used to read the row together
keylen
=
strlen
(
db
);
if
(
keylen
>
64
)
keylen
=
64
;
memcpy
(
key
,
db
,
keylen
);
memset
(
key
+
keylen
,
(
int
)
' '
,
64
-
keylen
);
// Pad with space
keylen
=
sizeof
(
key
);
ret
=
SP_OPEN_TABLE_FAILED
;
if
(
!
(
table
=
open_proc_table_for_update
(
thd
)))
goto
err
;
table
->
field
[
MYSQL_PROC_FIELD_DB
]
->
store
(
db
,
strlen
(
db
),
system_charset_info
);
key_len
=
table
->
key_info
->
key_part
[
0
].
store_length
;
ret
=
SP_OK
;
table
->
file
->
ha_index_init
(
0
);
if
(
!
table
->
file
->
index_read
(
table
->
record
[
0
],
key
,
keylen
,
HA_READ_KEY_EXACT
))
table
->
field
[
MYSQL_PROC_FIELD_DB
]
->
ptr
,
key_len
,
HA_READ_KEY_EXACT
))
{
int
nxtres
;
bool
deleted
=
FALSE
;
...
...
@@ -923,7 +918,8 @@ sp_drop_db_routines(THD *thd, char *db)
break
;
}
}
while
(
!
(
nxtres
=
table
->
file
->
index_next_same
(
table
->
record
[
0
],
key
,
keylen
)));
table
->
field
[
MYSQL_PROC_FIELD_DB
]
->
ptr
,
key_len
)));
if
(
nxtres
!=
HA_ERR_END_OF_FILE
)
ret
=
SP_KEY_NOT_FOUND
;
if
(
deleted
)
...
...
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