[#4845] Add support for Firebird 3.0
This commit is contained in:
parent
5d65828434
commit
b84b4ec49d
@ -103,6 +103,8 @@ public class Databases {
|
||||
|
||||
case CUBRID: result = CUBRIDDatabase.class; break;
|
||||
case DERBY: result = DerbyDatabase.class; break;
|
||||
case FIREBIRD_2_5:
|
||||
case FIREBIRD_3_0:
|
||||
case FIREBIRD: result = FirebirdDatabase.class; break;
|
||||
case H2: result = H2Database.class; break;
|
||||
case HSQLDB: result = HSQLDBDatabase.class; break;
|
||||
|
||||
@ -65,7 +65,7 @@ class Ascii extends AbstractFunction<Integer> {
|
||||
|
||||
@Override
|
||||
final Field<Integer> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect()) {
|
||||
switch (configuration.family()) {
|
||||
/* [pro] xx
|
||||
xxxx xxxxxxx
|
||||
xxxxxx xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxx
|
||||
|
||||
@ -69,7 +69,7 @@ class Degrees extends AbstractFunction<BigDecimal> {
|
||||
|
||||
@Override
|
||||
final Field<BigDecimal> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
switch (configuration.family()) {
|
||||
/* [pro] xx
|
||||
xxxx xxxxxxx
|
||||
xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
@ -69,7 +69,7 @@ class Greatest<T> extends AbstractFunction<T> {
|
||||
return (Field<T>) getArguments()[0];
|
||||
}
|
||||
|
||||
switch (configuration.dialect().family()) {
|
||||
switch (configuration.family()) {
|
||||
// This implementation has O(2^n) complexity. Better implementations
|
||||
// are very welcome
|
||||
// [#1049] TODO Fix this!
|
||||
|
||||
@ -94,7 +94,7 @@ class InCondition<T> extends AbstractCondition {
|
||||
else if (list.size() > IN_LIMIT) {
|
||||
// [#798] Oracle and some other dialects can only hold 1000 values
|
||||
// in an IN (...) clause
|
||||
switch (ctx.configuration().dialect().family()) {
|
||||
switch (ctx.family()) {
|
||||
/* [pro] xx
|
||||
xxxx xxxxxxx
|
||||
xxxx xxxxxxx
|
||||
|
||||
@ -66,7 +66,7 @@ class LTrim extends AbstractFunction<String> {
|
||||
|
||||
@Override
|
||||
final Field<String> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect()) {
|
||||
switch (configuration.family()) {
|
||||
case FIREBIRD:
|
||||
return field("{trim}({leading} {from} {0})", SQLDataType.VARCHAR, argument);
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ class Least<T> extends AbstractFunction<T> {
|
||||
return (Field<T>) getArguments()[0];
|
||||
}
|
||||
|
||||
switch (configuration.dialect().family()) {
|
||||
switch (configuration.family()) {
|
||||
// This implementation has O(2^n) complexity. Better implementations
|
||||
// are very welcome
|
||||
|
||||
|
||||
@ -168,7 +168,9 @@ class Limit extends AbstractQueryPart {
|
||||
|
||||
// ROWS .. TO ..
|
||||
// -------------
|
||||
case FIREBIRD: {
|
||||
case FIREBIRD:
|
||||
case FIREBIRD_2_5:
|
||||
case FIREBIRD_3_0: {
|
||||
context.castMode(NEVER)
|
||||
.formatSeparator()
|
||||
.keyword("rows")
|
||||
|
||||
@ -75,7 +75,7 @@ class Lpad extends AbstractFunction<String> {
|
||||
|
||||
@Override
|
||||
final Field<String> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
switch (configuration.family()) {
|
||||
/* [pro] xx
|
||||
xxxx xxxxxxx x
|
||||
xxxxxx xxxxxxxxxxxxxxxxxxxxxxxx x xxxxxxxxxx x xx xxxx x xxxxx xxxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxx xxxxxxxxxxx
|
||||
|
||||
@ -66,7 +66,7 @@ class RTrim extends AbstractFunction<String> {
|
||||
|
||||
@Override
|
||||
final Field<String> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect()) {
|
||||
switch (configuration.family()) {
|
||||
case FIREBIRD:
|
||||
return field("{trim}({trailing} {from} {0})", SQLDataType.VARCHAR, argument);
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ class Radians extends AbstractFunction<BigDecimal> {
|
||||
|
||||
@Override
|
||||
final Field<BigDecimal> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
switch (configuration.family()) {
|
||||
/* [pro] xx
|
||||
xxxx xxxxxxx
|
||||
xxxx xxxxx
|
||||
|
||||
@ -67,7 +67,7 @@ class Repeat extends AbstractFunction<String> {
|
||||
|
||||
@Override
|
||||
final Field<String> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
switch (configuration.family()) {
|
||||
/* [pro] xx
|
||||
xxxx xxxxx
|
||||
xxxx xxxxxxxxx
|
||||
|
||||
@ -104,7 +104,7 @@ class RowInCondition extends AbstractCondition {
|
||||
}
|
||||
|
||||
private final QueryPartInternal delegate(Configuration configuration) {
|
||||
if (asList(DERBY, FIREBIRD, SQLITE).contains(configuration.dialect().family())) {
|
||||
if (asList(DERBY, FIREBIRD, SQLITE).contains(configuration.family())) {
|
||||
List<Condition> conditions = new ArrayList<Condition>();
|
||||
|
||||
for (Row row : right) {
|
||||
|
||||
@ -106,7 +106,7 @@ class RowIsNull extends AbstractCondition {
|
||||
|
||||
// CUBRID 9.0.0 and HSQLDB have buggy implementations of the NULL predicate.
|
||||
// Informix doesn't implement the RVE IS NULL predicate.
|
||||
if (asList(CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, SQLITE).contains(configuration.dialect().family())) {
|
||||
if (asList(CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, SQLITE).contains(configuration.family())) {
|
||||
List<Condition> conditions = new ArrayList<Condition>();
|
||||
|
||||
for (Field<?> field : row.fields()) {
|
||||
|
||||
@ -113,7 +113,7 @@ class RowOverlapsCondition<T1, T2> extends AbstractCondition {
|
||||
boolean intervalOverlaps = type0.isDateTime() && (type1.isInterval() || type1.isNumeric());
|
||||
|
||||
// The non-standard OVERLAPS predicate is always emulated
|
||||
if (!standardOverlaps || asList(CUBRID, DERBY, FIREBIRD, H2, MARIADB, MYSQL, SQLITE).contains(configuration.dialect().family())) {
|
||||
if (!standardOverlaps || asList(CUBRID, DERBY, FIREBIRD, H2, MARIADB, MYSQL, SQLITE).contains(configuration.family())) {
|
||||
|
||||
// Interval OVERLAPS predicates need some additional arithmetic
|
||||
if (intervalOverlaps) {
|
||||
|
||||
@ -75,7 +75,7 @@ class Rpad extends AbstractFunction<String> {
|
||||
|
||||
@Override
|
||||
final Field<String> getFunction0(Configuration configuration) {
|
||||
switch (configuration.dialect().family()) {
|
||||
switch (configuration.family()) {
|
||||
/* [pro] xx
|
||||
xxxx xxxxxxx x
|
||||
xxxxxx xxxxxxxxxx x xxxxxxxxxxxxxxxxx x xxxxxxxxxx x xx xxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxx xxxxxxxxxxx
|
||||
|
||||
@ -65,7 +65,7 @@ class Substring extends AbstractFunction<String> {
|
||||
final Field<String> getFunction0(Configuration configuration) {
|
||||
String functionName = "substring";
|
||||
|
||||
switch (configuration.dialect().family()) {
|
||||
switch (configuration.family()) {
|
||||
|
||||
// [#430] Firebird has its own syntax
|
||||
case FIREBIRD: {
|
||||
|
||||
@ -103,7 +103,7 @@ class TruncateImpl<R extends Record> extends AbstractQuery implements
|
||||
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
switch (ctx.configuration().dialect().family()) {
|
||||
switch (ctx.family()) {
|
||||
|
||||
// These dialects don't implement the TRUNCATE statement
|
||||
/* [pro] xx
|
||||
|
||||
Loading…
Reference in New Issue
Block a user