summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-03-02 11:31:27 +0400
committerAlexander Barkov <bar@mariadb.com>2018-03-02 11:31:27 +0400
commit88a9d4ab42d370dedc9b1d90c75bee53fd8fb8c0 (patch)
tree47948f0c01e1cc409e44f7aa16997d3c203493d5 /sql/sql_show.cc
parent4025cfaec038594bfc97bea48aa2cfe139930cc2 (diff)
downloadmariadb-git-88a9d4ab42d370dedc9b1d90c75bee53fd8fb8c0.tar.gz
MDEV-15444 Querying I_S.PARAMETERS can crash with a corrupted mysql.proc
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 0408bdab47d..9b1a54bd095 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -6155,9 +6155,11 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table,
proc_table->field[MYSQL_PROC_FIELD_NAME]->val_str_nopad(thd->mem_root, &name);
proc_table->field[MYSQL_PROC_FIELD_DEFINER]->val_str_nopad(thd->mem_root, &definer);
sql_mode= (sql_mode_t) proc_table->field[MYSQL_PROC_FIELD_SQL_MODE]->val_int();
- sph= Sp_handler::handler((stored_procedure_type) proc_table->field[MYSQL_PROC_MYSQL_TYPE]->val_int());
+ sph= Sp_handler::handler_mysql_proc((stored_procedure_type)
+ proc_table->field[MYSQL_PROC_MYSQL_TYPE]->
+ val_int());
if (!sph)
- sph= &sp_handler_procedure;
+ DBUG_RETURN(0);
if (!full_access)
full_access= !strcmp(sp_user, definer.str);
@@ -6265,10 +6267,11 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
proc_table->field[MYSQL_PROC_FIELD_DB]->val_str_nopad(thd->mem_root, &db);
proc_table->field[MYSQL_PROC_FIELD_NAME]->val_str_nopad(thd->mem_root, &name);
proc_table->field[MYSQL_PROC_FIELD_DEFINER]->val_str_nopad(thd->mem_root, &definer);
- sph= Sp_handler::handler((stored_procedure_type)
- proc_table->field[MYSQL_PROC_MYSQL_TYPE]->val_int());
+ sph= Sp_handler::handler_mysql_proc((stored_procedure_type)
+ proc_table->field[MYSQL_PROC_MYSQL_TYPE]->
+ val_int());
if (!sph)
- sph= &sp_handler_procedure;
+ return 0;
if (!full_access)
full_access= !strcmp(sp_user, definer.str);