Skip to content

Commit 6577a7a

Browse files
committed
fix tests related to SQL comment length
tests are: engines/funcs.jp_comment_column engines/funcs.jp_comment_index engines/funcs.jp_comment_table
1 parent 84db10f commit 6577a7a

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

sql/sql_string.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Well_formed_prefix: public Well_formed_prefix_status
7979
Well_formed_prefix(CHARSET_INFO *cs, const char *str, size_t length)
8080
:Well_formed_prefix_status(cs, str, str + length, length), m_str(str)
8181
{ }
82-
Well_formed_prefix(CHARSET_INFO *cs, LEX_STRING str, size_t nchars)
82+
Well_formed_prefix(CHARSET_INFO *cs, LEX_CSTRING str, size_t nchars)
8383
:Well_formed_prefix_status(cs, str.str, str.str + str.length, nchars),
8484
m_str(str.str)
8585
{ }

sql/sql_table.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4330,11 +4330,8 @@ bool validate_comment_length(THD *thd, LEX_CSTRING *comment, size_t max_len,
43304330
if (comment->length == 0)
43314331
DBUG_RETURN(false);
43324332

4333-
if (max_len > comment->length)
4334-
max_len= comment->length;
4335-
43364333
size_t tmp_len=
4337-
Well_formed_prefix(system_charset_info, comment->str, max_len).length();
4334+
Well_formed_prefix(system_charset_info, *comment, max_len).length();
43384335
if (tmp_len < comment->length)
43394336
{
43404337
if (thd->is_strict_mode())

0 commit comments

Comments
 (0)