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

baseBuiltinFunc.vecEvalInt() should never be called, please contact the TiDB team for help #28804

Closed
tiancaiamao opened this issue Oct 14, 2021 · 2 comments · Fixed by #28805
Closed
Assignees
Labels
affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@tiancaiamao
Copy link
Contributor

tiancaiamao commented Oct 14, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

From oncall 3741

1. Minimal reproduce step (Required)

CREATE TABLE `perf_offline_day` (
`uuid` varchar(50),
`ts` timestamp NOT NULL,
`user_id` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`platform` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`host_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`uuid`,`ts`) /*T![clustered_index] NONCLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
PARTITION BY RANGE ( UNIX_TIMESTAMP(`ts`) ) (
PARTITION `p20210906` VALUES LESS THAN (1630944000),
PARTITION `p20210907` VALUES LESS THAN (1631030400),
PARTITION `p20210908` VALUES LESS THAN (1631116800),
PARTITION `p20210909` VALUES LESS THAN (1631203200)
);

INSERT INTO `perf_offline_day` VALUES ('dd082c8a-3bab-4431-943a-348fe0592abd','2021-09-08 13:00:07','Xg9C8zq81jGNbugM', 'pc', 12345);

SELECT cast(floor(hour(ts) / 4) as char) as win_start FROM perf_offline_day partition (p20210907, p20210908) GROUP BY win_start;

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

Query success

3. What did you see instead (Required)

Query return error
baseBuiltinFunc.vecEvalInt() should never be called, please contact the TiDB team for help

4. What is your TiDB version? (Required)

master
commit 90ccd6a

@tiancaiamao
Copy link
Contributor Author

The plan looks like this, @@partition_prune_mode = 'static' is assumed:

mysql> SELECT cast(floor(hour(ts) / 4) as char) as win_start FROM perf_offline_day partition (p20210907, p20210908) GROUP BY win_start;
ERROR 1105 (HY000): baseBuiltinFunc.vecEvalInt() should never be called, please contact the TiDB team for help
mysql> explain SELECT cast(floor(hour(ts) / 4) as char) as win_start FROM perf_offline_day partition (p20210907, p20210908) GROUP BY win_start;
+------------------------------------+----------+-----------+----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id                                 | estRows  | task      | access object                                                        | operator info                                                                                                                                                                                                                                                          |
+------------------------------------+----------+-----------+----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Projection_11                      | 8001.00  | root      |                                                                      | cast(floor(div(cast(hour(cast(test.perf_offline_day.ts, time)), decimal(20,0) BINARY), 4)), var_string(5))->Column#7                                                                                                                                                   |
| └─HashAgg_12                       | 8001.00  | root      |                                                                      | group by:Column#9, funcs:firstrow(Column#10)->test.perf_offline_day.ts                                                                                                                                                                                                 |
|   └─PartitionUnion_13              | 8001.00  | root      |                                                                      |                                                                                                                                                                                                                                                                        |
|     ├─HashAgg_14                   | 8000.00  | root      |                                                                      | group by:Column#17, funcs:firstrow(Column#15)->Column#10, funcs:firstrow(Column#16)->Column#9                                                                                                                                                                          |
|     │ └─Projection_34              | 10000.00 | root      |                                                                      | test.perf_offline_day.ts, cast(floor(div(cast(hour(cast(test.perf_offline_day.ts, time)), decimal(20,0) BINARY), 4)), var_string(5))->Column#16, cast(floor(div(cast(hour(cast(test.perf_offline_day.ts, time)), decimal(20,0) BINARY), 4)), var_string(5))->Column#17 |
|     │   └─IndexReader_19           | 10000.00 | root      |                                                                      | index:IndexFullScan_18                                                                                                                                                                                                                                                 |
|     │     └─IndexFullScan_18       | 10000.00 | cop[tikv] | table:perf_offline_day, partition:p20210907, index:PRIMARY(uuid, ts) | keep order:false, stats:pseudo                                                                                                                                                                                                                                         |
|     └─HashAgg_24                   | 1.00     | root      |                                                                      | group by:Column#20, funcs:firstrow(Column#18)->Column#10, funcs:firstrow(Column#19)->Column#9                                                                                                                                                                          |
|       └─Projection_35              | 1.00     | root      |                                                                      | test.perf_offline_day.ts, cast(floor(div(cast(hour(cast(test.perf_offline_day.ts, time)), decimal(20,0) BINARY), 4)), var_string(5))->Column#19, cast(floor(div(cast(hour(cast(test.perf_offline_day.ts, time)), decimal(20,0) BINARY), 4)), var_string(5))->Column#20 |
|         └─IndexReader_29           | 1.00     | root      |                                                                      | index:IndexFullScan_28                                                                                                                                                                                                                                                 |
|           └─IndexFullScan_28       | 1.00     | cop[tikv] | table:perf_offline_day, partition:p20210908, index:PRIMARY(uuid, ts) | keep order:false, stats:pseudo                                                                                                                                                                                                                                         |
+------------------------------------+----------+-----------+----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
11 rows in set, 4 warnings (0.00 sec)

@github-actions
Copy link

github-actions bot commented Nov 1, 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.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
3 participants