mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Fixed a valgrind warning with the fix for bug 28702.
This commit is contained in:
parent
832616f177
commit
37beea410c
1 changed files with 10 additions and 2 deletions
|
@ -15493,6 +15493,7 @@ TABLE_LIST::print_index_hint(THD *thd, String *str,
|
|||
List_iterator_fast<String> li(indexes);
|
||||
String *idx;
|
||||
bool first= 1;
|
||||
int find_length= strlen(primary_key_name);
|
||||
|
||||
str->append (' ');
|
||||
str->append (hint, hint_length);
|
||||
|
@ -15503,8 +15504,15 @@ TABLE_LIST::print_index_hint(THD *thd, String *str,
|
|||
first= 0;
|
||||
else
|
||||
str->append(',');
|
||||
if (!my_strcasecmp (system_charset_info, idx->c_ptr_safe(),
|
||||
primary_key_name))
|
||||
/*
|
||||
It's safe to use ptr() here because we compare the length first
|
||||
and we rely that my_strcasecmp will not access more than length()
|
||||
chars from the string. See test_if_string_in_list() for similar
|
||||
implementation.
|
||||
*/
|
||||
if (find_length == idx->length() &&
|
||||
!my_strcasecmp (system_charset_info, primary_key_name,
|
||||
idx->ptr()))
|
||||
str->append(primary_key_name);
|
||||
else
|
||||
append_identifier (thd, str, idx->ptr(), idx->length());
|
||||
|
|
Loading…
Reference in a new issue