code: func (b *builtinIntervalIntSig) binSearch(target int64, isUint1 bool, args []Expression, row chunk.Row) (_ int, err error) {
  	i, j, cmp := 0, len(args), false
  	for i < j {
  		mid := i + (j-i)/2
  		v, isNull, err1 := args[mid].EvalInt(b.ctx, row)
  		if err1 != nil {
  			err = err1
  			break
  		}
  		if isNull {
  			v = target
  		}
  		isUint2 := mysql.HasUnsignedFlag(args[mid].GetType().Flag)
  		switch {
  		case !isUint1 && !isUint2:
  			cmp = target < v
  		case isUint1 && isUint2:
  			cmp = uint64(target) < uint64(v)
  		case !isUint1 && isUint2:
  			cmp = target < 0 || uint64(target) < uint64(v)
  		case isUint1 && !isUint2:
  			cmp = v > 0 && uint64(target) < uint64(v)
  		}
  		if !cmp {
  			i = mid + 1
  		} else {
  			j = mid
  		}
  	}
  	return i, err
  }
docs: // binSearch is a binary search method.
  // All arguments are treated as integers.
  // It is required that arg[0] < args[1] < args[2] < ... < args[n] for this function to work correctly.
  // This is because a binary search is used (very fast).