| 1661 | */ |
| 1662 | |
| 1663 | size_t build_normalized_name(char *buff, size_t bufflen, |
| 1664 | const char *db, size_t db_len, |
| 1665 | const char *table_name, size_t table_len, |
| 1666 | size_t suffix_len) |
| 1667 | { |
| 1668 | uint errors; |
| 1669 | size_t length; |
| 1670 | char *pos= buff, *end= buff+bufflen; |
| 1671 | DBUG_ENTER("build_normalized_name"); |
| 1672 | |
| 1673 | (*pos++)= FN_LIBCHAR; |
| 1674 | length= strconvert(system_charset_info, db, db_len, |
| 1675 | &my_charset_filename, pos, bufflen - 3, |
| 1676 | &errors); |
| 1677 | pos+= length; |
| 1678 | (*pos++)= FN_LIBCHAR; |
| 1679 | length= strconvert(system_charset_info, table_name, table_len, |
| 1680 | &my_charset_filename, pos, (uint) (end - pos), |
| 1681 | &errors); |
| 1682 | pos+= length; |
| 1683 | if (pos + suffix_len < end) |
| 1684 | pos= strmake(pos, table_name + table_len, suffix_len); |
| 1685 | |
| 1686 | DBUG_RETURN((size_t) (pos - buff)); |
| 1687 | } |
| 1688 | |
| 1689 | |
| 1690 | /* |
no test coverage detected