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

Function longlong_from_string_with_check

sql/item.cc:1383–1407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1381
1382
1383longlong
1384longlong_from_string_with_check (const CHARSET_INFO *cs,
1385 const char *cptr, char *end)
1386{
1387 int err;
1388 longlong tmp;
1389 char *org_end= end;
1390
1391 tmp= (*(cs->cset->strtoll10))(cs, cptr, &end, &err);
1392 /*
1393 TODO: Give error if we wanted a signed integer and we got an unsigned
1394 one
1395 */
1396 if (!current_thd->no_errors &&
1397 (err > 0 ||
1398 (end != org_end && !check_if_only_end_space(cs, end, org_end))))
1399 {
1400 ErrConvString err(cptr, cs);
1401 push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
1402 ER_TRUNCATED_WRONG_VALUE,
1403 ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER",
1404 err.ptr());
1405 }
1406 return tmp;
1407}
1408
1409
1410/**

Callers 1

val_intMethod · 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