You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "phoema (via GitHub)" <gi...@apache.org> on 2023/07/19 09:37:38 UTC

[GitHub] [shardingsphere] phoema opened a new issue, #27298: Mysql Explain not doSharding with HintManager

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

   when I set hintValue = saas-test
   select sql can doSharding
   but explain select not doSharding
   next is log.txt
   
   2023-07-19 17:34:56,065 [http-nio-8084-exec-2] DEBUG (BaseJdbcLogger.java:137)- ==>  Preparing: Explain SELECT id,serial,name,case_type,case_sub_type,case_status,status_category,area_code,create_time,foreign_agent,customer_name,application_date,apn,dept_id,assignee,agent,case_type_name,status_name,status_category_name,area_name,dept_name,assignee_name,agent_name FROM v_info_case WHERE (case_type = ?) ORDER BY id DESC
   2023-07-19 17:34:56,075 [http-nio-8084-exec-2] DEBUG (BaseJdbcLogger.java:137)- ==> Parameters: 1(String)
   2023-07-19 17:34:56,080 [http-nio-8084-exec-2] INFO (SQLLogger.java:73)- Logic SQL: Explain   SELECT  
   id,serial,name,case_type,case_sub_type,case_status,status_category,area_code,create_time,foreign_agent,customer_name,application_date,apn,dept_id,assignee,agent,case_type_name,status_name,status_category_name,area_name,dept_name,assignee_name,agent_name
     FROM v_info_case 
    
    WHERE (case_type = ?) ORDER BY id DESC
   2023-07-19 17:34:56,081 [http-nio-8084-exec-2] INFO (SQLLogger.java:73)- Actual SQL: master ::: Explain   SELECT  
   id,serial,name,case_type,case_sub_type,case_status,status_category,area_code,create_time,foreign_agent,customer_name,application_date,apn,dept_id,assignee,agent,case_type_name,status_name,status_category_name,area_name,dept_name,assignee_name,agent_name
     FROM v_info_case 
    
    WHERE (case_type = ?) ORDER BY id DESC ::: [1]
   2023-07-19 17:34:56,099 [http-nio-8084-exec-2] DEBUG (BaseJdbcLogger.java:137)- <==      Total: 45
   2023-07-19 17:34:56,100 [http-nio-8084-exec-2] DEBUG (BaseJdbcLogger.java:137)- ==>  Preparing: SELECT id,serial,name,case_type,case_sub_type,case_status,status_category,area_code,create_time,foreign_agent,customer_name,application_date,apn,dept_id,assignee,agent,case_type_name,status_name,status_category_name,area_name,dept_name,assignee_name,agent_name FROM v_info_case WHERE (case_type = ?) ORDER BY id DESC LIMIT ?
   2023-07-19 17:34:56,100 [http-nio-8084-exec-2] DEBUG (BaseJdbcLogger.java:137)- ==> Parameters: 1(String), 10(Long)
   2023-07-19 17:34:56,100 [http-nio-8084-exec-2] DEBUG (HintShardingStrategy.java:30)- doSharding=[saas-test]|系统运维|shardingValue=HintShardingValue(logicTableName=v_info_case, columnName=, values=[saas-test])|availableTargetNames=[master, saas-test, saas-trial]
   2023-07-19 17:34:56,101 [http-nio-8084-exec-2] INFO (SQLLogger.java:73)- Logic SQL: SELECT  
   id,serial,name,case_type,case_sub_type,case_status,status_category,area_code,create_time,foreign_agent,customer_name,application_date,apn,dept_id,assignee,agent,case_type_name,status_name,status_category_name,area_name,dept_name,assignee_name,agent_name
     FROM v_info_case 
    
    WHERE (case_type = ?) ORDER BY id DESC LIMIT ?
   2023-07-19 17:34:56,101 [http-nio-8084-exec-2] INFO (SQLLogger.java:73)- Actual SQL: saas-test ::: SELECT  
   id,serial,name,case_type,case_sub_type,case_status,status_category,area_code,create_time,foreign_agent,customer_name,application_date,apn,dept_id,assignee,agent,case_type_name,status_name,status_category_name,area_name,dept_name,assignee_name,agent_name
     FROM v_info_case 
    
    WHERE (case_type = ?) ORDER BY id DESC LIMIT ? ::: [1, 10]
   2023-07-19 17:34:56,107 [http-nio-8084-exec-2] DEBUG (BaseJdbcLogger.java:137)- <==      Total: 10


