[#3400] ALTER TABLE generates invalid syntax on Firebird when data types are nullable

This commit is contained in:
Lukas Eder 2014-07-16 11:02:16 +02:00
parent c1033c2928
commit 6171b31ac9

View File

@ -46,6 +46,7 @@ import static org.jooq.Clause.ALTER_TABLE_ALTER;
import static org.jooq.Clause.ALTER_TABLE_ALTER_DEFAULT;
import static org.jooq.Clause.ALTER_TABLE_DROP;
import static org.jooq.Clause.ALTER_TABLE_TABLE;
import static org.jooq.SQLDialect.FIREBIRD;
// ...
import static org.jooq.impl.DSL.field;
import static org.jooq.impl.DSL.inline;
@ -203,8 +204,9 @@ class AlterTableImpl extends AbstractQuery implements
ctx.sql(" ").keyword("not null");
}
// Some databases default to NOT NULL, so explicitly setting columns to NULL is required here
else {
// Some databases default to NOT NULL, so explicitly setting columns to NULL is mostly required here
// [#3400] ... but not in Firebird
else if (family != FIREBIRD) {
ctx.sql(" ").keyword("null");
}