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

Illegal column for DataTypeNullable:Nullable(String) #3388

Closed
lilinghai opened this issue Nov 4, 2021 · 1 comment · Fixed by #3394
Closed

Illegal column for DataTypeNullable:Nullable(String) #3388

lilinghai opened this issue Nov 4, 2021 · 1 comment · Fixed by #3394
Assignees
Labels
affects-5.2 severity/major type/bug The issue is confirmed as a bug.

Comments

@lilinghai
Copy link

create table t(a varchar(10));
alter table t set tiflash replica 2;
insert into t values("a");
select count(*) from t where coalesce(a,null)="a"; -- expect result is 1
-- but got ERROR 1105 (HY000): other error for mpp stream: DB::Exception: Illegal column for DataTypeNullable:Nullable(String) [column_name=coalesce(a, NULL_Nullable(String))_collator_46 ] [created=1] [nullable=0] [const=0]
/*
desc select count(*) from t where coalesce(a,null)="a";
+----------------------------+---------+--------------+---------------+---------------------------------+
| id                         | estRows | task         | access object | operator info                   |
+----------------------------+---------+--------------+---------------+---------------------------------+
| StreamAgg_10               | 1.00    | root         |               | funcs:count(1)->Column#3        |
| └─TableReader_13           | 0.80    | root         |               | data:Selection_12               |
|   └─Selection_12           | 0.80    | cop[tiflash] |               | eq(coalesce(rs.t.a, NULL), "a") |
|     └─TableFullScan_11     | 1.00    | cop[tiflash] | table:t       | keep order:false, stats:pseudo  |
+----------------------------+---------+--------------+---------------+---------------------------------+
*/

master nightly UTC Build Time: 2021-11-04 06:29:34
TiDB dcbfda914ad0b2647edc39788e0a6e8b5d90717d
tiflash 89c472f

@lilinghai lilinghai added type/bug The issue is confirmed as a bug. severity/major labels Nov 4, 2021
@fuzhe1989
Copy link
Contributor

Reproduced in unittest:

    const String & func_name = "coalesce";

    ASSERT_COLUMN_EQ(
        createColumn<Nullable<String>>({"a"}),
        executeFunction(
            func_name,
            createColumn<Nullable<String>>({"a"}),
            createConstColumn<Nullable<String>>(1, std::nullopt)));
Value of: DB::tests::columnEqual((createColumn<Nullable<String>>({"a"})), (executeFunction( func_name, createColumn<Nullable<String>>({"a"}), createConstColumn<Nullable<String>>(1, std::nullopt))))
  Actual: false (Column name mismatch
expected->getName(): Nullable(String)
actual->getName(): String)
Expected: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.2 severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants