andialbrecht / crunchyfrog

Head over to RunSQLRun, the successor of CrunchyFrog
http://runsqlrun.org
GNU General Public License v3.0
4 stars 2 forks source link

Comments - Still parsed #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Write two simple querys
2. Comment one of them using double dashs
3. F5, Error on commented one

Commenting querys using /* */ works fine, but querys commented using -- are
still parsed.

Original issue reported on code.google.com by lostsec...@gmail.com on 10 Nov 2008 at 7:10

Attachments:

GoogleCodeExporter commented 9 years ago
hm, according to MySQL's documentation your statement is syntactically wrong. 
The
second dash needs to be followed by at least one whitespace
(http://dev.mysql.com/doc/refman/5.1/en/comments.html). If I add one, everything
works as expected.

But I think you've hit another bug. There's a strange behavior when executing

select * from user;
--select * from host;
select * from user;

The parser recognizes three queries but it should ignore the commented one. And 
in
addition the application doesn't stop the execution after the (failing) second 
query.

Original comment by albrecht.andi on 10 Nov 2008 at 8:56

GoogleCodeExporter commented 9 years ago
haa ok.

its different from the standard bug is a MySQL thing.

No problem

Original comment by lostsec...@gmail.com on 10 Nov 2008 at 9:52

GoogleCodeExporter commented 9 years ago
correcting:  ...its different from the standard but is a MySQL thing...

Original comment by lostsec...@gmail.com on 10 Nov 2008 at 10:06

GoogleCodeExporter commented 9 years ago

Original comment by albrecht.andi on 11 Nov 2008 at 8:53

GoogleCodeExporter commented 9 years ago
Fixed in r304.

The example from comment #1 still fails, but that's because of the missing 
whitespace
after the second dash that is required by MySQL.

The parser now sees two statements in this case.

Original comment by albrecht.andi on 11 Nov 2008 at 10:21