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

Method avg

sql/sql_analyse.h:202–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200 return s;
201 }
202 String *avg(String *s, ha_rows rows)
203 {
204 if (!(rows - nulls))
205 s->set_real((double) 0.0, 1,my_thd_charset);
206 else
207 s->set_real(((double)sum / (double) (rows - nulls)), item->decimals,my_thd_charset);
208 return s;
209 }
210 String *std(String *s, ha_rows rows)
211 {
212 double tmp = ulonglong2double(rows);

Callers

nothing calls this directly

Calls 1

set_realMethod · 0.80

Tested by

no test coverage detected