DbConnectionManager should not default to DB2 for unknown database types.

Description

When detecting the database type based of its reported name, Openfire attempts to check if a known identifier is part of the name string, like so:

// HSQL properties else if (dbName.indexOf("hsql") != -1) { databaseType = DatabaseType.hsqldb; // scrollResultsSupported = false; /* comment and test this, it should be supported since 1.7.2 */ } // DB2 properties. else if (dbName.indexOf("db2") != 1) { databaseType = DatabaseType.db2; }

Note the bug in the db2 line. It checks for `1`, where `-1` is intended. As this is the last condition, all unrecognized names end up being identified as DB2. I'm also thinking that this prevents an actual DB2 database to be identified as DB2 (unless it's reported name contains 'db2' on the second character onwards).

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created April 8, 2021 at 10:08 AM
Updated April 9, 2021 at 1:34 PM
Resolved April 9, 2021 at 1:34 PM

Flag notifications