MCPcopy Create free account
hub / github.com/MariaDB/server / insert

Method insert

sql/sql_db.cc:169–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167 }
168
169 void insert(const char *s)
170 {
171 auto len= strlen(s);
172 auto ls= (LEX_STRING *) my_malloc(key_memory_dbnames_cache,
173 sizeof(LEX_STRING) + strlen(s) + 1, 0);
174
175 if (!ls)
176 return;
177
178 ls->length= len;
179 ls->str= (char *) (ls + 1);
180
181 memcpy(ls->str, s, len + 1);
182 mysql_rwlock_wrlock(&m_lock);
183 bool found= m_set.find(s, len) != 0;
184 if (!found)
185 m_set.insert(ls);
186 mysql_rwlock_unlock(&m_lock);
187 if (found)
188 my_free(ls);
189 }
190
191 void clear()
192 {

Callers 1

check_db_dir_existenceFunction · 0.45

Calls 3

my_mallocFunction · 0.85
my_freeFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected