apache/shardingsphere

In the case of multiple data sources, if the same table name exists in different data sources, the loading and overwriting of table names and routing errors may occur

Opened this issue · 1 comments

Bug Report

Which version of ShardingSphere did you use?

    version:5.4.1

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

   project:ShardingSphere-JDBC 

Expected behavior

   In the case of multiple data sources, if the same table name exists under different data sources, each other data source can correctly load and route its own table independently

Actual behavior

    In the case of multiple data sources, if the same table name exists in different data sources, the same table name in the data source loaded later overwrites the tables in the previous data source, resulting in routing errors

Reason analyze (If you can)

    The key here causes the later data source table to override the previous existing data source table name。

     I think the key here should be concatenated with the library name to maintain the uniqueness of the same table name in the case of multiple data sources
image

Location: “SingleTableDataNodeLoader” this class