pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.37k stars 5.86k forks source link

Query with set comparation failed: `Unsupported type: Set` #57679

Open joechenrh opened 1 day ago

joechenrh commented 1 day ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t1, t2;
create table t1 (col1 binary(4));
create table t2 (col1 set('Alice', 'Bob'));
select * from t1 where col1 <> ( select col1 from t2);

2. What did you expect to see? (Required)

Nothing.

3. What did you see instead (Required)

ERROR 1105 (HY000): other error: [components/tidb_query_expr/src/types/expr_builder.rs:310]: Invalid compare_bytes (sig = NeString) signature: Evaluate error: [components/tidb_query_expr/src/types/function.rs:270]: Unsupported type: Set

If you insert some data into two table, this query won't fail.

drop table if exists t1, t2;
create table t1 (col1 binary(4));
create table t2 (col1 set('Alice', 'Bob'));
insert into t2 values('Alice');
insert into t1 values(x'1111');
select * from t1 where col1 <> (select col1 from t2);

4. What is your TiDB version? (Required)

master

joechenrh commented 1 day ago

/label fuzz/randomtest

ti-chi-bot[bot] commented 1 day ago

@joechenrh: The label(s) fuzz/randomtest cannot be applied. These labels are supported: fuzz/sqlancer, challenge-program, compatibility-breaker, first-time-contributor, contribution, good first issue, correctness, duplicate, proposal, security, needs-more-info, needs-cherry-pick-release-5.4, needs-cherry-pick-release-6.1, needs-cherry-pick-release-6.5, needs-cherry-pick-release-7.1, needs-cherry-pick-release-7.5, needs-cherry-pick-release-8.1, needs-cherry-pick-release-8.5, affects-5.4, affects-6.1, affects-6.5, affects-7.1, affects-7.5, affects-8.1, affects-8.4, affects-8.5, may-affects-5.4, may-affects-6.1, may-affects-6.5, may-affects-7.1, may-affects-7.5, may-affects-8.1, may-affects-8.5.

In response to [this](https://github.com/pingcap/tidb/issues/57679#issuecomment-2497430723): >/label fuzz/randomtest Instructions for interacting with me using PR comments are available [here](https://prow.tidb.net/command-help). If you have questions or suggestions related to my behavior, please file an issue against the [ti-community-infra/tichi](https://github.com/ti-community-infra/tichi/issues/new?title=Prow%20issue:) repository.