Ask a Question related to MySQL, Design and Development.
-
yawnmoth #1
ins/**/ert??
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?
yawnmoth Guest
-
Bill Karwin #2
Re: ins/**/ert??
yawnmoth wrote:
Seems to work on 5.0.21 in the mysql shell, but _not_ in MySQL Query> 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)
Regards,
Bill K.
Bill Karwin Guest
-
Mike Lischke #3
Re: ins/**/ert??
Bill Karwin wrote
Correct, MySQL Query Browser sends the statements as they are, including>Seems to work on 5.0.21 in the mysql shell, but not in MySQL Query
>Browser.
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
--
Mike Lischke, Software Engineer GUI
MySQL AB, [url]www.mysql.com[/url]
Mike Lischke Guest



Reply With Quote

