From 6577a7a8f20538df80b851698e21095311aae190 Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Wed, 15 Apr 2020 13:10:51 +0300 Subject: fix tests related to SQL comment length tests are: engines/funcs.jp_comment_column engines/funcs.jp_comment_index engines/funcs.jp_comment_table --- sql/sql_string.h | 2 +- sql/sql_table.cc | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sql/sql_string.h b/sql/sql_string.h index 614b54065fd..46b13dabbcc 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -79,7 +79,7 @@ public: Well_formed_prefix(CHARSET_INFO *cs, const char *str, size_t length) :Well_formed_prefix_status(cs, str, str + length, length), m_str(str) { } - Well_formed_prefix(CHARSET_INFO *cs, LEX_STRING str, size_t nchars) + Well_formed_prefix(CHARSET_INFO *cs, LEX_CSTRING str, size_t nchars) :Well_formed_prefix_status(cs, str.str, str.str + str.length, nchars), m_str(str.str) { } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 13c23b323e5..eef7239db4c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4330,11 +4330,8 @@ bool validate_comment_length(THD *thd, LEX_CSTRING *comment, size_t max_len, if (comment->length == 0) DBUG_RETURN(false); - if (max_len > comment->length) - max_len= comment->length; - size_t tmp_len= - Well_formed_prefix(system_charset_info, comment->str, max_len).length(); + Well_formed_prefix(system_charset_info, *comment, max_len).length(); if (tmp_len < comment->length) { if (thd->is_strict_mode()) -- cgit v1.2.1