1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +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.)


mysql-test/r/sp-error.result:
  Removed test cases for undone "feature".
mysql-test/t/sp-error.test:
  Removed test cases for undone "feature".
sql/sql_parse.cc:
  Check if created procedure/function has a database; give error if not.
sql/sql_yacc.yy:
  Undid the "global SP feature".
This commit is contained in:
unknown
2004-10-07 15:32:36 +02:00
parent 3ed9e66840
commit 437855378f
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;
}