| 382 | } |
| 383 | |
| 384 | char *flagset_to_string(THD *thd, LEX_STRING *result, ulonglong set, |
| 385 | const char *lib[]) |
| 386 | { |
| 387 | char buff[STRING_BUFFER_USUAL_SIZE*8]; |
| 388 | String tmp(buff, sizeof(buff), &my_charset_latin1); |
| 389 | LEX_STRING unused; |
| 390 | |
| 391 | if (!result) result= &unused; |
| 392 | |
| 393 | tmp.length(0); |
| 394 | |
| 395 | // note that the last element is always "default", and it's ignored below |
| 396 | for (uint i= 0; lib[i+1]; i++, set >>= 1) |
| 397 | { |
| 398 | tmp.append(lib[i]); |
| 399 | tmp.append(set & 1 ? "=on," : "=off,"); |
| 400 | } |
| 401 | |
| 402 | result->str= thd->strmake(tmp.ptr(), tmp.length()-1); |
| 403 | result->length= tmp.length()-1; |
| 404 | |
| 405 | return result->str; |
| 406 | } |
| 407 |
no test coverage detected