Potentially off-by-one when setting SQL prepared statement parameters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Querydsl |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hello.
Since using the SQL flavor of QueryDSL, I've noted that sometimes, when setting named parameters, queryDSL would successfully generate the SQL query for my entities, however, it would throw an excception similar to the following:
java.lang.
at com.mysema.
at com.mysema.
at com.mysema.
at com.mysema.
I believe the issue might still be present in release 2.0.9.
Example generated query:
8178 [main] DEBUG com.mysema.
select count(t.ID) TCount, to_char(
where t.CREATION_DATE >= ?
and t.CREATION_DATE <= ?
and t.MERCHANT_ID != ?
and t.RP_CONFIRMATI
and t.RP_CONFIRMATI
and cast(substr(
group by to_char(
order by to_date(
I traced this error down to the method.
com.mysema.
And the following code segment:
int size = ((Collection)
for (int i = 0; i < size; i++){
}
Incrementing 'size' by one while debugging avoided the exception for me, and the query generated and ran successfully.
Is there any special reason for which the first line should not be instead:
int size = ((Collection)
Please let me know if there's anything I may be missing, or if there's anything else I could do or specify to help.
Thanks for your time!
Addendum 1: My apologies, meant 'JDBC parameters' instead of 'named parameters' since we're dealing with positional jdbc parameters :P. Thanks!