code: func builtinLog2(args []types.Datum, ctx context.Context) (d types.Datum, err error) {
  	sc := ctx.GetSessionVars().StmtCtx
  	x, err := args[0].ToFloat64(sc)
  	if err != nil {
  		return d, errors.Trace(err)
  	}
  
  	if x <= 0 {
  		return
  	}
  
  	d.SetFloat64(math.Log2(x))
  	return
  }
docs: // See http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html#function_log2