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

bug: with recursive bind table panic #17295

Open
1 of 2 tasks
b41sh opened this issue Jan 15, 2025 · 0 comments
Open
1 of 2 tasks

bug: with recursive bind table panic #17295

b41sh opened this issue Jan 15, 2025 · 0 comments
Assignees
Labels
C-bug Category: something isn't working found-by-sqlsmith

Comments

@b41sh
Copy link
Member

b41sh commented Jan 15, 2025

Search before asking

  • I had searched in the issues and found no similar issues.

Version

main

What's Wrong?

with recursive bind table panic
found by fuzz sqlite test

panicked at src/query/sql/src/planner/binder/table.rs:243:20:
index out of bounds: the len is 0 but the index is 0

How to Reproduce?

root@0.0.0.0:48000/tt> CREATE TABLE link(aa INT, bb INT);
root@0.0.0.0:48000/tt> WITH RECURSIVE closure(x) AS (VALUES(1) UNION SELECT 1 FROM closure, link WHERE link.bb = closure.x QUALIFY rank() OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) UNION SELECT d = '10', lead(b, b) OVER (PARTITION BY b % 10 ORDER BY b, a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW), first_value(b) OVER (ORDER BY b % 10, a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM closure, link WHERE link.aa = closure.x HAVING row_number() OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW)) SELECT x FROM closure ORDER BY x;
error: APIError: QueryFailed: [1104]index out of bounds: the len is 0 but the index is 0

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@b41sh b41sh added C-bug Category: something isn't working found-by-sqlsmith labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working found-by-sqlsmith
Projects
None yet
Development

No branches or pull requests

2 participants