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

Explaining for connection return runtime error after EXECUTE Statement #16110

Closed
ChenPeng2013 opened this issue Apr 7, 2020 · 0 comments · Fixed by #16206
Closed

Explaining for connection return runtime error after EXECUTE Statement #16110

ChenPeng2013 opened this issue Apr 7, 2020 · 0 comments · Fixed by #16206
Assignees
Labels
severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Milestone

Comments

@ChenPeng2013
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

prepared-plan-cache.enabled=true;

use test;
drop table if exists t;
create table t(a int);
select connection_id();
prepare stmt from "select * from t where a=?";
set @a=1;
execute stmt using @a;
# explain for connection id;

2. What did you expect to see?

mysql> explain for connection 1;
+-------------------------+----------+-----------+---------------+--------------------------------+
| id                      | estRows  | task      | access object | operator info                  |
+-------------------------+----------+-----------+---------------+--------------------------------+
| TableReader_7           | 10.00    | root      |               | data:Selection_6               |
| └─Selection_6       | 10.00    | cop[tikv] |               | eq(test.t.a, 1)                |
|   └─TableFullScan_5 | 10000.00 | cop[tikv] | table:t       | keep order:false, stats:pseudo |
+-------------------------+----------+-----------+---------------+--------------------------------+

3. What did you see instead?

mysql> explain for connection 1;
ERROR 1105 (HY000): runtime error: index out of range [0] with length 0

4. What version of TiDB are you using? (tidb-server -V or run select tidb_version(); on TiDB)

Release Version: v4.0.0-beta.2-151-g78922a8ab
Git Commit Hash: 78922a8abef2f21e4d8990d37c6c67ac7b0eef42
Git Branch: release-4.0
UTC Build Time: 2020-04-07 06:22:22
GoVersion: go1.13.1
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants