Skip to content

SubstringUTF8 & RightUTF8 do not support length of integer types other than int64/uint64 #9473

@gengliqi

Description

@gengliqi

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> CREATE TABLE `t` ( `id`varchar(20), `lgth`tinyint(10) );
Query OK, 0 rows affected (0.04 sec)

mysql> alter table t set tiflash replica 1;
Query OK, 0 rows affected (0.08 sec)

mysql> explain select left(id, lgth) from t;
+----------------------------+----------+--------------+---------------+----------------------------------------+
| id                         | estRows  | task         | access object | operator info                          |
+----------------------------+----------+--------------+---------------+----------------------------------------+
| TableReader_12             | 10000.00 | root         |               | MppVersion: 2, data:ExchangeSender_11  |
| └─ExchangeSender_11        | 10000.00 | mpp[tiflash] |               | ExchangeType: PassThrough              |
|   └─Projection_4           | 10000.00 | mpp[tiflash] |               | left(test.t.id, test.t.lgth)->Column#4 |
|     └─TableFullScan_10     | 10000.00 | mpp[tiflash] | table:t       | keep order:false, stats:pseudo         |
+----------------------------+----------+--------------+---------------+----------------------------------------+
4 rows in set, 1 warning (0.01 sec)

mysql> show warnings;
+---------+------+---------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                             |
+---------+------+---------------------------------------------------------------------------------------------------------------------+
| Warning | 1105 | Scalar function 'left'(signature: LeftUTF8, return type: var_string(20)) is not supported to push down to tikv now. |
+---------+------+---------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> explain analyze select left(id, lgth) from t;
ERROR 1105 (HY000): other error for mpp stream: Code: 0, e.displayText() = DB::Exception: 3nd argument of function substringUTF8 must have UInt/Int type., e.what() = DB::Exception,

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

No error.

3. What did you see instead (Required)

Error.

4. What is your TiFlash version? (Required)

master

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-5.4This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.component/computereport/customerCustomers have encountered this bug.severity/majortype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions