I’ve encountered a problem where I need to hunt through a field holding HTML with a LIKE clause searching for the semicolon character but N8N will not escape the ; and splits my SQL into multiple statements. I’ve also tried setting the node for a SELECT with a LIKE option and the value being %;% and it treats the SQL the same way. I’ve tried out other delimiters with the same result. Is there a way to get N8N to respect escaping the delimiter?
I tried reproducing this, but while the query returned in the sql field looks pretty rubbish (and I’ll definitely add this to our bug tracker for a fix) am getting the kind of result I’d expect using the latest version of the MySQL node.
My data looks like so, having one row with a semicolon and one without:
The query only returns the one with the semicolon as expected:
Look at your results, the sql statement ends at the escape character. Add multiple rows in your sample data with a semicolon as a return result and you will see what I am talking about.
Yep, I noticed that part and have already added this to our bug tracker for a closer look and fix.
I did however not notice any problem with the actual results in the data column. Even with multiple rows containing a semicolon I am getting the expected response:
I’ve also seen this and documented it in the bug ticket.
However, with this option enabled I am getting the expected result count. Are you seeing the very same behaviour?
E.g. the problem only occurring in the sql field (but not the results in the data field) when enabling “Output Query Execution Details”, or when disabling “Output Query Execution Details”?
Yes, it gives the correct result back, it’s just the behavior is off. You can also reproduce the same results with setting the node to just be a select with a like filter
Just for anyone else having the issue that runs across this thread, I do have a workaround for it until the behavior is fixed. Replacing the semicolon with the char() value works.
SELECT m.custom_ship_time FROM zuri.models m WHERE m.custom_ship_time LIKE CONCAT(‘%’,char(59),‘%’) LIMIT 10;
I was just deciding whether to look up the char code for a semicolon and see if that helped, or to report the issue here first, and apparently I can do both together. Thanks!