summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-12-27 21:39:05 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2016-12-27 21:39:05 -0500
commit901f7ebcf3aa45c99f82e655a8482c50f10b840e (patch)
tree091845fdaadfeb3dbafaca03acec1fdeeffefead /sql/sql_parse.cc
parent5ddd8149e44122feb0989b9944113d2b92d6f84a (diff)
parentec6d8dadc01269451332e5b24b12a5350a2a4896 (diff)
downloadmariadb-git-901f7ebcf3aa45c99f82e655a8482c50f10b840e.tar.gz
Merge tag 'mariadb-5.5.54' into 5.5-galeramariadb-galera-5.5.54
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index ec6eb0e6f87..f74e5d6c3e9 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -4788,11 +4788,8 @@ create_sp_error:
}
case SQLCOM_SHOW_CREATE_TRIGGER:
{
- if (lex->spname->m_name.length > NAME_LEN)
- {
- my_error(ER_TOO_LONG_IDENT, MYF(0), lex->spname->m_name.str);
+ if (check_ident_length(&lex->spname->m_name))
goto error;
- }
if (show_create_trigger(thd, lex->spname))
goto error; /* Error has been already logged. */
@@ -6635,12 +6632,9 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
LEX *lex= thd->lex;
DBUG_ENTER("add_field_to_list");
- if (check_string_char_length(field_name, "", NAME_CHAR_LEN,
- system_charset_info, 1))
- {
- my_error(ER_TOO_LONG_IDENT, MYF(0), field_name->str); /* purecov: inspected */
+ if (check_ident_length(field_name))
DBUG_RETURN(1); /* purecov: inspected */
- }
+
if (type_modifier & PRI_KEY_FLAG)
{
Key *key;
@@ -8310,6 +8304,17 @@ bool check_string_char_length(LEX_STRING *str, const char *err_msg,
}
+bool check_ident_length(LEX_STRING *ident)
+{
+ if (check_string_char_length(ident, 0, NAME_CHAR_LEN, system_charset_info, 1))
+ {
+ my_error(ER_TOO_LONG_IDENT, MYF(0), ident->str);
+ return 1;
+ }
+ return 0;
+}
+
+
/*
Check if path does not contain mysql data home directory