Hi, Alexander,

On Jan 22, Alexander Barkov wrote:
> revision-id: 33e36944232 (mariadb-10.6.20-19-g33e36944232)
> parent(s): 25be7da2024
> author: Alexander Barkov
> committer: Alexander Barkov
> timestamp: 2024-11-14 10:19:24 +0400
> message:
> 
> MDEV-30111 InnoDB: Failing assertion: update->n_fields == 0 in 
> row_ins_sec_index_entry_by_modify
> 
> Also fixes:
> 
>  MDEV-32190 Index corruption with unique key and nopad collation (without 
> DESC or HASH keys)
> 
> The code in strings/strcoll.inl when comparing an empty string
> to a string like 0x0001050001 did not take into account
> that the leftmost weight in the latter can be zero, while
> there are some more weights can follow the zero weight.
> 
> Rewriting the code to treat the shorter string as smaller than
> a longer string.
> 
> --- a/strings/strcoll.inl
> +++ b/strings/strcoll.inl
> @@ -192,10 +192,10 @@ MY_FUNCTION_NAME(strnncoll)(CHARSET_INFO *cs 
> __attribute__((unused)),
>        >0      >0     Two weights were scanned, check weight difference.
>      */
>      if (!a_wlen)
> -      return b_wlen ? -b_weight : 0;
> +      return b_wlen ? -1 : 0;
>  
>      if (!b_wlen)
> -      return b_is_prefix ? 0 : a_weight;
> +      return b_is_prefix ? 0 : +1;
>  
>      if ((res= (a_weight - b_weight)))
>        return res;

Sorry, I don't understand it. The function returns >0, 0, or <0.
It shouldn't matter whether it returns -b_weight or -1, a_weight or +1.
Except if the weight can be <= 0 itself. But in that case,

    if ((res= (a_weight - b_weight)))
      return res;

is rather suspicious too.

Regards,
Sergei
Chief Architect, MariaDB Server
and secur...@mariadb.org
_______________________________________________
developers mailing list -- developers@lists.mariadb.org
To unsubscribe send an email to developers-le...@lists.mariadb.org

Reply via email to