Ask a Question related to MySQL, Design and Development.
Recently, someone has told me that they've been able to run queries
written like "ins/**/ert ..." work on their server. I've tried it on
two different servers and can't seem to do it (never-mind the fact that
it seems kinda stupid). This has left me wondering... why can they do
it and I can't? Does the server have to be configured in a certain way
for it to work? Does it need to be a certain version of MySQL? Or are
they just pulling my leg?
Bill Karwin #2
yawnmoth wrote:> written like "ins/**/ert ..." work on their server.
> Does it need to be a certain version of MySQL?
Browser. I'd guess that the mysql shell is stripping out the comments
before executing the statement. So any other environment (Java, PHP,
ODBC, etc.) that doesn't do this comment pre-processing probably will
generate an error.
mysql> sel/**/ect 1;
| 1 |
| 1 |
1 row in set (0.00 sec)
Bill Karwin Guest
Mike Lischke #3
Bill Karwin wrote
>Seems to work on 5.0.21 in the mysql shell, but not in MySQL Query
all the comments. This usually works fine if the comments do not split
identifiers. Actually, most programming languages do not allow comments
within identifiers. It seems the MySQL shell tries to be clever here and
hence confuses people.
The general rule for comments is: they are allow everywhere where a
whitespace is allowed.
Mike Lischke, Software Engineer GUI
MySQL AB, [url]www.mysql.com[/url]
Mike Lischke Guest