MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / func_name

Method func_name

sql/item_func.cc:1920–1943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1918
1919
1920const char *
1921Item_func_sp::func_name() const
1922{
1923 THD *thd= current_thd;
1924 /* Calculate length to avoid reallocation of string for sure */
1925 uint len= (((m_name->m_explicit_name ? m_name->m_db.length : 0) +
1926 m_name->m_name.length)*2 + //characters*quoting
1927 2 + // ` and `
1928 (m_name->m_explicit_name ?
1929 3 : 0) + // '`', '`' and '.' for the db
1930 1 + // end of string
1931 ALIGN_SIZE(1)); // to avoid String reallocation
1932 String qname((char *)alloc_root(thd->mem_root, len), len,
1933 system_charset_info);
1934
1935 qname.length(0);
1936 if (m_name->m_explicit_name)
1937 {
1938 append_identifier(thd, &qname, m_name->m_db.str, m_name->m_db.length);
1939 qname.append('.');
1940 }
1941 append_identifier(thd, &qname, m_name->m_name.str, m_name->m_name.length);
1942 return qname.ptr();
1943}
1944
1945
1946table_map Item_func_sp::get_initial_pseudo_tables() const

Callers

nothing calls this directly

Calls 5

alloc_rootFunction · 0.85
append_identifierFunction · 0.70
lengthMethod · 0.45
appendMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected