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

Method avg

sql/sql_analyse.h:127–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 String *get_max_arg(String *not_used __attribute__((unused)))
126 { return &max_arg; }
127 String *avg(String *s, ha_rows rows)
128 {
129 if (!(rows - nulls))
130 s->set_real((double) 0.0, 1,my_thd_charset);
131 else
132 s->set_real((ulonglong2double(sum) / ulonglong2double(rows - nulls)),
133 DEC_IN_AVG,my_thd_charset);
134 return s;
135 }
136 friend int collect_string(String *element, element_count count,
137 TREE_INFO *info);
138 tree_walk_action collect_enum()

Callers

nothing calls this directly

Calls 1

set_realMethod · 0.80

Tested by

no test coverage detected