| 1310 | */ |
| 1311 | |
| 1312 | static 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 | |
| 1344 | void sql_perror(const char *message) |
no test coverage detected