apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.64k stars 3.26k forks source link

[Bug] 当视图中新增的赋空值或空字符串的字段,使用"like"模糊查询时,空值或空字符串都查出来了 #19637

Open pengtao211 opened 1 year ago

pengtao211 commented 1 year ago

Search before asking

Version

Apache Doris 1.2.4.1 Apache Doris 1.2.3

What's Wrong?

当视图中新赋的空值或空字符串的字段,使用"like"模糊查询时,空值或空字符串都查出来了。 select * from v_t_test where remark like '%测试%'; image

What You Expected?

使用视图时,能正确使用like模糊查询

How to Reproduce?

1: CREATE TABLE t_test ( id INT NOT NULL ,name STRING ) UNIQUE KEY(id) DISTRIBUTED BY HASH(id) BUCKETS 10 PROPERTIES ( "enable_unique_key_merge_on_write" = "true", "replication_num" = "1" );

2: insert into t_test values(1,'zhangsan'),(2,'lisi'),(3,'wangwu'),(4,''),(5,null);

3: create view v_t_test as select id,name,'' as remark from t_test;

4: select * from v_t_test where remark like '%测试%';

Anything Else?

No response

Are you willing to submit PR?

Code of Conduct

yuanyuan8983 commented 1 year ago

This problem does exist after my verification. You can add me on wechat to keep you updated: cyllyy810222

laizhiming commented 1 year ago

有点不可思议~