summaryrefslogtreecommitdiff
path: root/sql/sql_help.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_help.cc')
-rw-r--r--sql/sql_help.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 01c47bc2b21..8ce0f724e55 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -541,7 +541,12 @@ extern "C" int string_ptr_cmp(const void* ptr1, const void* ptr2)
{
String *str1= *(String**)ptr1;
String *str2= *(String**)ptr2;
- return strcmp(str1->c_ptr(),str2->c_ptr());
+ uint length1= str1->length();
+ uint length2= str2->length();
+ int tmp= memcmp(str1->ptr(),str2->ptr(), MY_MIN(length1, length2));
+ if (tmp)
+ return tmp;
+ return (int) length2 - (int) length1;
}
/*