| 448 | |
| 449 | |
| 450 | LEX_CSTRING Sql_path::lex_cstring(MEM_ROOT *mem_root) const |
| 451 | { |
| 452 | LEX_CSTRING res; |
| 453 | size_t nbytes_needed= text_format_nbytes_needed(); |
| 454 | char *ptr= (char *) alloc_root(mem_root, nbytes_needed); |
| 455 | if (ptr) |
| 456 | { |
| 457 | res.length= print(ptr, nbytes_needed); |
| 458 | res.str= ptr; |
| 459 | DBUG_ASSERT(res.length < nbytes_needed); |
| 460 | } |
| 461 | else |
| 462 | { |
| 463 | res.str= nullptr; |
| 464 | res.length= 0; |
| 465 | } |
| 466 | |
| 467 | return res; |
| 468 | } |
| 469 | |
| 470 | Sql_path_instant_set::Sql_path_instant_set(THD *thd, const LEX_CSTRING &str) |
| 471 | : m_thd(thd), m_path(std::move(thd->variables.path)) |
no test coverage detected