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

sql: internal error: runtime error: index out of range #40623

Closed
maddyblue opened this issue Sep 10, 2019 · 0 comments · Fixed by #40626
Closed

sql: internal error: runtime error: index out of range #40623

maddyblue opened this issue Sep 10, 2019 · 0 comments · Fixed by #40626
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-rsg Random Syntax Generator

Comments

@maddyblue
Copy link
Contributor

SELECT width_bucket(e'7euZe\x1e':::STRING:::NAME, ARRAY[]:::INTERVAL[]);
pq: internal error: runtime error: index out of range
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/util/errorutil/catch.go:29: ShouldCatch()
github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/builder.go:97: func1()
runtime/panic.go:522: gopanic()
runtime/panic.go:44: panicindex()
github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtins.go:2411: func176()
github.com/cockroachdb/cockroach/pkg/sql/sem/tree/eval.go:3832: Eval()
github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/scalar.go:96: buildScalar()
github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:356: buildValues()
github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/relational.go:183: buildRelational()
github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/builder.go:117: build()
github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder/builder.go:105: Build()
github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:169: makeOptimizerPlan()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:734: makeExecPlan()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:616: dispatchToExecutionEngine()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:417: execStmtInOpenState()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:98: execStmt()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1238: execCmd()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1167: run()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:444: ServeConn()
github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:584: func1()
@maddyblue maddyblue added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-rsg Random Syntax Generator labels Sep 10, 2019
craig bot pushed a commit that referenced this issue Sep 10, 2019
40626: sql/sem/builtins: fix width_bucket for 0-length arrays r=mjibson a=mjibson

Fixes #40623

Release note (bug fix): width_bucket no longer errors on 0-length arrays

Co-authored-by: Matt Jibson <matt.jibson@gmail.com>
@craig craig bot closed this as completed in de08130 Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-rsg Random Syntax Generator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants