Having some MySQL trouble.
To be specific, I have written a stored procedure to take in a few inputs, one of which is a comma-delimited list, for a dynamic query.
For example:
SET @var1 = 10;
SET @var2 = 'banana';
SET @var3 = "\'Thing1\', \'Thing2\'";
CALL my_stored_proc(@var1, @var2, @var3);
The stored procedure code itself looks at the passed-in list, in this case @var3, and checks for membership. Looks like this in the procedure:
SELECT item, some_stuff FROM table
WHERE item IN (variable3)
GROUP BY item;
Now, I've looked at @var3 and the raw output seems to be fine. When I copy and paste the text directly in, replacing variable3 in the 'IN(variable3)' statement, the query works as expected!
Tried passing in the double-quote-single-quote-escaped bit (see @var3) to the CALL directly, and still no luck.
Any help would be greatly appreciated.