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

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

Now simply give an error if no database. (The "global SP feature" will be
done using PATH instead.)
This commit is contained in:
pem@mysql.comhem.se
2004-10-07 15:32:36 +02:00
parent 3a24c279be
commit 8b1a6d377f
4 changed files with 16 additions and 68 deletions

View File

@@ -3611,13 +3611,24 @@ purposes internal to the MySQL server", MYF(0));
case SQLCOM_CREATE_PROCEDURE:
case SQLCOM_CREATE_SPFUNCTION:
{
uint namelen;
char *name;
if (!lex->sphead)
{
res= -1; // Shouldn't happen
break;
}
uint namelen;
char *name= lex->sphead->name(&namelen);
if (! lex->sphead->m_db.str)
{
send_error(thd,ER_NO_DB_ERROR);
delete lex->sphead;
lex->sphead= 0;
goto error;
}
name= lex->sphead->name(&namelen);
#ifdef HAVE_DLOPEN
if (lex->sphead->m_type == TYPE_ENUM_FUNCTION)
{
@@ -3627,7 +3638,7 @@ purposes internal to the MySQL server", MYF(0));
{
net_printf(thd, ER_UDF_EXISTS, name);
delete lex->sphead;
lex->sphead=0;
lex->sphead= 0;
goto error;
}
}
@@ -3637,7 +3648,7 @@ purposes internal to the MySQL server", MYF(0));
{
net_printf(thd, ER_SP_NORETURN, name);
delete lex->sphead;
lex->sphead=0;
lex->sphead= 0;
goto error;
}