WL#3804: WEIGHT_STRING deferred features

Affects: Server-7.1   —   Status: Un-Assigned

For WL#3716, some features were deferred. When
MySQL has more support for multi-level collations,
these features should be looked at again.

This description is, mostly, copied from WL#3716.

For "LEVELS ...":

And eventually (though not for WL#3716) there could be combinations:
LEVEL ALL                  /* Every level the collation can have */
LEVEL ALL FOR COMPARE      /* All normally used for "WHERE" */
LEVEL ALL FOR ORDER        /* All normally used for "ORDER BY" */
("FOR COMPARE" means "for WHERE, DISTINCT, MIN, etc."; we know
that ORDER BY involves comparison too but couldn't think of any
better words, after considering FOR WHERE and FOR EQUALITY.)
Incidentally, "LEVEL ALL" could be the same as "LEVEL 1,2,3,4,5,6"
for a Japanese collation containing the four levels of WL#2555, plus
a fifth-level comparison for putting halfwidth before
fullwidth, plus level6 = where "ignorable" values
would be shifted. It's very likely that 6 is the "maximum maximum".

"flags" is something that we'll use for special cases.
In version 5.2 there are, as yet, no defined flags.
For the long term Peter and Bar should think about:

VARIABLE_BLANK | VARIABLE_NON_IGNORABLE | VARIABLE_SHIFTED
What do do with UCA "Variable Weighting" characters.

NULLS_HIGH | NULLS_LOW | NULLS_FIRST | NULLS_LAST | NULLS_NULL
Return for NULL can be maximum, minimum, suprememum, infimum, or NULL.
Probably this only has practical meaning for Level 1.

COMPRESS
Don't take a full byte for a tertiary upper|lower case difference.
This is primarily useful for Level 2 and later, since the number
of choices (different kinds of accent, different kinds of case, etc.)
is less than 256.

VERSION_UCA_4_0 | VERSION_UCA_5_0
The version of Unicode allkeys, 4.0.0 or 5.0.0.

NORMALIZE
IBM's ICU allows "normalization off/on" flags.

"LEVEL x, x - 1"
----------------

Peter's original hope was that expresions like
"LEVEL 3,2" would mean that one treated level
3 as being higher priority than level 2 (good
for compatibility with Microsoft Japanese quirks).
But that is not to be. Instead, MySQL will give a
syntax error if, in a list of levels, it encounters
a level which has a lower number than a level
mentioned earlier in the list.
"