简体   繁体   中英

MySQL stored procedure query become case sensitive but simple query returns results without case sensitive

I am using AWS MySQL database and have issue in stored procedure. When I run below query it gives me perfect result, but when i put the same query in stored procedure it returns Null result just because my search keyword is in small letters and table data in capital.

this is my query

select * from product where product_name like concat(in_search_keyword,'%');

In table product name is eg "One Plus 6T" and when i pass 'one' in in_search_keyword it gives me null, at the same time when i run this simple query without SP it gives me 1 row.

I have tried solution like changing collation to utf8_general_ci but it didn't work.

My collations are like this

collation_connection : utf8mb4_general_ci

collation_database : utf8_general_ci

collation_server : latin1_swedish_ci

我通过将整个数据库,表和列更改为utf8mb4_unicode_ci找到了解决方案

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM