apache / shardingsphere

Empowering Data Intelligence with Distributed SQL for Sharding, Scalability, and Security Across All Databases.
Apache License 2.0
19.99k stars 6.75k forks source link

Bugs in multi-logical databases of different database types #33711

Open 309593586 opened 6 days ago

309593586 commented 6 days ago

see zhe following code:

  public static Map<String, ShardingSphereDatabase> create(final Map<String, DatabaseConfiguration> databaseConfigMap,
                                                             final ConfigurationProperties props, final ComputeNodeInstanceContext computeNodeInstanceContext) throws SQLException {
        DatabaseType protocolType = DatabaseTypeEngine.getProtocolType(databaseConfigMap, props);
        SystemDatabase systemDatabase = new SystemDatabase(protocolType);
        Map<String, ShardingSphereDatabase> result = new ConcurrentHashMap<>(databaseConfigMap.size() + systemDatabase.getSystemDatabaseSchemaMap().size(), 1F);
        result.putAll(createGenericDatabases(databaseConfigMap, protocolType, systemDatabase, props, computeNodeInstanceContext));
        result.putAll(createSystemDatabases(databaseConfigMap, protocolType, systemDatabase, props));
        return result;
    }

The variable “databaseConfigMap” contains multiple logical databases of different types (specifically, Kingbase and MySQL logical databases), but the method "DatabaseTypeEngine.getProtocolType()" only accommodates one database type (MySQL). bug

terrymanu commented 4 days ago

What is your version and configuration?