-- 
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] github-actions[bot] commented on issue #27298: Mysql Explain not doSharding with HintManager

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

   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] phoema commented on issue #27298: Mysql Explain not doSharding with HintManager

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

   ## 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?
   5.4.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   explain can excute in any database when Hint value setted.
   
   ### Actual behavior
   explain sql  can only cecute in master
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   when I set hintValue = saas-test
   select sql can doSharding
   but explain select not doSharding
   next is log.txt
   
   2023-07-19 17:34:56,065 [http-nio-8084-exec-2] DEBUG (BaseJdbcLogger.java:137)- ==> Preparing: Explain SELECT id,serial,name,case_type,case_sub_type,case_status,status_category,area_code,create_time,foreign_agent,customer_name,application_date,apn,dept_id,assignee,agent,case_type_name,status_name,status_category_name,area_name,dept_name,assignee_name,agent_name FROM v_info_case WHERE (case_type = ?) ORDER BY id DESC
   2023-07-19 17:34:56,075 [http-nio-8084-exec-2] DEBUG (BaseJdbcLogger.java:137)- ==> Parameters: 1(String)
   2023-07-19 17:34:56,080 [http-nio-8084-exec-2] INFO (SQLLogger.java:73)- Logic SQL: Explain SELECT
   id,serial,name,case_type,case_sub_type,case_status,status_category,area_code,create_time,foreign_agent,customer_name,application_date,apn,dept_id,assignee,agent,case_type_name,status_name,status_category_name,area_name,dept_name,assignee_name,agent_name
   FROM v_info_case
   
   WHERE (case_type = ?) ORDER BY id DESC
   2023-07-19 17:34:56,081 [http-nio-8084-exec-2] INFO (SQLLogger.java:73)- Actual SQL: master ::: Explain SELECT
   id,serial,name,case_type,case_sub_type,case_status,status_category,area_code,create_time,foreign_agent,customer_name,application_date,apn,dept_id,assignee,agent,case_type_name,status_name,status_category_name,area_name,dept_name,assignee_name,agent_name
   FROM v_info_case
   
   WHERE (case_type = ?) ORDER BY id DESC ::: [1]
   2023-07-19 17:34:56,099 [http-nio-8084-exec-2] DEBUG (BaseJdbcLogger.java:137)- <== Total: 45
   2023-07-19 17:34:56,100 [http-nio-8084-exec-2] DEBUG (BaseJdbcLogger.java:137)- ==> Preparing: SELECT id,serial,name,case_type,case_sub_type,case_status,status_category,area_code,create_time,foreign_agent,customer_name,application_date,apn,dept_id,assignee,agent,case_type_name,status_name,status_category_name,area_name,dept_name,assignee_name,agent_name FROM v_info_case WHERE (case_type = ?) ORDER BY id DESC LIMIT ?
   2023-07-19 17:34:56,100 [http-nio-8084-exec-2] DEBUG (BaseJdbcLogger.java:137)- ==> Parameters: 1(String), 10(Long)
   2023-07-19 17:34:56,100 [http-nio-8084-exec-2] DEBUG (HintShardingStrategy.java:30)- doSharding=[saas-test]|系统运维|shardingValue=HintShardingValue(logicTableName=v_info_case, columnName=, values=[saas-test])|availableTargetNames=[master, saas-test, saas-trial]
   2023-07-19 17:34:56,101 [http-nio-8084-exec-2] INFO (SQLLogger.java:73)- Logic SQL: SELECT
   id,serial,name,case_type,case_sub_type,case_status,status_category,area_code,create_time,foreign_agent,customer_name,application_date,apn,dept_id,assignee,agent,case_type_name,status_name,status_category_name,area_name,dept_name,assignee_name,agent_name
   FROM v_info_case
   
   WHERE (case_type = ?) ORDER BY id DESC LIMIT ?
   2023-07-19 17:34:56,101 [http-nio-8084-exec-2] INFO (SQLLogger.java:73)- Actual SQL: saas-test ::: SELECT
   id,serial,name,case_type,case_sub_type,case_status,status_category,area_code,create_time,foreign_agent,customer_name,application_date,apn,dept_id,assignee,agent,case_type_name,status_name,status_category_name,area_name,dept_name,assignee_name,agent_name
   FROM v_info_case
   
   WHERE (case_type = ?) ORDER BY id DESC LIMIT ? ::: [1, 10]
   2023-07-19 17:34:56,107 [http-nio-8084-exec-2] DEBUG (BaseJdbcLogger.java:137)- <== Total: 10
   ### 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

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


[GitHub] [shardingsphere] phoema commented on issue #27298: Mysql Explain not doSharding with HintManager

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

   
   org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.newInstance
   
   different:
               return getDALRoutingEngine(shardingRule, database, sqlStatementContext, connectionContext);
   
           return getDQLRoutingEngine(shardingRule, database, sqlStatementContext, queryContext.getHintValueContext(), shardingConditions, props, connectionContext);
   
   
   ShardingUnicastRoutingEngine.route() not contains:
           if (isRoutingByHint(shardingRule, tableRule)) {
               return routeByHint(tableRule, databaseShardingStrategy, tableShardingStrategy);
           }
   
   org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine


-- 
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] phoema commented on issue #27298: Mysql Explain not doSharding with HintManager

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

   sorry,I used 2 days download the source.
   when I read the source, I don`t khow how to modfiy the code
   can some other coder do this?


-- 
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] phoema commented on issue #27298: Mysql Explain not doSharding with HintManager

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

   who can assign this issue?


-- 
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 #27298: Mysql Explain not doSharding with HintManager

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

   You can refer this doc for contribution - https://shardingsphere.apache.org/community/cn/involved/contribute/.


-- 
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] Mysql Explain not doSharding with HintManager [shardingsphere]

Posted by "terrymanu (via GitHub) via notifications" <no...@shardingsphere.apache.org>.
terrymanu closed issue #27298: Mysql Explain not doSharding with HintManager
URL: https://github.com/apache/shardingsphere/issues/27298


-- 
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 #27298: Mysql Explain not doSharding with HintManager

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

   Can you modify this issue according to issue template?


-- 
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] phoema commented on issue #27298: Mysql Explain not doSharding with HintManager

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

   > Can you modify this issue according to bug template?
   
   it is done


-- 
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 #27298: Mysql Explain not doSharding with HintManager

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

   Thank you for your feedback. You can try to solve it.


-- 
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