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

SELECT INTO panic #8539

Open
max-hoffman opened this issue Nov 7, 2024 · 0 comments
Open

SELECT INTO panic #8539

max-hoffman opened this issue Nov 7, 2024 · 0 comments
Labels
analyzer good repro Easily reproducible bugs panic

Comments

@max-hoffman
Copy link
Contributor

repro:

Create table rawdata (
  Id int primary key,
  name varchar(10),
  Metadata varchar(10),
  statistical enum('yes','no','uncertain'),
  Robustness enum('yes','no','uncertain')
);


CREATE TABLE data LIKE rawdata;

SELECT
id, name, metadata,
  CASE
    WHEN statistical = 'yes' THEN robustness
    ELSE NULL
  END as robustness
 from rawdata
INTO data;

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x28 pc=0x106557f6c]

goroutine 1 [running]:
github.com/dolthub/go-mysql-server/sql/planbuilder.(*Builder).BindOnly.func1()
	/Users/maxhoffman/go/github.com/dolthub/go-mysql-server/sql/planbuilder/parse.go:99 +0x98
panic({0x107a9ef40?, 0x1093e5c20?})
	/Users/maxhoffman/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.7.darwin-arm64/src/runtime/panic.go:770 +0x124
github.com/dolthub/go-mysql-server/sql/planbuilder.(*procCtx).GetVar(0x0, {0x14000011da0, 0x4})
	/Users/maxhoffman/go/github.com/dolthub/go-mysql-server/sql/planbuilder/proc.go:89 +0x6c
github.com/dolthub/go-mysql-server/sql/planbuilder.(*Builder).buildInto(0x14000943ad0?, 0x14000994780, 0x14000af3ce0)
	/Users/maxhoffman/go/github.com/dolthub/go-mysql-server/sql/planbuilder/dml.go:734 +0x680
github.com/dolthub/go-mysql-server/sql/planbuilder.(*Builder).buildSubquery(0x14000943ad0, 0x14000cecf00?, {0x107eab348, 0x140005b36c0}, {0x14000aa8630, 0x88}, {0x14000aa8630?, 0x88?})
	/Users/maxhoffman/go/github.com/dolthub/go-mysql-server/sql/planbuilder/builder.go:225 +0x2130
github.com/dolthub/go-mysql-server/sql/planbuilder.(*Builder).build(...)
	/Users/maxhoffman/go/github.com/dolthub/go-mysql-server/sql/planbuilder/builder.go:212
github.com/dolthub/go-mysql-server/sql/planbuilder.(*Builder).BindOnly(0x14000943ad0, {0x107eab348, 0x140005b36c0}, {0x14000aa8630, 0x88}, 0x0)
	/Users/maxhoffman/go/github.com/dolthub/go-mysql-server/sql/planbuilder/parse.go:111 +0x134
@max-hoffman max-hoffman added panic analyzer good repro Easily reproducible bugs labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer good repro Easily reproducible bugs panic
Projects
None yet
Development

No branches or pull requests

1 participant