dble icon indicating copy to clipboard operation
dble copied to clipboard

ERROR 1003 - Connection {dbInstance[192.168.9.52:3306],Schema[thb_db_04],threadID[2668]} was closed ,reason is [handle data error:field not found:SUBSTRING(a.owner_com_code, 1, 2)]

Open holmes1849082248 opened this issue 3 years ago • 2 comments

  • **dble version:dble-3.21.02.1-20210528041415

  • steps:

    执行复杂sql语句时group by 包含带有函数的列,提示有问题,找不到该列,MySQL中可以正常执行该sql语句。 group中修改函数为别名之后依然存在这个问题。

SELECT a.ebusiness_no ebusinessNo, min( a.plan_code ) planCode, a.remark remark, a.flag flag, substring( a.owner_com_code, 1, 2 ) ownerComCode, c1.insured_c_name bbxr, c2.insured_c_name tbr, a.oth_flag othFlag, d.license_no licenseNo, b1.update_date createDate, b1.total_premium totalPremium, b1.order_status orderStatus, CASE a.oth_flag WHEN 'COMBINE' THEN 'xxx' WHEN 'MOTOR' THEN 'xxx' WHEN 'MTPL' THEN 'xxx' END riskName, sum( f.VALUE ) cmsn, a.accept_area_city acceptAreaCity, b1.START_DATE startDate, b1.END_DATE endDate FROM eb_order_form b1 LEFT JOIN prp_main a ON b1.ebusiness_no = a.ebusiness_no LEFT JOIN prp_insured c1 ON a.ebusiness_no = c1.ebusiness_no AND c1.insured_flag = '1' LEFT JOIN prp_insured c2 ON a.ebusiness_no = c2.ebusiness_no AND c2.insured_flag = '2' LEFT JOIN prp_item_car d ON a.ebusiness_no = d.ebusiness_no LEFT JOIN prp_car_owner e ON a.ebusiness_no = e.ebusiness_no LEFT JOIN eb_cmsn_get f ON a.ebusiness_no = f.ebusiness_no WHERE a.valid_status = 'Y' AND b1.risk_code = 'xxx' AND b1.valid_status = 'Y' AND ( a.oth_flag = 'MOTOR' OR a.oth_flag = 'COMBINE' ) AND b1.MEMBER_CODE = 'xxx' GROUP BY a.ebusiness_no, a.remark, a.flag, substring( a.owner_com_code, 1, 2 ), c1.insured_c_name, c2.insured_c_name, a.oth_flag, d.license_no, b1.update_date, b1.total_premium, b1.order_status, a.oth_flag, a.update_date, a.accept_area_city, b1.START_DATE, b1.END_DATE

holmes1849082248 avatar Oct 20 '21 07:10 holmes1849082248

Replication of simple SQL: select * from tabler2 a join tabler3 b group by substring(a.name,1,2),b.id;

wenyh1 avatar Apr 28 '22 09:04 wenyh1

This bug has been fixed (inner-1739) Please update version to 3.21.02.8 or 3.22.01.0

wenyh1 avatar Apr 28 '22 09:04 wenyh1

verified on 3.20.07.99 to 3.22.01.99

quexiuping avatar Sep 05 '22 02:09 quexiuping