Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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)] #2919

Closed
holmes1849082248 opened this issue Oct 20, 2021 · 3 comments
Assignees
Labels
community issue from community
Milestone

Comments

@holmes1849082248
Copy link

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

@yanhuqing666 yanhuqing666 added the community issue from community label Mar 4, 2022
@wenyh1 wenyh1 added this to the 3.22.07.0 milestone Apr 26, 2022
@wenyh1
Copy link
Member

wenyh1 commented Apr 28, 2022

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

@wenyh1
Copy link
Member

wenyh1 commented Apr 28, 2022

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

@quexiuping
Copy link
Member

verified on 3.20.07.99 to 3.22.01.99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community issue from community
Projects
None yet
Development

No branches or pull requests

4 participants