thswlsqls opened a new issue, #39095:
URL: https://github.com/apache/shardingsphere/issues/39095

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   master @ a14fa59423c
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   Both (metadata loading level)
   
   ### Expected behavior
   
   When loading openGauss schema metadata, database views should be classified 
as `TableType.VIEW`, consistent with the PostgreSQL, MySQL and Oracle dialect 
loaders.
   
   ### Actual behavior
   
   `OpenGaussMetaDataLoader` builds every table with the 4-arg `TableMetaData` 
constructor, which hardcodes `type = TableType.TABLE`, so openGauss views are 
always misclassified as tables. openGauss registers its own 
`DialectMetaDataLoader` (`getDatabaseType()` returns "openGauss") and never 
falls back to the PostgreSQL loader, so this is a real runtime gap.
   
   ### Reason analyze (If you can)
   
   `OpenGaussMetaDataLoader.createTableMetaDataList()` 
(database/connector/dialect/opengauss/.../metadata/data/loader/OpenGaussMetaDataLoader.java)
 never queries `information_schema.views` and passes no view names. Sibling 
`PostgreSQLMetaDataLoader.loadViewNames()` + `createTableMetaDataList()` uses 
`VIEW_META_DATA_SQL` and `viewNames.contains(each) ? TableType.VIEW : 
TableType.TABLE`. Consumers such as `MetadataResourcePayloadMapper` filter on 
`TableType.VIEW`, so openGauss views are lost.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   Load metadata from an openGauss schema containing a view; the loaded 
`TableMetaData.getType()` for that view returns `TABLE` instead of `VIEW`.
   
   ### Example codes for reproduce this issue (such as a github link).
   
   N/A
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to