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

Method val_decimal_from_string

sql/item.cc:171–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169
170
171my_decimal *Item::val_decimal_from_string(my_decimal *decimal_value)
172{
173 String *res;
174
175 if (!(res= val_str(&str_value)))
176 return NULL;
177
178 if (str2my_decimal(E_DEC_FATAL_ERROR & ~E_DEC_BAD_NUM,
179 res->ptr(), res->length(), res->charset(),
180 decimal_value) & E_DEC_BAD_NUM)
181 {
182 ErrConvString err(res);
183 push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
184 ER_TRUNCATED_WRONG_VALUE,
185 ER(ER_TRUNCATED_WRONG_VALUE), "DECIMAL",
186 err.ptr());
187 }
188 return decimal_value;
189}
190
191double Item::val_real_from_decimal()
192{

Callers

nothing calls this directly

Calls 6

val_strFunction · 0.85
push_warning_printfFunction · 0.85
str2my_decimalFunction · 0.70
ptrMethod · 0.45
lengthMethod · 0.45
charsetMethod · 0.45

Tested by

no test coverage detected