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

Function test_if_number

sql/log.cc:1312–1341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1310*/
1311
1312static bool test_if_number(register const char *str,
1313 ulong *res, bool allow_wildcards)
1314{
1315 reg2 int flag;
1316 const char *start;
1317 DBUG_ENTER("test_if_number");
1318
1319 flag=0; start=str;
1320 while (*str++ == ' ') ;
1321 if (*--str == '-' || *str == '+')
1322 str++;
1323 while (my_isdigit(files_charset_info,*str) ||
1324 (allow_wildcards && (*str == wild_many || *str == wild_one)))
1325 {
1326 flag=1;
1327 str++;
1328 }
1329 if (*str == '.')
1330 {
1331 for (str++ ;
1332 my_isdigit(files_charset_info,*str) ||
1333 (allow_wildcards && (*str == wild_many || *str == wild_one)) ;
1334 str++, flag=1) ;
1335 }
1336 if (*str != 0 || flag == 0)
1337 DBUG_RETURN(0);
1338 if (res)
1339 *res=atol(start);
1340 DBUG_RETURN(1); /* Number ok */
1341} /* test_if_number */
1342
1343
1344void sql_perror(const char *message)

Callers 1

find_uniq_filenameFunction · 0.85

Calls 1

atolFunction · 0.85

Tested by

no test coverage detected