1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fixed BUG#5000: SPs can be created with no default database.

Easy to prevent crash, but the question was how to treat this case?
  We ended up implementing the "global" SPs (i.e. with no associated
  db), which were planned but left unresolved when SPs moved into dbs.
  So now things like "call .p()" work too.
This commit is contained in:
pem@mysql.comhem.se
2004-09-08 14:23:14 +02:00
parent 3aa2a62f37
commit b83af8607a
5 changed files with 70 additions and 9 deletions

View File

@@ -5,6 +5,29 @@
# Make sure we don't have any procedures left.
delete from mysql.proc;
# A test "global" procedures, i.e. not belonging to any database.
create function .f1() returns int return 1;
create procedure .p1() select 1, database();
create procedure p1() select 2, database();
alter procedure .p1 sql security invoker;
# This is ok:
select .f1();
call .p1();
call p1();
# This is not ok:
--error 1304
select f1();
select db,name,type,security_type from mysql.proc;
drop function .f1;
drop procedure .p1;
drop procedure p1;
delimiter |;
# This should give three syntax errors (sometimes crashed; bug #643)