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

[Bug] where条件模糊查询like过滤数据出现问题 #29449

Closed
3 tasks done
guanghuan96 opened this issue Jan 3, 2024 · 1 comment
Closed
3 tasks done

[Bug] where条件模糊查询like过滤数据出现问题 #29449

guanghuan96 opened this issue Jan 3, 2024 · 1 comment

Comments

@guanghuan96
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Version

2.0.3

What's Wrong?

加上like后把全部数据都过滤掉了
完整sql:
select
shop_no,
full_name
from tidb_prod_tikv.ehr_sync.organization
where shop_no in ('XDGY01','XDAHDY','XDZZZB','NKBO25','ADJN52','ADJN15')
and full_name not like '%虚店%'
and full_name not like '%直播%'

-- 查询样例数据
select
shop_no,
full_name
from tidb_prod_tikv.ehr_sync.organization -- 这是一张外链表
where shop_no in ('XDGY01','XDAHDY','XDZZZB','NKBO25','ADJN52','ADJN15')

数据如下:
shop_no full_name
NKBO25 济南历下泉城路恒隆KL
ADJN52 济南历下泉城路恒隆AD二店
ADJN15 济南市中经四路振华AD
XDGY01 云贵贵阳总部小程序虚店
XDAHDY 安徽抖音虚店
XDZZZB 河南地区直播库存店

-- 执行计划
explain
select
shop_no,
full_name
from tidb_prod_tikv.ehr_sync.organization
where shop_no in ('XDGY01','XDAHDY','XDZZZB','NKBO25','ADJN52','ADJN15')
and full_name not like '%虚店%'
and full_name not like '%直播%'

PLAN FRAGMENT 0
OUTPUT EXPRS:
shop_no[#52]
full_name[#8]
PARTITION: UNPARTITIONED

HAS_COLO_PLAN_NODE: false

VRESULT SINK

343:VEXCHANGE
offset: 0

PLAN FRAGMENT 1

PARTITION: RANDOM

HAS_COLO_PLAN_NODE: false

STREAM DATA SINK
EXCHANGE ID: 343
UNPARTITIONED

332:VJdbcScanNode
TABLE: ehr_sync.organization
QUERY: SELECT shop_no, full_name FROM ehr_sync.organization WHERE (full_name like '%虚店%') AND (shop_no IN ('XDGY01', 'XDAHDY', 'XDZZZB', 'NKBO25', 'ADJN52', 'ADJN15')) AND (full_name like '%直播%')
PREDICATES: NOT full_name[#8] like '%虚店%' AND shop_no[#52] IN ('XDGY01', 'XDAHDY', 'XDZZZB', 'NKBO25', 'ADJN52', 'ADJN15') AND NOT full_name[#8] like '%直播%'

What You Expected?

期望得到如下数据:
shop_no full_name
NKBO25 济南历下泉城路恒隆KL
ADJN52 济南历下泉城路恒隆AD二店
ADJN15 济南市中经四路振华AD

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@zy-kkk
Copy link
Member

zy-kkk commented Jan 10, 2024

fix in 2.0.4 #28524

@zy-kkk zy-kkk closed this as completed Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants