MCPcopy Create free account
hub / github.com/MariaDB/server / lex_cstring

Method lex_cstring

sql/sql_path.cc:450–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448
449
450LEX_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
470Sql_path_instant_set::Sql_path_instant_set(THD *thd, const LEX_CSTRING &str)
471 : m_thd(thd), m_path(std::move(thd->variables.path))

Calls 2

alloc_rootFunction · 0.85
printFunction · 0.50

Tested by

no test coverage detected