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

Method compare_binary_string

sql/item_cmpfunc.cc:374–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372*/
373
374int Arg_comparator::compare_binary_string()
375{
376 String *res1,*res2;
377 if ((res1= (*a)->val_str(&value1)))
378 {
379 if ((res2= (*b)->val_str(&value2)))
380 {
381 if (set_null)
382 owner->null_value= 0;
383 uint res1_length= res1->length();
384 uint res2_length= res2->length();
385 int cmp= memcmp(res1->ptr(), res2->ptr(), min(res1_length,res2_length));
386 return cmp ? cmp : (int) (res1_length - res2_length);
387 }
388 }
389 if (set_null)
390 owner->null_value= 1;
391 return -1;
392}
393
394
395/**

Callers

nothing calls this directly

Calls 4

minFunction · 0.85
val_strMethod · 0.45
lengthMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected