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

Function double_from_string_with_check

sql/item.cc:1353–1372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1351
1352
1353double
1354double_from_string_with_check (const CHARSET_INFO *cs,
1355 const char *cptr, char *end)
1356{
1357 int error;
1358 char *org_end;
1359 double tmp;
1360
1361 org_end= end;
1362 tmp= my_strntod(cs, (char*) cptr, end - cptr, &end, &error);
1363 if (error || (end != org_end && !check_if_only_end_space(cs, end, org_end)))
1364 {
1365 ErrConvString err(cptr, org_end - cptr, cs);
1366 push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
1367 ER_TRUNCATED_WRONG_VALUE,
1368 ER(ER_TRUNCATED_WRONG_VALUE), "DOUBLE",
1369 err.ptr());
1370 }
1371 return tmp;
1372}
1373
1374
1375double Item_string::val_real()

Callers 1

val_realMethod · 0.85

Calls 3

check_if_only_end_spaceFunction · 0.85
push_warning_printfFunction · 0.85
ptrMethod · 0.45

Tested by

no test coverage detected