phoema commented on issue #4582: Parsing SubQuery 
URL: 
https://github.com/apache/incubator-shardingsphere/issues/4582#issuecomment-595326137
 
 
   Version lastest
   5.0.0-RC1-SNAPSHOT
   DB:MySql
   org.apache.shardingsphere.sql.parser.SQLParserEngine
   public SQLStatement parse(final String sql, final boolean useCache)
   
   
![image](https://user-images.githubusercontent.com/8730272/76002643-e2c07c80-5f41-11ea-821a-72f3fd557acc.png)
   tables.size==0
   what with wrong this sql?
   
   SQL One:
   SELECT COUNT(1) FROM ( SELECT * FROM ( SELECT tbl_biz.id AS id, 
tbl_biz.payer_type AS payer_type, tbl_biz.payer AS payer, tbl_biz.sign AS sign, 
tbl_biz.code AS code, tbl_biz.type AS type, tbl_biz.case_id AS case_id, 
tbl_biz.policy AS policy, tbl_biz.amount AS amount, tbl_biz.currency AS 
currency, tbl_biz.rate AS rate, tbl_biz.in_deadline AS in_deadline, 
tbl_biz.official_deadline AS official_deadline, tbl_biz.pay_time AS pay_time, 
tbl_biz.fee_user AS fee_user, tbl_biz.order_id AS order_id, tbl_biz.remark AS 
remark, tbl_biz.amount_rmb AS amount_rmb, tbl_biz.create_time AS create_time, 
tbl_biz.create_by AS create_by, tbl_biz.update_time AS update_time, 
tbl_biz.update_by AS update_by, tbl_biz.receive_status AS receive_status, 
tbl_biz.pay_status AS pay_status, tbl_biz.pay_union_id AS pay_union_id, 
tbl_biz.receive_union_id AS receive_union_id, tmp.payer_name AS payer_name, 
tbl_fee.official_code AS official_code, tbl_fee.name AS fee_code_name, 
tbl_fee.sub_type AS sub_type, IFNULL(tbl_biz.fee_step,tbl_fee.fee_step) AS 
fee_step, tbl_fee.type AS fee_type, tbl_user.user_name AS fee_user_name, 
tbl_info.case_type AS case_type, tbl_info.case_sub_type AS case_sub_type, 
tbl_info.apn AS apn, tbl_info.scnfnd AS scnfnd, tbl_info.fee_discount AS 
fee_discount, tbl_info.application_date AS application_date, 
tbl_info.case_status AS case_status, tbl_info.serial AS serial, tbl_info.name 
AS name, tbl_info.contract_number AS contract_number, tbl_info.customerid AS 
customer_id, tbl_info.customer_serial AS customer_serial, 
tbl_info.customer_name AS customer_name, tbl_info.customer_linker_name AS 
customer_linker_name, tbl_info.salesuser_name AS salesuser_name, 
tbl_info.serviceuser_name AS serviceuser_name, tbl_info.agent_name AS 
agent_name, tbl_info.commit_agency AS commit_agency, 
tbl_info.commit_agency_name AS commit_agency_name, tbl_info.branch_anency_name 
AS branch_anency_name, tbl_info.case_type_name AS case_type_name, 
tbl_info.case_label AS case_label, tbl_info.status_name AS status_name, 
pay_status_dict.name AS pay_status_name, receive_status_dict.name AS 
receive_status_name, fee_monitor_dict.name AS policy_name, fee_sign_dict.name 
AS sign_name, tbl_biz.notice_id AS notice_id, tbl_notice.title as notice_title, 
tbl_notice.dispatch_date as notice_dispatch_date, tbl_notice.dispatch_number as 
notice_dispatch_number FROM biz_fee tbl_biz LEFT JOIN v_multi_users tmp ON ( ( 
( tbl_biz.payer_type = CONVERT ( tmp.payer_type USING utf8 ) ) AND ( 
tbl_biz.payer = tmp.payer_id ) ) ) LEFT JOIN sys_fee tbl_fee ON ( ( 
tbl_biz.code = tbl_fee.id ) ) LEFT JOIN sys_user tbl_user ON ( ( 
tbl_biz.fee_user = tbl_user.id ) ) LEFT JOIN sys_dict_data pay_status_dict ON ( 
tbl_biz.pay_status = pay_status_dict.value and pay_status_dict.dict_type = 
'fee_status_type') LEFT JOIN sys_dict_data receive_status_dict ON ( 
tbl_biz.receive_status = receive_status_dict.value and 
receive_status_dict.dict_type = 'fee_status_type') LEFT JOIN sys_dict_data 
fee_monitor_dict ON ( tbl_biz.policy = fee_monitor_dict.value and 
fee_monitor_dict.dict_type = 'fee_monitor_type') LEFT JOIN sys_dict_data 
fee_sign_dict ON ( tbl_biz.sign = fee_sign_dict.value and 
fee_sign_dict.dict_type = 'fee_sign') JOIN v_info_case tbl_info ON ( ( 
tbl_biz.case_id = tbl_info.id ) ) LEFT JOIN biz_official_notice tbl_notice ON ( 
( tbl_biz.notice_id = tbl_notice.id ) ) ) tbl WHERE (fee_user = ?) ORDER BY id 
DESC ) TOTAL
   
   
![image](https://user-images.githubusercontent.com/8730272/76002971-5bbfd400-5f42-11ea-8b19-6ecb86e2f39f.png)
   
   
   all my tables is HintManager
   so,it may be special DB like testdb1.
   but SQLParserEngine  Parser tables.size ==0 and 
   why Actual SQL: master  ?
   
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to