-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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): runtime error: index out of range [0] with length 0 #49986
Labels
affects-6.5
This bug affects the 6.5.x(LTS) versions.
affects-7.1
This bug affects the 7.1.x(LTS) versions.
affects-7.5
This bug affects the 7.5.x(LTS) versions.
found/gs
found by gs
report/community
The community has encountered this bug.
report/customer
Customers have encountered this bug.
severity/moderate
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
type/regression
Comments
jackysp
added
type/bug
The issue is confirmed as a bug.
sig/planner
SIG: Planner
found/gs
found by gs
labels
Jan 2, 2024
13 tasks
AilinKid
added
affects-6.5
This bug affects the 6.5.x(LTS) versions.
affects-7.1
This bug affects the 7.1.x(LTS) versions.
affects-7.5
This bug affects the 7.5.x(LTS) versions.
severity/moderate
labels
Jan 3, 2024
This was referenced Jan 3, 2024
/type regression |
Regression Analysis |
/found customer |
/found community |
A workaround: WITH RECURSIVE t AS (
SELECT a.i,
CASE WHEN b.j = '20001' THEN b.l ELSE b.k END AS an,
ROW_NUMBER() OVER (PARTITION BY a.i ORDER BY CASE WHEN b.j = '20001' THEN b.l ELSE b.k END) AS rn,
(SELECT COUNT(*) FROM acc WHERE m = 'astp2019121731703151') AS total_count
FROM ast a
INNER JOIN acc b ON a.i = b.m
WHERE a.i = 'astp2019121731703151'
),
t1 AS (
SELECT i, an, rn, total_count, CAST(an AS CHAR(1000)) AS concatenated
FROM t
WHERE rn = 1
UNION ALL
SELECT t.i, t.an, t.rn, t.total_count, CONCAT(t1.concatenated, '; ', t.an)
FROM t
INNER JOIN t1 ON t.i = t1.i AND t.rn = t1.rn + 1
),
final AS (
SELECT i, concatenated AS an
FROM t1
WHERE rn = total_count
)
SELECT * FROM final; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects-6.5
This bug affects the 6.5.x(LTS) versions.
affects-7.1
This bug affects the 7.1.x(LTS) versions.
affects-7.5
This bug affects the 7.5.x(LTS) versions.
found/gs
found by gs
report/community
The community has encountered this bug.
report/customer
Customers have encountered this bug.
severity/moderate
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
type/regression
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
No error.
3. What did you see instead (Required)
Panicked.
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: