I'm running MonetDB on Ubuntu 10.04, with Monet built from the Oct2012_release tag.

I have a client program that connects using the JDBC driver and issues a simple SQL query using limit and offset.

I see that:

- limit and offset work when using literal parameters in the SQL string
- limit works by itself when using a bind parameter
- offset works by itself when using a bind parameter
- when specifying both limit and offset and using a bind parameter for either or both, the merovingian segfaults with a message like this:

database 'click' (2428) was killed by signal SIGSEGV

Examples of queries that work:

SELECT * FROM the_table LIMIT 5 OFFSET 100;
SELECT * FROM the_table LIMIT ?;
SELECT * FROM the_table OFFSET ?;

Example of queries that don't work:

SELECT * FROM the_table LIMIT ? OFFSET ?;
SELECT * FROM the_table LIMIT 5 OFFSET ?;
SELECT * FROM the_table LIMIT ? OFFSET 100;

I've tried passing in the limit and offset as 64 bit integers (long), 32 bit integers (int) and strings, and none of these work.

I also tried downgrading to MonetDB Database Server v1.6 (Jul2012-SP2) but had the same issue.

Has anyone else run into this?  Is this a new bug that I should file?

Thanks,
Percy Wegmann