summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-04-27 21:04:06 +0200
committerSergei Golubchik <serg@mariadb.org>2015-04-27 21:04:06 +0200
commit0f12ada6b6a390b8663151f5d8cfae2e6dc9c2bb (patch)
tree5af5b81499f6137f45a37fc77cc518e40fd4ad72 /sql/sp.cc
parente4df6e5799eec20a16e279f7e74e95f18cd475fe (diff)
parente02fe87f00dc9fdb0fb6ab13f2e87485f79f3341 (diff)
downloadmariadb-git-0f12ada6b6a390b8663151f5d8cfae2e6dc9c2bb.tar.gz
Merge remote-tracking branch 'mysql/5.5' into 5.5
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index 13f027493b4..873812c19b3 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -1,5 +1,6 @@
/*
- Copyright (c) 2002, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2002, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1494,6 +1495,14 @@ bool lock_db_routines(THD *thd, char *db)
{
char *sp_name= get_field(thd->mem_root,
table->field[MYSQL_PROC_FIELD_NAME]);
+ if (sp_name == NULL)
+ {
+ table->file->ha_index_end();
+ my_error(ER_SP_WRONG_NAME, MYF(0), "");
+ close_system_tables(thd, &open_tables_state_backup);
+ DBUG_RETURN(true);
+ }
+
longlong sp_type= table->field[MYSQL_PROC_MYSQL_TYPE]->val_int();
MDL_request *mdl_request= new (thd->mem_root) MDL_request;
mdl_request->init(sp_type == TYPE_ENUM_FUNCTION ?