Skip to content

Commit

Permalink
[#4650] Fixed regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaseder committed Mar 24, 2016
1 parent 0776154 commit 485b627
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions jOOQ/src/main/java/org/jooq/impl/DefaultRenderContext.java
Expand Up @@ -40,7 +40,6 @@
*/
package org.jooq.impl;

import static org.jooq.SQLDialect.POSTGRES;
import static org.jooq.SQLDialect.SQLITE;
import static org.jooq.conf.ParamType.INDEXED;
import static org.jooq.conf.ParamType.INLINED;
Expand Down Expand Up @@ -393,23 +392,23 @@ public final RenderContext sql(QueryPart part) {
@SuppressWarnings("deprecation")
@Override
protected final void visit0(QueryPartInternal internal) {
collectBindVariable(internal);
int before = bindValues.size();
internal.accept(this);
}

private final void collectBindVariable(QueryPart part) throws ForceInlineSignal {
if (paramType == INLINED)
return;
int after = bindValues.size();

// [#4650] In PostgreSQL, UDTConstants are always inlined as ROW(?, ?)
// as the PostgreSQL JDBC driver doesn't support SQLData
if (part instanceof Param && (!(part instanceof UDTConstant) || family() != POSTGRES)) {
Param<?> param = (Param<?>) part;
if (param.isInline())
return;
// as the PostgreSQL JDBC driver doesn't support SQLData. This
// means that the above internal.accept(this) call has already
// collected the bind variable. The same is true if custom data
// type bindings use Context.visit(Param), in case of which we
// must not collect the current Param
if (after == before && paramType != INLINED && internal instanceof Param) {
Param<?> param = (Param<?>) internal;

if (!param.isInline()) {
bindValues.add(param);

bindValues.add(param);
switch (configuration().family()) {
switch (family()) {



Expand All @@ -431,12 +430,13 @@ private final void collectBindVariable(QueryPart part) throws ForceInlineSignal



case SQLITE:
checkForceInline(999);
return;
case SQLITE:
checkForceInline(999);
break;

default:
return;
default:
break;
}
}
}
}
Expand Down

0 comments on commit 485b627

Please sign in to comment.