| 284 | |
| 285 | |
| 286 | static bool parse_table_name(const char *name, size_t name_length, |
| 287 | ulonglong *from, ulonglong *to, ulonglong *step) |
| 288 | { |
| 289 | uint n0=0, n1= 0, n2= 0; |
| 290 | *step= 1; |
| 291 | |
| 292 | // the table is discovered if its name matches the pattern of seq_1_to_10 or |
| 293 | // seq_1_to_10_step_3 |
| 294 | sscanf(name, "seq_%llu_to_%n%llu%n_step_%llu%n", |
| 295 | from, &n0, to, &n1, step, &n2); |
| 296 | // I consider this a bug in sscanf() - when an unsigned number |
| 297 | // is requested, -5 should *not* be accepted. But is is :( |
| 298 | // hence the additional check below: |
| 299 | return |
| 300 | n0 == 0 || !isdigit(name[4]) || !isdigit(name[n0]) || // reject negative numbers |
| 301 | (n1 != name_length && n2 != name_length); |
| 302 | } |
| 303 | |
| 304 | |
| 305 | Sequence_share *ha_seq::get_share() |
no outgoing calls
no test coverage detected