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

Function get_variable

sql/item_func.cc:1352–1372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1350
1351
1352static user_var_entry *get_variable(HASH *hash, const Name_string &name,
1353 bool create_if_not_exists)
1354{
1355 user_var_entry *entry;
1356
1357 if (!(entry = (user_var_entry*) my_hash_search(hash, (uchar*) name.ptr(),
1358 name.length())) &&
1359 create_if_not_exists)
1360 {
1361 if (!my_hash_inited(hash))
1362 return 0;
1363 if (!(entry= user_var_entry::create(name)))
1364 return 0;
1365 if (my_hash_insert(hash,(uchar*) entry))
1366 {
1367 my_free(entry);
1368 return 0;
1369 }
1370 }
1371 return entry;
1372}
1373
1374bool user_var_entry::realloc(uint length)
1375{

Callers

nothing calls this directly

Calls 5

my_hash_searchFunction · 0.85
my_hash_insertFunction · 0.85
my_freeFunction · 0.85
ptrMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected