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

Method get_str_value

sql/sql_acl.cc:1753–1770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1751 return value_type != vt;
1752 }
1753 const char *get_str_value(MEM_ROOT *root, const char *key) const
1754 {
1755 size_t value_len;
1756 const char *value_start;
1757 if (get_value(key, JSV_STRING, &value_start, &value_len))
1758 return "";
1759 char *ptr= (char*)my_safe_alloca(value_len);
1760 if (!ptr)
1761 return NULL;
1762 int len= json_unescape(m_table->field[2]->charset(),
1763 (const uchar*)value_start,
1764 (const uchar*)value_start + value_len,
1765 system_charset_info,
1766 (uchar*)ptr, (uchar*)ptr + value_len);
1767 const char *js= len < 0 ? NULL : strmake_root(root, ptr, len);
1768 my_safe_afree(ptr, value_len);
1769 return js;
1770 }
1771 longlong get_int_value(const char *key, longlong def_val= 0) const
1772 {
1773 int err;

Callers

nothing calls this directly

Calls 4

json_unescapeFunction · 0.85
strmake_rootFunction · 0.85
get_valueFunction · 0.50
charsetMethod · 0.45

Tested by

no test coverage detected