Can not get uniformed table structure for logic table Can not get uniformed table structure for logic table
normal_record, it has different meta data of actual tables are as follows
, it has different meta data of actual tables are as follows
#30939
Labels
Bug Report
Which version of ShardingSphere did you use?
5.4.1
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
Expected behavior
the simple table should not appear InconsistentShardingTableMetaDataException
Actual behavior
Caused by: org.apache.shardingsphere.sharding.exception.metadata.InconsistentShardingTableMetaDataException: Can not get uniformed table structure for logic table
normal_record
, it has different meta data of actual tables are as follows:actual table: normal_record, meta data: TableMetaData(name=normal_record, columns=[ColumnMetaData(name=id, dataType=-5, primaryKey=true, generated=true, caseSensitive=true, visible=true, unsigned=false, nullable=false), ColumnMetaData(name=description, dataType=12, primaryKey=false, generated=false, caseSensitive=true, visible=true, unsigned=false, nullable=true)], indexes=[IndexMetaData(name=normal_record_pkey, columns=[id], unique=true)], constraints=[])
actual table: normal_record, meta data: TableMetaData(name=normal_record, columns=[ColumnMetaData(name=id, dataType=-5, primaryKey=true, generated=true, caseSensitive=true, visible=true, unsigned=false, nullable=false), ColumnMetaData(name=description, dataType=12, primaryKey=false, generated=false, caseSensitive=true, visible=true, unsigned=false, nullable=true)], indexes=[IndexMetaData(name=normal_record_pkey, columns=[id], unique=true)], constraints=[])
Reason analyze (If you can)
In TableMetaData definition,the field ’indexes‘ is Collection; In the running, the collection type is AbstractMapBasedMultimap.WrappedSet for the field 'indexes' and 'constraints' , In WrappedSet , equal and hashset is not suitable for this scene.
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
in sharding database,use the same datasource to config,and set CHECK_TABLE_METADATA_ENABLED true
Example codes for reproduce this issue (such as a github link).
The text was updated successfully, but these errors were encountered: