[MDEV-7769] MY_CHARSET_INFO refactoring Created: 2015-03-13 Updated: 2016-10-10 Resolved: 2016-10-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Character Sets |
| Fix Version/s: | 10.2.3 |
| Type: | Task | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | refactoring | ||
| Issue Links: |
|
||||||||||||
| Sprint: | 10.2.0-6, 10.2.0-7, 10.2.1-1, 10.2.1-2 | ||||||||||||
| Description |
|
Some functions in MY_CHARSET_HANDLER are not good enough and new more powerful functions have been added as replacements. This task is to clean-up MY_CHARSET_HANDLER, to remove the functions that have replacements. We'll try to preserve API as much as possible, in case some plugins use the old functions (but ABI will change!). 1. Remove ismbchar() from MY_CHARSET_HANDLER:
and fix the code to use a new function added in 10.1 instead:
charlen() is a more powerful replacement for ismbchar(), as it can additionally:
For API compatibility purposes, the macros my_ismbchar() can be restored as a wrapper
2. Remove mbcharlen() from MY_CHARSET_HANDLER:
and add a new function added in 10.1 instead:
Which will return a combination of flags, e.g.:
For API compatibility purposes, the old macros my_mbcharlen() can be rewritten as a wrapper around cs->cset->byte_property(). 3. Remove well_formed_len:
and use a new function added in 10.1 instead:
The new function is a replacement for well_formed_len() and numchars() at the same time, it can return: |