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

Function my_hash_next

mysys/hash.c:316–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314 /* Can only be called if previous calls was my_hash_search */
315
316uchar* my_hash_next(const HASH *hash, const uchar *key, size_t length,
317 HASH_SEARCH_STATE *current_record)
318{
319 HASH_LINK *pos;
320 uint idx;
321
322 if (*current_record != NO_RECORD)
323 {
324 HASH_LINK *data=dynamic_element(&hash->array,0,HASH_LINK*);
325 for (idx=data[*current_record].next; idx != NO_RECORD ; idx=pos->next)
326 {
327 pos=data+idx;
328 if (!hashcmp(hash,pos,key,length))
329 {
330 *current_record= idx;
331 return pos->data;
332 }
333 }
334 *current_record= NO_RECORD;
335 }
336 return 0;
337}
338
339
340 /* Change link from pos to new_link */

Callers 1

my_hash_updateFunction · 0.85

Calls 1

hashcmpFunction · 0.85

Tested by

no test coverage detected