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

Method find

sql/item_cmpfunc.cc:908–928  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906
907
908int in_vector::find(Item *item)
909{
910 uchar *result=get_value(item);
911 if (!result || !used_count)
912 return 0; // Null value
913
914 uint start,end;
915 start=0; end=used_count-1;
916 while (start != end)
917 {
918 uint mid=(start+end+1)/2;
919 int res;
920 if ((res=(*compare)(collation, base+mid*size, result)) == 0)
921 return 1;
922 if (res < 0)
923 start=mid;
924 else
925 end=mid-1;
926 }
927 return (int) ((*compare)(collation, base+start*size, result) == 0);
928}
929
930in_string::in_string(uint elements,qsort2_cmp cmp_func,
931 const CHARSET_INFO *cs)

Callers 2

add_global_threadFunction · 0.45
find_best_indexFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected