mysql 4.0.15-log limit syntax bug

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 [at] gmx.net


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs [at] m.gmane.org
Attila Soki [ Di, 30 September 2003 12:49 ] [ ID #76277 ]

Re: mysql 4.0.15-log limit syntax bug

> 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 [at] m.gmane.org
Georg Richter [ Di, 30 September 2003 12:55 ] [ ID #76278 ]

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

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 [at] m.gmane.org
Attila Soki [ Di, 30 September 2003 13:06 ] [ ID #76279 ]

Re: mysql 4.0.15-log limit syntax bug

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 [at] ukr.net.

WBR, D.S. AKA Weirdan mailto:weirdan [at] ukr.net


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs [at] m.gmane.org
Dan Si [ Di, 30 September 2003 13:05 ] [ ID #76280 ]
Datenbanken » gmane.comp.db.mysql.bugs » mysql 4.0.15-log limit syntax bug

Vorheriges Thema: Fwd: Union not handled properly
Nächstes Thema: Re: fwd: MySQL 4.0.15 / OpenSSL 0.9.7