LIMIT[*] inserted into query?

818 views
Skip to first unread message

Peter Borissow

unread,
Sep 24, 2019, 10:30:42 PM9/24/19
to H2 Database
Hello,
    I just upgraded my h2 jdbc driver from h2-1.4.197.jar to h2-1.4.199.jar and ran into an odd exception. My query is simple:

select date,description,amount from transaction offset 0 limit 50

Here's the error:

org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SELECT DATE,DESCRIPTION,AMOUNT FROM TRANSACTION OFFSET 0 LIMIT[*] 50 "; SQL statement:
select date,description,amount from transaction offset 0 limit 50 [42000-199]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
        at org.h2.message.DbException.get(DbException.java:205)
        at org.h2.message.DbException.get(DbException.java:181)
        at org.h2.message.DbException.getSyntaxError(DbException.java:229)
        at org.h2.command.Parser.getSyntaxError(Parser.java:989)
        at org.h2.command.Parser.prepareCommand(Parser.java:686)



I'm not sure what's wrong or whether this is a known issue. Downgrading to h2-1.4.197.jar for now.

Thanks,
Peter

Noel Grandin

unread,
Sep 25, 2019, 2:30:44 AM9/25/19
to h2-da...@googlegroups.com
On Wed, 25 Sep 2019 at 04:30, 'Peter Borissow' via H2 Database <h2-da...@googlegroups.com> wrote:
select date,description,amount from transaction offset 0 limit 50


swap that to
select date,description,amount from transaction limit 50 offset 0 

at some point we became a little stricter about syntax
Reply all
Reply to author
Forward
0 new messages