Skip to content

Commit

Permalink
fix tests related to SQL comment length
Browse files Browse the repository at this point in the history
tests are:
engines/funcs.jp_comment_column
engines/funcs.jp_comment_index
engines/funcs.jp_comment_table
  • Loading branch information
kevgs committed Apr 15, 2020
1 parent 84db10f commit 6577a7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sql/sql_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Well_formed_prefix: public Well_formed_prefix_status
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)
{ }
Expand Down
5 changes: 1 addition & 4 deletions sql/sql_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 6577a7a

Please sign in to comment.