mysql 4.0.15-log limit syntax bug

mysql 4.0.15-log limit syntax bug

am 30.09.2003 12:49:52 von Attila Soki

hi,

i found a strange bug in mysql 4.0.15-log, the server accepts queries
with bad syntax. see example. i think for limit1 (without space)
should come some error message. or?

how to repeat:
mysql> use mysql
Database changed
mysql> select Host from user limit1;
+-----------+
| Host |
+-----------+
| % |
| test |
| localhost |
| localhost |
+-----------+
4 rows in set (0.00 sec)

mysql> select Host from user limit 1;
+------+
| Host |
+------+
| % |
+------+
1 row in set (0.00 sec)

--
best regards
Attila Soki mailto:atiware@gmx.net


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: mysql 4.0.15-log limit syntax bug

am 30.09.2003 12:55:00 von Georg Richter

> hi,
>
> i found a strange bug in mysql 4.0.15-log, the server accepts queries
> with bad syntax. see example. i think for limit1 (without space)
> should come some error message. or?

Why do you think it it is a bug?

select * from yourtable limit1 is ok - limit1 is an alias for tablename

like
select limit1.* from yourtable limit1

Georg

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: mysql 4.0.15-log limit syntax bug

am 30.09.2003 13:05:14 von Dan Si

Hello Attila,

Tuesday, September 30, 2003, 6:49:52 AM, you wrote:

AS> i found a strange bug in mysql 4.0.15-log, the server accepts
AS> queries with bad syntax. see example. i think for limit1 (without
AS> space) should come some error message. or?
It's not a bug actually, see below.

AS> how to repeat:
mysql>> use mysql
AS> Database changed
mysql>> select Host from user limit1;
This query is interpreted as follows:
select
`Host`
from
`user` as `limit1`

i.e. `limit1` now is alias to `user` table.
since `limit1` is not a reserved word in SQL, query won't fail.

--
To receive my PGP public key send letter with subject "Get PGP public
key" to weirdan@ukr.net.

WBR, D.S. AKA Weirdan mailto:weirdan@ukr.net


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re[2]: mysql 4.0.15-log limit syntax bug

am 30.09.2003 13:06:22 von Attila Soki

G> Why do you think it it is a bug?
G> select * from yourtable limit1 is ok - limit1 is an alias for tablename
ok.. :) i understand it.. sorry for the bugreport.. i am tired..

ati


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org