← Back to team overview

maria-developers team mailing list archive

Re: ab62059bbd4: MDEV-27009 Add UCA-14.0.0 collations - Adding implicit weight handling for Unicode-14.0.0

 

Hi, Alexander,

I believe it's ok too,
but see a couple of questions below

On Mar 14, Alexander Barkov wrote:
> revision-id: ab62059bbd4 (mariadb-10.6.1-332-gab62059bbd4)
> parent(s): 5fe33342399
> author: Alexander Barkov
> committer: Alexander Barkov
> timestamp: 2022-02-28 10:31:06 +0400
> message:
> 
> MDEV-27009 Add UCA-14.0.0 collations - Adding implicit weight handling for Unicode-14.0.0
> 
> diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
> index ad0b46ea296..eb6bc2eb9e6 100644
> --- a/strings/ctype-uca.c
> +++ b/strings/ctype-uca.c
> @@ -31694,7 +31694,7 @@ static inline void
>  my_uca_implicit_weight_put(uint16 *to, my_wc_t code, uint level)
>  {
>    MY_UCA_IMPLICIT_WEIGHT weight;
> -  weight= my_uca_520_implicit_weight_on_level(code, level);
> +  weight= my_uca_implicit_weight_on_level(520, code, level);

will the version always be a constant in every invocation of
my_uca_implicit_weight_put() ?

>    to[0]= weight.weight[0];
>    to[1]= weight.weight[1];
>    to[2]= 0;
> diff --git a/strings/ctype-uca.h b/strings/ctype-uca.h
> index 01f655b06cb..d439b8c578c 100644
> --- a/strings/ctype-uca.h
> +++ b/strings/ctype-uca.h
> @@ -136,11 +149,11 @@ my_uca_implicit_weight_quaternary()
>  
>  
>  static inline MY_UCA_IMPLICIT_WEIGHT
> -my_uca_520_implicit_weight_on_level(my_wc_t code, uint level)
> +my_uca_implicit_weight_on_level(uint version, my_wc_t code, uint level)
>  {
>    switch (level) {
>    case 0:
> -    return my_uca_520_implicit_weight_primary(code);
> +    return my_uca_implicit_weight_primary(version, code);
>    case 1:
>      return my_uca_implicit_weight_secondary();
>    case 2:

do you mean that secondary/tertiary/etc weights do not depend on the
version?

Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx