diff options
author | vicentiu <vicentiu@mariadb.org> | 2017-01-06 17:09:59 +0200 |
---|---|---|
committer | vicentiu <vicentiu@mariadb.org> | 2017-01-06 17:09:59 +0200 |
commit | e9aed131ead9e102c8948ebadc421960399722d4 (patch) | |
tree | ae8f4ee4ee7f7e915121ff2c73c88c20781c45ed /sql/sp_head.cc | |
parent | e4978d26b79120c58706e57fc66e4de1ec4b230c (diff) | |
parent | ae1b3d1991b679bb38095711de27934d7683deda (diff) | |
download | mariadb-git-e9aed131ead9e102c8948ebadc421960399722d4.tar.gz |
Merge remote-tracking branch 'origin/5.5' into 10.0
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index b90108ed944..fb0f3132816 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -522,12 +522,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, "", 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; } @@ -3120,23 +3116,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 |