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

Function make_lex_string_root

sql/sql_class.cc:1154–1166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1152
1153
1154LEX_STRING *
1155make_lex_string_root(MEM_ROOT *mem_root,
1156 LEX_STRING *lex_str, const char* str, uint length,
1157 bool allocate_lex_string)
1158{
1159 if (allocate_lex_string)
1160 if (!(lex_str= (LEX_STRING *)alloc_root(mem_root, sizeof(LEX_STRING))))
1161 return 0;
1162 if (!(lex_str->str= strmake_root(mem_root, str, length)))
1163 return 0;
1164 lex_str->length= length;
1165 return lex_str;
1166}
1167
1168/**
1169 Create a LEX_STRING in this connection.

Callers 1

make_lex_stringMethod · 0.85

Calls 2

alloc_rootFunction · 0.85
strmake_rootFunction · 0.85

Tested by

no test coverage detected