I am trying to search for a substring, but I have problems with Cyrillic.

select * from `posts` where "Текст" LIKE CONCAT("%", `substr_ru`, "%"); 

For some reason, this query displays to me absolutely all entries in which substr_ru is an empty string and completely ignores the contents of the "Text".

While with a Latin everything works without problems.

 select * from `posts` where "Text" LIKE CONCAT("%", `substr_en`, "%"); 

Exactly the same behavior is observed with the functions instr and position . Cyrillic works adequately with other operators, for example:

 select * from `posts` where "Текст" = substr_ru; 
  • Use N before the literal? - Alexander Petrov
  • @AlexanderPetrov, how can I add N for the result that came from the concat function? - Artemy
  • Something like CONCAT(N'%', N'substr', N'%') . - Alexander Petrov
  • @AlexanderPetrov, if everything was so simple, then concatenation was not needed. You need to add to substr_ru , and not just to the string. Maybe there are some analogs for N that can do this with fields? Search does not produce results. - Artemy 2:32 pm

0