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

Function perform_insert

mysys/queues.c:509–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507
508
509void perform_insert(QUEUE *queue)
510{
511 uint i= 1, no_parts= tot_no_parts;
512 uint backward_start= 0;
513
514 expected_part= 1;
515 expected_num= 1;
516
517 if (max_ind)
518 backward_start= 1 << 21;
519
520 do
521 {
522 uint num= (i + backward_start);
523 if (max_ind)
524 {
525 while (!is_divisible_by(num, i))
526 num--;
527 if (max_ind && (num > expected_num ||
528 (num == expected_num && i < expected_part)))
529 {
530 expected_num= num;
531 expected_part= i;
532 }
533 }
534 num_array[i]= num + (i << 22);
535 if (fix_used)
536 queue_element(queue, i-1)= (uchar*)&num_array[i];
537 else
538 queue_insert(queue, (uchar*)&num_array[i]);
539 } while (++i <= no_parts);
540 if (fix_used)
541 {
542 queue->elements= no_parts;
543 queue_fix(queue);
544 }
545}
546
547my_bool perform_ins_del(QUEUE *queue, my_bool max_ind)
548{

Callers 2

do_testFunction · 0.85
benchmark_testFunction · 0.85

Calls 3

is_divisible_byFunction · 0.85
queue_insertFunction · 0.85
queue_fixFunction · 0.85

Tested by

no test coverage detected