summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index b5f4aec4a61..1edacee8aad 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -861,6 +861,11 @@ sp_returns_type(THD *thd, String &result, sp_head *sp)
{
result.append(STRING_WITH_LEN(" CHARSET "));
result.append(field->charset()->csname);
+ if (!(field->charset()->state & MY_CS_PRIMARY))
+ {
+ result.append(STRING_WITH_LEN(" COLLATE "));
+ result.append(field->charset()->name);
+ }
}
delete field;
@@ -1112,9 +1117,10 @@ sp_create_routine(THD *thd, int type, sp_head *sp)
/* restore sql_mode when binloging */
thd->variables.sql_mode= saved_mode;
/* Such a statement can always go directly to binlog, no trans cache */
- thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- log_query.c_ptr(), log_query.length(),
- FALSE, FALSE, 0);
+ if (thd->binlog_query(THD::MYSQL_QUERY_TYPE,
+ log_query.c_ptr(), log_query.length(),
+ FALSE, FALSE, 0))
+ ret= SP_INTERNAL_ERROR;
thd->variables.sql_mode= 0;
}
@@ -1173,7 +1179,8 @@ sp_drop_routine(THD *thd, int type, sp_name *name)
if (ret == SP_OK)
{
- write_bin_log(thd, TRUE, thd->query(), thd->query_length());
+ if (write_bin_log(thd, TRUE, thd->query(), thd->query_length()))
+ ret= SP_INTERNAL_ERROR;
sp_cache_invalidate();
}
@@ -1243,7 +1250,8 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
if (ret == SP_OK)
{
- write_bin_log(thd, TRUE, thd->query(), thd->query_length());
+ if (write_bin_log(thd, TRUE, thd->query(), thd->query_length()))
+ ret= SP_INTERNAL_ERROR;
sp_cache_invalidate();
}
@@ -1888,6 +1896,9 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex,
ret= SP_OK;
break;
default:
+ /* Query might have been killed, don't set error. */
+ if (thd->killed)
+ break;
/*
Any error when loading an existing routine is either some problem
with the mysql.proc table, or a parse error because the contents