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

Function push_ignored_db_dir

sql/sql_show.cc:200–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198*/
199
200bool
201push_ignored_db_dir(char *path)
202{
203 LEX_STRING *new_elt;
204 char *new_elt_buffer;
205 size_t path_len= strlen(path);
206
207 if (!path_len || path_len >= FN_REFLEN)
208 return true;
209
210 // No need to normalize, it's only a directory name, not a path.
211 if (!my_multi_malloc(0,
212 &new_elt, sizeof(LEX_STRING),
213 &new_elt_buffer, path_len + 1,
214 NullS))
215 return true;
216 new_elt->str= new_elt_buffer;
217 memcpy(new_elt_buffer, path, path_len);
218 new_elt_buffer[path_len]= 0;
219 new_elt->length= path_len;
220 return insert_dynamic(&ignore_db_dirs_array, &new_elt);
221}
222
223
224/**

Callers

nothing calls this directly

Calls 2

my_multi_mallocFunction · 0.85
insert_dynamicFunction · 0.85

Tested by

no test coverage detected