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

Method avg

sql/sql_analyse.h:248–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246 String *get_min_arg(String *s) { s->set(min_arg,my_thd_charset); return s; }
247 String *get_max_arg(String *s) { s->set(max_arg,my_thd_charset); return s; }
248 String *avg(String *s, ha_rows rows)
249 {
250 if (!(rows - nulls))
251 s->set_real((double) 0.0, 1,my_thd_charset);
252 else
253 s->set_real(((double) sum / (double) (rows - nulls)), DEC_IN_AVG,my_thd_charset);
254 return s;
255 }
256 String *std(String *s, ha_rows rows)
257 {
258 double tmp = ulonglong2double(rows);

Callers

nothing calls this directly

Calls 1

set_realMethod · 0.80

Tested by

no test coverage detected