[#722] Remove casting of bind values to appropriate type in Ingres
This commit is contained in:
parent
ac6cb86cfe
commit
34a153f556
@ -35,6 +35,7 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Factory.field;
|
||||
import static org.jooq.impl.Factory.function;
|
||||
import static org.jooq.impl.Factory.inline;
|
||||
|
||||
@ -76,6 +77,20 @@ class Substring extends AbstractFunction<String> {
|
||||
}
|
||||
}
|
||||
|
||||
// [#722] For undocumented reasons, Ingres needs explicit casting
|
||||
case INGRES: {
|
||||
if (getArguments().length == 2) {
|
||||
return field("{substring}({0}, {cast}({1} {as integer}))",
|
||||
SQLDataType.VARCHAR,
|
||||
getArguments());
|
||||
}
|
||||
else {
|
||||
return field("{substring}({0}, {cast}({1} {as integer}), {cast}({2} {as integer}))",
|
||||
SQLDataType.VARCHAR,
|
||||
getArguments());
|
||||
}
|
||||
}
|
||||
|
||||
case DB2:
|
||||
case DERBY:
|
||||
case ORACLE:
|
||||
|
||||
@ -158,9 +158,6 @@ class Val<T> extends AbstractField<T> implements Param<T> {
|
||||
case H2:
|
||||
case HSQLDB:
|
||||
|
||||
// [#722] TODO This is probably not entirely right.
|
||||
case INGRES:
|
||||
|
||||
// [#1261] There are only a few corner-cases, where this is
|
||||
// really needed. Check back on related CUBRID bugs
|
||||
case CUBRID:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user