{"record":{"id":"344ba739ca82b6d4","repo":"apache/shardingsphere","slug":"unknown-database-information-request-type-d-344ba7","errorCode":null,"errorMessage":"Unknown database information request type %d","messagePattern":"Unknown database information request type (.+?)","errorType":"exception","errorClass":"FirebirdProtocolException","httpStatus":null,"severity":"warning","filePath":"database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/packet/command/query/info/type/sql/FirebirdSQLInfoReturnPacket.java","lineNumber":71,"sourceCode":"    @Override\n    protected void write(final FirebirdPacketPayload payload) {\n        for (FirebirdInfoPacketType type : infoItems) {\n            if (type.isCommon()) {\n                FirebirdCommonInfoPacketType.parseCommonInfo(payload, (FirebirdCommonInfoPacketType) type);\n            } else {\n                parseSQLInfo(payload, (FirebirdSQLInfoPacketType) type);\n            }\n        }\n    }\n    \n    private void parseSQLInfo(final FirebirdPacketPayload payload, final FirebirdSQLInfoPacketType type) {\n        // TODO implement other request types handle\n        switch (type) {\n            case RECORDS:\n                processRecords(payload);\n                return;\n            default:\n                throw new FirebirdProtocolException(\"Unknown database information request type %d\", type.getCode());\n        }\n    }\n    \n    private void processRecords(final FirebirdPacketPayload payload) {\n        payload.writeInt1(FirebirdSQLInfoPacketType.RECORDS.getCode());\n        payload.writeInt2LE(RECORDS_CLUSTER_LENGTH);\n        writeCount(payload, REQ_SELECT_COUNT, 0L);\n        writeCount(payload, REQ_INSERT_COUNT, recordsInfo.getInsertCount());\n        writeCount(payload, REQ_UPDATE_COUNT, recordsInfo.getUpdateCount());\n        writeCount(payload, REQ_DELETE_COUNT, recordsInfo.getDeleteCount());\n    }\n    \n    private void writeCount(final FirebirdPacketPayload payload, final int countType, final long count) {\n        payload.writeInt1(countType);\n        payload.writeInt2LE(COUNT_VALUE_LENGTH);\n        payload.writeInt4LE((int) count);\n    }\n}","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/packet/command/query/info/type/sql/FirebirdSQLInfoReturnPacket.java#L53-L89","documentation":"Thrown when a Firebird SQL information request asks for an item other than RECORDS. Note the message text says 'database information request type' but the code actually parses FirebirdSQLInfoPacketType — a copy-paste message; the failing request is a statement/SQL info item. parseSQLInfo only implements RECORDS (row counts), so any other SQL info item throws.","triggerScenarios":"Issuing isc_dsql_sql_info with items such as isc_info_sql_stmt_type, isc_info_sql_get_plan, or isc_info_sql_batch_info — anything except the RECORDS item handled in FirebirdSQLInfoReturnPacket.parseSQLInfo().","commonSituations":"Drivers that ask for statement type or execution plan metadata after preparing SQL; ORMs doing feature detection; tools like DBeaver/flamerobin requesting plans. The misleading 'database' wording sends people to the wrong class.","solutions":["Read the message as 'SQL info request type' despite the wording — inspect FirebirdSQLInfoReturnPacket, not the database-info packet","Map the numeric item code to its isc_info_sql_* constant to identify the unsupported request","Restrict client calls to the RECORDS info item (insert/update/delete/select counts)","Implement the needed isc_info_sql_* case in parseSQLInfo and contribute it upstream"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// only ask for RECORDS via SQL info; gate other isc_info_sql_* items\nif (item == FirebirdSQLInfoPacketType.RECORDS.getCode()) {\n    statement.executeInfo(item);\n} else {\n    skip(\"SQL info item not implemented: \" + item);\n}","typeGuard":"static boolean isImplementedSqlInfoItem(final int code) {\n    return code == FirebirdSQLInfoPacketType.RECORDS.getCode();\n}","tryCatchPattern":"try {\n    returnPacket.write(payload);\n} catch (FirebirdProtocolException ex) {\n    // despite the 'database' wording this is SQL info; log the item code and skip\n    log.warn(\"SQL info item unsupported: {}\", ex.getMessage());\n}","preventionTips":["Recognize the message as mislabeled — search FirebirdSQLInfoReturnPacket, not the database info class","Disable driver options that fetch statement type/plan metadata through SQL info"],"tags":["firebird","protocol","sql-info","unsupported-feature","misleading-message"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}