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

Method std

sql/sql_analyse.h:210–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208 return s;
209 }
210 String *std(String *s, ha_rows rows)
211 {
212 double tmp = ulonglong2double(rows);
213 if (!(tmp - nulls))
214 s->set_real((double) 0.0, 1,my_thd_charset);
215 else
216 {
217 double tmp2 = ((sum_sqr - sum * sum / (tmp - nulls)) /
218 (tmp - nulls));
219 s->set_real(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), item->decimals,my_thd_charset);
220 }
221 return s;
222 }
223 uint decimals() { return item->decimals; }
224 friend int collect_real(double *element, element_count count,
225 TREE_INFO *info);

Callers

nothing calls this directly

Calls 1

set_realMethod · 0.80

Tested by

no test coverage detected