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

planner: the column type sent by tidb to tiflash is inconsistent with the column type of the table schema #44579

Closed
SeaRise opened this issue Jun 12, 2023 · 0 comments · Fixed by #45217
Assignees
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.2 severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@SeaRise
Copy link
Contributor

SeaRise commented Jun 12, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

ref pingcap/tiflash#6806

1. Minimal reproduce step (Required)

create table if not exists test.t1(a int(11) DEFAULT NULL, id int(11) NOT NULL, PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */);
alter table test.t1 set tiflash replica 1;
use test; set tidb_enforce_mpp=on; set tidb_isolation_read_engines='tiflash';
explain select sum(1) as c from test.t1 having count(*)>1 or count(a)= null;
+--------------------------------+----------+-------------------+---------------+------------------------------------------------------------------+
| id                             | estRows  | task              | access object | operator info                                                    |
+--------------------------------+----------+-------------------+---------------+------------------------------------------------------------------+
| Projection_6                   | 0.80     | root              |               | Column#3                                                         |
| └─Selection_8                  | 0.80     | root              |               | or(gt(Column#4, 1), 0)                                           |
|   └─StreamAgg_26               | 1.00     | root              |               | funcs:sum(Column#12)->Column#3, funcs:count(Column#13)->Column#4 |
|     └─TableReader_27           | 1.00     | root              |               | data:StreamAgg_14                                                |
|       └─StreamAgg_14           | 1.00     | batchCop[tiflash] |               | funcs:sum(1)->Column#12, funcs:count(1)->Column#13               |
|         └─TableFullScan_25     | 10000.00 | batchCop[tiflash] | table:t1      | keep order:false, stats:pseudo                                   |
+--------------------------------+----------+-------------------+---------------+------------------------------------------------------------------+
select sum(1) as c from test.t1 having count(*)>1 or count(a)= null;

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

The col type sent by tidb is Int64, but it is Int32 in the table schema.

ERROR 1105 (HY000): Check schema[i].type->equals(*storage_schema[i].type) failed, schema[i].name = _tidb_rowid, schema[i].type->getName() = Int64, storage_schema[i].name = id, storage_schema[i].type->getName() = Int32

3. What did you see instead (Required)

The col type sent by tidb is Int32 and query success.

4. What is your TiDB version? (Required)

v7.2.0-alpha

@SeaRise SeaRise added the type/bug The issue is confirmed as a bug. label Jun 12, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Jun 13, 2023
@AilinKid AilinKid added affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.2 and removed may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Jul 7, 2023
ti-chi-bot bot pushed a commit that referenced this issue Jul 10, 2023
…db_rowid when datasource's schema length is 0 for a pkIsHandled table (#45217)

close #44579
ti-chi-bot bot pushed a commit that referenced this issue Jul 11, 2023
…db_rowid when datasource's schema length is 0 for a pkIsHandled table (#45217) (#45257)

close #44579
ti-chi-bot bot pushed a commit that referenced this issue Aug 16, 2023
…db_rowid when datasource's schema length is 0 for a pkIsHandled table (#45217) (#46134)

close #44579
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.2 severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
3 participants