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

Method val_str_ascii

sql/item.cc:99–117  ·  view source on GitHub ↗

For the items which don't have its own fast val_str_ascii() implementation we provide a generic slower version, which converts from the Item character set to ASCII. For better performance conversion happens only in case of a "tricky" Item character set (e.g. UCS2). Normally conversion does not happen. */

Source from the content-addressed store, hash-verified

97 Normally conversion does not happen.
98*/
99String *Item::val_str_ascii(String *str)
100{
101 if (!(collation.collation->state & MY_CS_NONASCII))
102 return val_str(str);
103
104 DBUG_ASSERT(str != &str_value);
105
106 uint errors;
107 String *res= val_str(&str_value);
108 if (!res)
109 return 0;
110
111 if ((null_value= str->copy(res->ptr(), res->length(),
112 collation.collation, &my_charset_latin1,
113 &errors)))
114 return 0;
115
116 return str;
117}
118
119
120String *Item::val_string_from_real(String *str)

Callers

nothing calls this directly

Calls 4

val_strFunction · 0.85
copyMethod · 0.45
ptrMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected