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

Function copy_string

sql/sql_error.cc:239–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239static void copy_string(MEM_ROOT *mem_root, String* dst, const String* src)
240{
241 size_t len= src->length();
242 if (len)
243 {
244 char* copy= (char*) alloc_root(mem_root, len + 1);
245 if (copy)
246 {
247 memcpy(copy, src->ptr(), len);
248 copy[len]= '\0';
249 dst->set(copy, len, src->charset());
250 }
251 }
252 else
253 dst->length(0);
254}
255
256void
257Sql_condition::copy_opt_attributes(const Sql_condition *cond)

Callers 1

copy_opt_attributesMethod · 0.85

Calls 5

alloc_rootFunction · 0.85
lengthMethod · 0.45
ptrMethod · 0.45
setMethod · 0.45
charsetMethod · 0.45

Tested by

no test coverage detected