| 1918 | |
| 1919 | |
| 1920 | const char * |
| 1921 | Item_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 | |
| 1946 | table_map Item_func_sp::get_initial_pseudo_tables() const |
nothing calls this directly
no test coverage detected