| 351 | |
| 352 | |
| 353 | char *set_to_string(THD *thd, LEX_STRING *result, ulonglong set, |
| 354 | const char *lib[]) |
| 355 | { |
| 356 | char buff[STRING_BUFFER_USUAL_SIZE*8]; |
| 357 | String tmp(buff, sizeof(buff), &my_charset_latin1); |
| 358 | LEX_STRING unused; |
| 359 | |
| 360 | if (!result) |
| 361 | result= &unused; |
| 362 | |
| 363 | tmp.length(0); |
| 364 | |
| 365 | for (uint i= 0; set; i++, set >>= 1) |
| 366 | if (set & 1) { |
| 367 | tmp.append(lib[i]); |
| 368 | tmp.append(','); |
| 369 | } |
| 370 | |
| 371 | if (tmp.length()) |
| 372 | { |
| 373 | result->str= thd->strmake(tmp.ptr(), tmp.length()-1); |
| 374 | result->length= tmp.length()-1; |
| 375 | } |
| 376 | else |
| 377 | { |
| 378 | result->str= const_cast<char*>(""); |
| 379 | result->length= 0; |
| 380 | } |
| 381 | return result->str; |
| 382 | } |
| 383 | |
| 384 | char *flagset_to_string(THD *thd, LEX_STRING *result, ulonglong set, |
| 385 | const char *lib[]) |
no test coverage detected