Check TYPELIB (set or enum) max and total lengths SYNOPSIS calculate_interval_lengths() cs charset+collation pair of the interval typelib list of values for the column max_length length of the longest item tot_length sum of the item lengths DESCRIPTION After this function call: - ENUM uses max_length - SET uses tot_length. RETURN VALU
| 698 | void |
| 699 | */ |
| 700 | static void calculate_interval_lengths(const CHARSET_INFO *cs, |
| 701 | TYPELIB *interval, |
| 702 | uint32 *max_length, |
| 703 | uint32 *tot_length) |
| 704 | { |
| 705 | const char **pos; |
| 706 | uint *len; |
| 707 | *max_length= *tot_length= 0; |
| 708 | for (pos= interval->type_names, len= interval->type_lengths; |
| 709 | *pos ; pos++, len++) |
| 710 | { |
| 711 | size_t length= cs->cset->numchars(cs, *pos, *pos + *len); |
| 712 | *tot_length+= length; |
| 713 | set_if_bigger(*max_length, (uint32)length); |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | |
| 718 |
no test coverage detected