Re: Negative LIMIT and OFFSET?
| От | Tom Lane |
|---|---|
| Тема | Re: Negative LIMIT and OFFSET? |
| Дата | |
| Msg-id | 5443.1197867291@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Negative LIMIT and OFFSET? (Bruce Momjian <bruce@momjian.us>) |
| Ответы |
Re: Negative LIMIT and OFFSET?
|
| Список | pgsql-hackers |
Bruce Momjian <bruce@momjian.us> writes:
> Since we got LIMIT/OFFSET from MySQL, would someone tell us how MySQL
> behaves in these cases?
Not very well, at least not in mysql 5.0.45:
mysql> select * from t limit -2;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
versionfor the right syntax to use near '-2' at line 1
mysql> select * from t limit 2 offset -2;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
versionfor the right syntax to use near '-2' at line 1
This behavior suggests that they can't even deal with LIMIT/OFFSET
values that aren't simple integer literals ...
regards, tom lane
В списке pgsql-hackers по дате отправления: