[jOOQ/jOOQ#10408] Error in Sybase ASE INSERT .. DEFAULT VALUES emulation when used with identity column
This commit is contained in:
parent
5bf67a30c8
commit
b16664d1ec
@ -55,6 +55,7 @@ import static org.jooq.SQLDialect.MYSQL;
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.impl.DSL.constraint;
|
||||
import static org.jooq.impl.DSL.defaultValue;
|
||||
import static org.jooq.impl.DSL.dual;
|
||||
import static org.jooq.impl.DSL.falseCondition;
|
||||
import static org.jooq.impl.DSL.name;
|
||||
@ -677,6 +678,22 @@ final class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -685,13 +702,9 @@ final class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
|
||||
case DERBY:
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
ctx.formatSeparator()
|
||||
.visit(K_VALUES)
|
||||
.sql(" (")
|
||||
.visit(wrap(nCopies(table().fields().length, K_DEFAULT)))
|
||||
.sql(')');
|
||||
|
||||
acceptDefaultValuesEmulation(ctx, table().fields().length);
|
||||
break;
|
||||
|
||||
default:
|
||||
ctx.formatSeparator()
|
||||
.visit(K_DEFAULT_VALUES);
|
||||
@ -713,6 +726,14 @@ final class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
|
||||
}
|
||||
}
|
||||
|
||||
private final void acceptDefaultValuesEmulation(Context<?> ctx, int length) {
|
||||
ctx.formatSeparator()
|
||||
.visit(K_VALUES)
|
||||
.sql(" (")
|
||||
.visit(wrap(nCopies(length, K_DEFAULT)))
|
||||
.sql(')');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user