← Back to team overview

maria-discuss team mailing list archive

Re: Collations, trailing spaces and unique indexes

 

Hi,

On 03/16/2016 09:59 AM, Alexander Barkov wrote:
...
>>
>> - My main problem: I did not find my_strnncollsp_utf8_general_ci anywhere (nor in the same neither in any other file). Where is it?
> 
> 
> The function name is just "my_strnncollsp_utf8".
> 

A correction.

In 10.0 and earlier versions the name was "my_strnncollsp_utf8".


In 10.1 it was renamed to "my_strnncollsp_utf8_general_ci".

It's defined in this piece of the code in ctype-utf8.c:

#define MY_FUNCTION_NAME(x)    my_ ## x ## _utf8_general_ci
#define WEIGHT_ILSEQ(x)        (0xFF0000 + (uchar) (x))
#define WEIGHT_MB1(x)          my_weight_mb1_utf8_general_ci(x)
#define WEIGHT_MB2(x,y)        my_weight_mb2_utf8_general_ci(x,y)
#define WEIGHT_MB3(x,y,z)      my_weight_mb3_utf8_general_ci(x,y,z)
#include "strcoll.ic"


and the function body is defined in a shared file strcoll.ic,
which is reused for many character sets to avoid duplicate code,
here:

> static int
> MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)),
>                               const uchar *a, size_t a_length, 
>                               const uchar *b, size_t b_length,
>                               my_bool diff_if_only_endspace_difference
>                               __attribute__((unused)))
> {


References