summaryrefslogtreecommitdiff
path: root/sql/strfunc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/strfunc.cc')
-rw-r--r--sql/strfunc.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/strfunc.cc b/sql/strfunc.cc
index 6c8fd24f780..9f178950fb0 100644
--- a/sql/strfunc.cc
+++ b/sql/strfunc.cc
@@ -365,7 +365,7 @@ const char *set_to_string(THD *thd, LEX_CSTRING *result, ulonglong set,
for (uint i= 0; set; i++, set >>= 1)
if (set & 1) {
- tmp.append(lib[i]);
+ tmp.append(lib[i], strlen(lib[i]));
tmp.append(',');
}
@@ -396,8 +396,11 @@ const char *flagset_to_string(THD *thd, LEX_CSTRING *result, ulonglong set,
// note that the last element is always "default", and it's ignored below
for (uint i= 0; lib[i+1]; i++, set >>= 1)
{
- tmp.append(lib[i]);
- tmp.append(set & 1 ? "=on," : "=off,");
+ tmp.append(lib[i], strlen(lib[i]));
+ if (set & 1)
+ tmp.append(STRING_WITH_LEN("=on,"));
+ else
+ tmp.append(STRING_WITH_LEN("=off,"));
}
result->str= thd->strmake(tmp.ptr(), tmp.length()-1);