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

ERROR 1105 (HY000): tidb_cast to Int32 is not supported #23907

Closed
fzhedu opened this issue Apr 7, 2021 · 3 comments · Fixed by #28458
Closed

ERROR 1105 (HY000): tidb_cast to Int32 is not supported #23907

fzhedu opened this issue Apr 7, 2021 · 3 comments · Fixed by #28458
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. component/expression severity/major sig/planner SIG: Planner type/bug This issue is a bug.

Comments

@fzhedu
Copy link
Contributor

fzhedu commented Apr 7, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql -h172.16.5.85 -P53324 -uroot -D ssjoin10000

set @@tidb_isolation_level="tiflash";

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

runs ok

3. What did you see instead (Required)

mysql> desc SELECT    table1 . `pk` AS field1 , MIN(  table1 . `pk` ) AS field2 , table1 . `pk` AS field3 , table1 . `col_int` AS field4 , table1 . `col_int` AS field5 FROM  CC AS table1  LEFT  JOIN V AS table2 ON  table1 . `pk` =  table2 . `pk`  WHERE table1 . `pk` < 2  GROUP BY field1, field3, field4, field5 HAVING ((field2 > 9 AND field2 > 1) OR field5 <> 3)  ;
+-----------------------------+---------+--------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------+
| id                          | estRows | task         | access object | operator info                                                                                                                     |
+-----------------------------+---------+--------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------+
| Projection_9                | 1.87    | root         |               | ssjoin10000.cc.pk, cast(ssjoin10000.cc.pk, int(11))->Column#43, ssjoin10000.cc.pk, ssjoin10000.cc.col_int, ssjoin10000.cc.col_int |
| └─TableReader_15            | 1.87    | root         |               | data:Selection_14                                                                                                                 |
|   └─Selection_14            | 1.87    | cop[tiflash] |               | or(and(gt(cast(ssjoin10000.cc.pk, int(11)), 9), gt(cast(ssjoin10000.cc.pk, int(11)), 1)), ne(ssjoin10000.cc.col_int, 3))          |
|     └─TableRangeScan_13     | 16.67   | cop[tiflash] | table:table1  | range:[-inf,2), keep order:false, stats:pseudo                                                                                    |
+-----------------------------+---------+--------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------+
4 rows in set (0.11 sec)

mysql> SELECT    table1 . `pk` AS field1 , MIN(  table1 . `pk` ) AS field2 , table1 . `pk` AS field3 , table1 . `col_int` AS field4 , table1 . `col_int` AS field5 FROM  CC AS table1  LEFT  JOIN V AS table2 ON  table1 . `pk` =  table2 . `pk`  WHERE table1 . `pk` < 2  GROUP BY field1, field3, field4, field5 HAVING ((field2 > 9 AND field2 > 1) OR field5 <> 3)  ;
ERROR 1105 (HY000): tidb_cast to Int32 is not supported

4. What is your TiDB version? (Required)

master of nightly

@fzhedu fzhedu added the type/bug This issue is a bug. label Apr 7, 2021
@fzhedu
Copy link
Contributor Author

fzhedu commented Apr 9, 2021

duplicated pingcap/tiflash#1727

@windtalker
Copy link
Contributor

windtalker commented Apr 9, 2021

Reopen it since TiDB should not generated implicit cast to cast something to int(11), if TiDB want to cast something to int, int should cast it to bigint(20)

@wjhuang2016 wjhuang2016 added sig/planner SIG: Planner and removed sig/sql-infra SIG: SQL Infra labels May 24, 2021
@github-actions github-actions bot added this to Issue Backlog: Need Triage in SIG Runtime Kanban Aug 23, 2021
@github-actions github-actions bot added this to Issue Backlog: Need Triage in SIG Planner Kanban Aug 23, 2021
@ichn-hu ichn-hu added affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. labels Sep 29, 2021
@github-actions
Copy link

github-actions bot commented Oct 8, 2021

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. component/expression severity/major sig/planner SIG: Planner type/bug This issue is a bug.
Projects
No open projects
SIG Planner Kanban
  
Issue Backlog: Need Triage
SIG Runtime Kanban
  
Issue Backlog: Need Triage
Development

Successfully merging a pull request may close this issue.

7 participants