<div dir="ltr"><div><div>Hi all,<br><br>I'm trying to fix bug #3865[1] and I have some queries regarding the expected behavior that I'd like to get clarified.<br><br></div><div>MySQL LIKE clause takes a regular expression as its argument[2]. In the table search interface phpMyAdmin facilitate querying a field with a LIKE clause by letting the user select the option from a drop down. <br>
<br>So I'd like to know whether phpMyAdmin should consider the text entered by the user to be a regular expression (and pass it as it is) or consider it to be the text to match (and do the necessary escaping)?<br><br>
</div><div>If we are to escape the user entered text following are some of the replacements that should be done<br>% => \%<br>_ => \_<br></div><div>\ => \\ (at the end of the text) or \\\\ (any where else in the text)<br>
</div><div>\n => \\n<br><br></div><div>If we escape the user entered text, user cannot query with MySQL wildcards % and _, limiting the full power of MySQL pattern matching.<br><br></div><div>I would be grateful if you could clarify the expected behavior.<br>
</div><div><br></div><div>Thanks in advance.<br></div><div><br>--<br></div>Regards<br></div>Kasun Chathuranga<br><br>[1] <a href="http://sourceforge.net/p/phpmyadmin/bugs/3865/">http://sourceforge.net/p/phpmyadmin/bugs/3865/</a><br>
[2] <a href="http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like">http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like</a><br></div>