summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc22
1 files changed, 9 insertions, 13 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 0b9b503aef3..251b829fb1d 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -523,12 +523,8 @@ check_routine_name(LEX_STRING *ident)
my_error(ER_SP_WRONG_NAME, MYF(0), ident->str);
return TRUE;
}
- if (check_string_char_length(ident, 0, NAME_CHAR_LEN,
- system_charset_info, 1))
- {
- my_error(ER_TOO_LONG_IDENT, MYF(0), ident->str);
+ if (check_ident_length(ident))
return TRUE;
- }
return FALSE;
}
@@ -3152,23 +3148,23 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
thd->query_length()) <= 0)
{
res= m_lex_keeper.reset_lex_and_exec_core(thd, nextp, FALSE, this);
+ bool log_slow= !res && thd->enable_slow_log;
- if (thd->get_stmt_da()->is_eof())
- {
- /* Finalize server status flags after executing a statement. */
+ /* Finalize server status flags after executing a statement. */
+ if (log_slow || thd->get_stmt_da()->is_eof())
thd->update_server_status();
+ if (thd->get_stmt_da()->is_eof())
thd->protocol->end_statement();
- }
query_cache_end_of_result(thd);
mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_STATUS,
- thd->get_stmt_da()->is_error() ?
- thd->get_stmt_da()->sql_errno() : 0,
- command_name[COM_QUERY].str);
+ thd->get_stmt_da()->is_error() ?
+ thd->get_stmt_da()->sql_errno() : 0,
+ command_name[COM_QUERY].str);
- if (!res && unlikely(thd->enable_slow_log))
+ if (log_slow)
log_slow_statement(thd);
}
else