You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/04/25 03:37:45 UTC

[GitHub] [shardingsphere] mayfsac opened a new issue, #17076: .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of sub query tables are no owner

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

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   I am using 5.0.0 but the same as 5.1.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
   ![image](https://user-images.githubusercontent.com/43204877/165015410-69a19496-4cd2-42ba-ae2d-ddb914d9e247.png)
   ![image](https://user-images.githubusercontent.com/43204877/165015504-5afdb172-71cd-4219-a9de-b9452f89460d.png)
   the three columns both are belone to one table but actially mapping more than one table
   
   ### Actual behavior
   ![image](https://user-images.githubusercontent.com/43204877/165015839-1d39e272-eb16-4d77-8141-cb9a26ec0d9a.png)
   
   ### Reason analyze (If you can)
   ![image](https://user-images.githubusercontent.com/43204877/165016155-b9922e5a-e037-4829-aa3c-b2847c84a899.png)
   there are same columns of the uniqueTables , then The key-value of map will be overwritten multiple times
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   select * from a left join (select * from b where id = 1 and sid =1 and zid =1 ) B on a.sid =B.sid left join (select * from c where id = 1 and zid =1 ) 
   table a contains id sid ,table b contains id sid zid ,table c contains id zid 
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on issue #17076: .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of sub query tables are no owner

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #17076:
URL: https://github.com/apache/shardingsphere/issues/17076#issuecomment-1410262552

   Now the code of 5.3.1 is as follows, it may need to be verified:
   ```java
   private Map<String, String> findTableNameFromMetaData(final Collection<String> noOwnerColumnNames, final ShardingSphereSchema schema) {
           if (noOwnerColumnNames.isEmpty()) {
               return Collections.emptyMap();
           }
           Map<String, String> result = new LinkedHashMap<>(noOwnerColumnNames.size(), 1);
           for (SimpleTableSegment each : tables) {
               String tableName = each.getTableName().getIdentifier().getValue();
               for (String columnName : schema.getAllColumnNames(tableName)) {
                   if (noOwnerColumnNames.contains(columnName)) {
                       result.put(columnName, tableName);
                   }
               }
           }
           return result;
       }
   ```


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] cheese8 commented on issue #17076: .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of sub query tables are no owner

Posted by GitBox <gi...@apache.org>.
cheese8 commented on issue #17076:
URL: https://github.com/apache/shardingsphere/issues/17076#issuecomment-1111562890

   Could you try it with 5.1.1, there is no uniqueTables logic within 5.1.1 already.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of sub query tables are no owner [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #17076: .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of   sub query tables  are no owner 
URL: https://github.com/apache/shardingsphere/issues/17076


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] commented on issue #17076: .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of sub query tables are no owner

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #17076:
URL: https://github.com/apache/shardingsphere/issues/17076#issuecomment-1272349926

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] closed issue #17076: .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of sub query tables are no owner

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #17076: .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of   sub query tables  are no owner 
URL: https://github.com/apache/shardingsphere/issues/17076


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] cheese8 commented on issue #17076: .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of sub query tables are no owner

Posted by GitBox <gi...@apache.org>.
cheese8 commented on issue #17076:
URL: https://github.com/apache/shardingsphere/issues/17076#issuecomment-1108742736

   I would to fix it, please assign it to me, thanks.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of sub query tables are no owner [shardingsphere]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #17076:
URL: https://github.com/apache/shardingsphere/issues/17076#issuecomment-2026020546

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #17076: .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of sub query tables are no owner

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #17076:
URL: https://github.com/apache/shardingsphere/issues/17076#issuecomment-1108099924

   Hi @mayfsac, thank you for your feedback, can you submit a pr to fix this bug?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] mayfsac commented on issue #17076: .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of sub query tables are no owner

Posted by GitBox <gi...@apache.org>.
mayfsac commented on issue #17076:
URL: https://github.com/apache/shardingsphere/issues/17076#issuecomment-1111682725

   I did not download the source code for 5.1.1,I'm not sure it's the same as 5.1.0  ,  the uniqueTables uniqueTables is replaced by tables at 5.1.0, i saw the logic has not changed and just changed the code style.
   
   
   
   
   
   
   
   
   
   
   
   
   
   At 2022-04-28 07:07:22, "cheese8" ***@***.***> wrote:
   
   Could you try it with 5.1.1, there is no uniqueTables logic within 5.1.1 already.
   
   —
   Reply to this email directly, view it on GitHub, or unsubscribe.
   You are receiving this because you were mentioned.Message ID: ***@***.***>


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] .TablesContext#findTableNameFromMetaData() can not find the correct table name for column names when the columns of sub query tables are no owner [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #17076:
URL: https://github.com/apache/shardingsphere/issues/17076#issuecomment-2026323586

   Closed due to no response.
   If this problem persists, please reopen it or submit a new one.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org