Hi,

I agree this is incorrect. A patch is welcome.

However, could you explain what problem you want to solve?

Regards,
Thomas


On Mon, Mar 9, 2015 at 11:20 AM, Vojtěch Hordějčuk <
vojtech.hordej...@gmail.com
<javascript:_e(%7B%7D,'cvml','vojtech.hordej...@gmail.com');>> wrote:

> update: the same behavior applies to OFFSET ?
>
> Dne pondělí 9. března 2015 10:43:32 UTC+1 Vojtěch Hordějčuk napsal(a):
>
>> Hi, is this a correct behavior?
>>
>> If I prepare statement with a limit statement, e.g. *SELECT * FROM
>> system_range(1,10) LIMIT ?* and then get the parameter meta data, I
>> would get VARCHAR as a data type of the limit related placeholder. I am
>> expecting a numeric data type, because *LIMIT 'abc' *is not a valid call
>> (AFAIK).
>>
>> This is a test case which fails for H2 1.3.171:
>>
>> public class BugDemo {
>>     public static void main(String[] args) throws SQLException {
>>         Connection conn = DriverManager.getConnection("jdbc:h2:mem:test");
>>         PreparedStatement stmt = conn.prepareStatement("SELECT * FROM 
>> system_range(1,10) LIMIT ?");
>>         ParameterMetaData pmd = stmt.getParameterMetaData();
>>         System.out.println("type = " + pmd.getParameterTypeName(1)); // = 
>> VARCHAR (expected numeric)
>>         conn.close();
>>     }
>> }
>>
>>
>>
>> Workaround:
>>
>> just replace "LIMIT ?" with "LIMIT (select id FROM items WHERE id=?)"
>> where id is INTEGER type
>>
>> Thank you for any help or better workaround.
>> Vojta
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to h2-database+unsubscr...@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','h2-database%2bunsubscr...@googlegroups.com');>
> .
> To post to this group, send email to h2-database@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','h2-database@googlegroups.com');>.
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to