Here is the simplified query that doesn't work.
SET @abc = CONCAT('%','string','%');
SET @query = CONCAT('SELECT *
FROM table
WHERE column LIKE ',@abc);
PREPARE stmt FROM @query;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
I need to use CONCAT with SELECT because there lots of other variables in real query.
Real query works fine when I use some simple COLUMN=xyz in WHERE clause. But nothing works when I try to use LIKE %xyz%...