t8y2/dbx · error · IllegalStateException

Unsupported Firebird field type: {fieldType}

Error message

Unsupported Firebird field type: {fieldType}

What it means

FirebirdAgent.parameterType maps Firebird blob-field type codes (BLR/RDB$FIELD_TYPE values) to SQL type strings. Unknown codes reach the default branch and throw IllegalStateException. This fires when a field type code is outside the known set (7, 8, 9..35, 37, 40, 261).

Source

Thrown at agents/drivers/firebird/src/main/java/com/dbx/agent/firebird/FirebirdAgent.java:214

            case 7 -> numericType("SMALLINT", subType, parameter);
            case 8 -> numericType("INTEGER", subType, parameter);
            case 10 -> "FLOAT";
            case 11, 27 -> "DOUBLE PRECISION";
            case 12 -> "DATE";
            case 13 -> "TIME";
            case 14 -> characterType("CHAR", "BINARY", subType, parameter);
            case 16 -> numericType("BIGINT", subType, parameter);
            case 23 -> "BOOLEAN";
            case 24 -> "DECFLOAT(16)";
            case 25 -> "DECFLOAT(34)";
            case 26 -> numericType("INT128", subType, parameter);
            case 28 -> "TIME WITH TIME ZONE";
            case 29 -> "TIMESTAMP WITH TIME ZONE";
            case 35 -> "TIMESTAMP";
            case 37 -> characterType("VARCHAR", "VARBINARY", subType, parameter);
            case 40 -> sizedType("CSTRING", characterLength(parameter));
            case 261 -> blobType(subType);
            default -> throw new IllegalStateException("Unsupported Firebird field type: " + fieldType);
        };
    }

    private static String numericType(String integerType, int subType, ProcedureParameter parameter) {
        int scale = valueOrZero(parameter.scale());
        if (subType != 1 && subType != 2 && scale >= 0) {
            return integerType;
        }
        String exactType = subType == 2 ? "DECIMAL" : "NUMERIC";
        int precision = valueOrZero(parameter.precision());
        if (precision <= 0) {
            return exactType;
        }
        return exactType + "(" + precision + "," + Math.abs(scale) + ")";
    }

    private static String characterType(
        String characterType,

View on GitHub (pinned to c0390bff16)

Solutions

  1. Upgrade or patch the driver to map the missing field type code
  2. Log the raw fieldType/subType/scale from RDB$FIELDS and add the missing case
  3. Verify metadata extraction reads the correct RDB$FIELD_TYPE column

Example fix

// before
case 261 -> blobType(subType);
default -> throw new IllegalStateException("Unsupported Firebird field type: " + fieldType);
// after
case 261 -> blobType(subType);
case 16 -> "BIGINT"; // newly mapped code
default -> throw new IllegalStateException("Unsupported Firebird field type: " + fieldType);
Defensive patterns

Strategy: try-catch

Validate before calling

Set<Integer> known = Set.of(7,8,9,10,12,16,23,24,27,28,29,35,37,40,261); if (p.fieldType() == null || !known.contains(p.fieldType())) { skip(p); }

Type guard

static boolean isKnownFirebirdFieldType(Integer code) { return code != null && KNOWN_FIELD_TYPES.contains(code); }

Try / catch

try { ddl = agent.getProcedureDdl(name); } catch (IllegalStateException e) { log.warn("Unmapped Firebird field type: {}", e.getMessage()); fallbackToRawMetadata(name); }

Prevention

When it happens

Trigger: A procedure parameter carries a fieldType integer not covered by the switch, e.g. a corrupted value or a Firebird type code the driver does not yet map.

Common situations: Running against a Firebird version or dialect that reports new/renamed type codes; metadata queried from the wrong system table yielding mismatched codes; decoding a non-blob field type as a parameter.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/20ce03d13c2c4284. Report an issue: GitHub.